summaryrefslogtreecommitdiff
path: root/compat/mingw.h
diff options
context:
space:
mode:
authorPeter Harris <git@peter.is-a-geek.org>2008-07-18 07:34:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-07-19 18:17:43 (GMT)
commitc09df8a74e8b5e106ad853cbb1e52f36b3663386 (patch)
tree95ef2a4efa7db8a4886e13226f51dbb1c91dc972 /compat/mingw.h
parentb8c5db35fc23913d72c52d990d399b8ef66b646f (diff)
downloadgit-c09df8a74e8b5e106ad853cbb1e52f36b3663386.zip
git-c09df8a74e8b5e106ad853cbb1e52f36b3663386.tar.gz
git-c09df8a74e8b5e106ad853cbb1e52f36b3663386.tar.bz2
Add ANSI control code emulation for the Windows console
This adds only the minimum necessary to keep git pull/merge's diffstat from wrapping. Notably absent is support for the K (erase) operation, and support for POSIX write. Signed-off-by: Peter Harris <git@peter.is-a-geek.org> Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat/mingw.h')
-rw-r--r--compat/mingw.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/compat/mingw.h b/compat/mingw.h
index 5a3bcee..8ffec51 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -194,6 +194,17 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler);
#define signal mingw_signal
/*
+ * ANSI emulation wrappers
+ */
+
+int winansi_fputs(const char *str, FILE *stream);
+int winansi_printf(const char *format, ...) __attribute__((format (printf, 1, 2)));
+int winansi_fprintf(FILE *stream, const char *format, ...) __attribute__((format (printf, 2, 3)));
+#define fputs winansi_fputs
+#define printf(...) winansi_printf(__VA_ARGS__)
+#define fprintf(...) winansi_fprintf(__VA_ARGS__)
+
+/*
* git specific compatibility
*/