diff --git a/icu4c/source/extra/uconv/uconv.cpp b/icu4c/source/extra/uconv/uconv.cpp index 581c744cfc..660cb24e37 100644 --- a/icu4c/source/extra/uconv/uconv.cpp +++ b/icu4c/source/extra/uconv/uconv.cpp @@ -38,10 +38,20 @@ #include "unicode/uwmsg.h" -#if (defined(U_WINDOWS) || defined(U_CYGWIN)) && !defined(__STRICT_ANSI__) +#if defined(U_WINDOWS) || defined(U_CYGWIN) #include #include #define USE_FILENO_BINARY_MODE 1 +/* Windows likes to rename Unix-like functions */ +#ifndef fileno +#define fileno _fileno +#endif +#ifndef setmode +#define setmode _setmode +#endif +#ifndef O_BINARY +#define O_BINARY _O_BINARY +#endif #endif #ifdef UCONVMSG_LINK diff --git a/icu4c/source/tools/genrb/derb.c b/icu4c/source/tools/genrb/derb.c index 4bf033d886..a695f4182e 100644 --- a/icu4c/source/tools/genrb/derb.c +++ b/icu4c/source/tools/genrb/derb.c @@ -33,6 +33,17 @@ #if defined(U_WINDOWS) || defined(U_CYGWIN) #include #include +#define USE_FILENO_BINARY_MODE 1 +/* Windows likes to rename Unix-like functions */ +#ifndef fileno +#define fileno _fileno +#endif +#ifndef setmode +#define setmode _setmode +#endif +#ifndef O_BINARY +#define O_BINARY _O_BINARY +#endif #endif #define DERB_VERSION "1.0" @@ -285,7 +296,7 @@ main(int argc, char* argv[]) { if (tostdout) { out = stdout; #if defined(U_WINDOWS) || defined(U_CYGWIN) - if (_setmode(_fileno(out), _O_BINARY) == -1) { + if (setmode(fileno(out), O_BINARY) == -1) { fprintf(stderr, "%s: couldn't set standard output to binary mode\n", pname); return 4; }