summaryrefslogtreecommitdiff
path: root/compat/mingw.h
diff options
context:
space:
mode:
authorLibravatar Peter Harris <git@peter.is-a-geek.org>2008-07-18 09:34:44 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-07-19 11:17:43 -0700
commitc09df8a74e8b5e106ad853cbb1e52f36b3663386 (patch)
tree95ef2a4efa7db8a4886e13226f51dbb1c91dc972 /compat/mingw.h
parentbuiltin-clone: rewrite guess_dir_name() (diff)
downloadtgif-c09df8a74e8b5e106ad853cbb1e52f36b3663386.tar.xz
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 5a3bcee29b..8ffec51e73 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
*/