diff options
author | Peter Harris <git@peter.is-a-geek.org> | 2008-07-18 09:34:44 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-19 11:17:43 -0700 |
commit | c09df8a74e8b5e106ad853cbb1e52f36b3663386 (patch) | |
tree | 95ef2a4efa7db8a4886e13226f51dbb1c91dc972 /compat/mingw.h | |
parent | builtin-clone: rewrite guess_dir_name() (diff) | |
download | tgif-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.h | 11 |
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 */ |