From fa37e9da4b02810eedbb0ac82e8cd0b99336aa82 Mon Sep 17 00:00:00 2001 From: Nguyễn Thái Ngọc Duy Date: Wed, 14 Apr 2010 02:12:01 +0200 Subject: win32: Support certain ANSI sequences on cmd.exe Support sequences are mostly color ones. This was extracted from commit e56b799d6ad8afba4168fffa7218d44c041a72d2 in Git repository. Changes from original version: > diff --git a/home/pclouds/w/git/compat/winansi.c b/tmp/winansi2.c > index 44dc293..e2e7010 100644 > --- a/home/pclouds/w/git/compat/winansi.c > +++ b/tmp/winansi2.c > @@ -2,8 +2,9 @@ > * Copyright 2008 Peter Harris > */ > > +#include "libbb.h" > #include > -#include "../git-compat-util.h" > +#undef PACKED > > /* > Functions to be wrapped: --- include/mingw.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') diff --git a/include/mingw.h b/include/mingw.h index d5a675507..fd9630a58 100644 --- a/include/mingw.h +++ b/include/mingw.h @@ -121,6 +121,17 @@ NOIMPL(sigfillset,int *mask UNUSED_PARAM); int fdprintf(int fd, const char *format, ...); +/* + * 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__) + /* * stdlib.h */ -- cgit v1.2.3-55-g6feb