diff options
author | Ron Yorston <rmy@pobox.com> | 2014-03-19 11:44:05 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2014-03-19 11:44:05 +0000 |
commit | 114ddd900acf9de27cc9e651d0af26df3948d34f (patch) | |
tree | 2dacb8e311a33e319a8bd6385efff890487a7ba9 /include | |
parent | cfb45378f7ecbfa87ad0b61e9463dd83bc5ce615 (diff) | |
download | busybox-w32-114ddd900acf9de27cc9e651d0af26df3948d34f.tar.gz busybox-w32-114ddd900acf9de27cc9e651d0af26df3948d34f.tar.bz2 busybox-w32-114ddd900acf9de27cc9e651d0af26df3948d34f.zip |
Use OEM codepage for console I/O
Windows console applications use different codepages for console I/O
and the rest of the API:
http://msdn.microsoft.com/en-us/goglobal/bb688114.aspx#E2F
Attempt to workaround this by converting characters when they're read from
and written to the console. Not all possible paths are handled.
Diffstat (limited to 'include')
-rw-r--r-- | include/mingw.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mingw.h b/include/mingw.h index 31795bc40..a1a9f5f30 100644 --- a/include/mingw.h +++ b/include/mingw.h | |||
@@ -140,9 +140,13 @@ int mingw_pclose(FILE *fd); | |||
140 | * ANSI emulation wrappers | 140 | * ANSI emulation wrappers |
141 | */ | 141 | */ |
142 | 142 | ||
143 | int winansi_putchar(int c); | ||
144 | size_t winansi_fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream); | ||
143 | int winansi_fputs(const char *str, FILE *stream); | 145 | int winansi_fputs(const char *str, FILE *stream); |
144 | int winansi_printf(const char *format, ...) __attribute__((format (printf, 1, 2))); | 146 | int winansi_printf(const char *format, ...) __attribute__((format (printf, 1, 2))); |
145 | int winansi_fprintf(FILE *stream, const char *format, ...) __attribute__((format (printf, 2, 3))); | 147 | int winansi_fprintf(FILE *stream, const char *format, ...) __attribute__((format (printf, 2, 3))); |
148 | #define putchar winansi_putchar | ||
149 | #define fwrite winansi_fwrite | ||
146 | #define fputs winansi_fputs | 150 | #define fputs winansi_fputs |
147 | #define printf(...) winansi_printf(__VA_ARGS__) | 151 | #define printf(...) winansi_printf(__VA_ARGS__) |
148 | #define fprintf(...) winansi_fprintf(__VA_ARGS__) | 152 | #define fprintf(...) winansi_fprintf(__VA_ARGS__) |