diff --git a/build/wince/shunt/include/mozce_shunt.h b/build/wince/shunt/include/mozce_shunt.h index 65751b82311..a907b3d7011 100755 --- a/build/wince/shunt/include/mozce_shunt.h +++ b/build/wince/shunt/include/mozce_shunt.h @@ -97,6 +97,17 @@ #endif #define isatty mozce_isatty + +#ifdef fileno +#undef fileno +#endif +#define fileno mozce_fileno + +#ifdef _fileno +#undef _fileno +#endif +#define _fileno mozce_fileno + // math.cpp /* #define fd_acos acos @@ -1182,6 +1193,7 @@ extern "C" { // From io.cpp MOZCE_SHUNT_API int mozce_chmod(const char* inFilename, int inMode); MOZCE_SHUNT_API int mozce_isatty(int inHandle); + MOZCE_SHUNT_API int mozce_fileno(FILE* inHandle); // From mbstring.cpp MOZCE_SHUNT_API unsigned char* mozce_mbsinc(const unsigned char* inCurrent); diff --git a/build/wince/shunt/io.cpp b/build/wince/shunt/io.cpp index 3cb0f429d4d..0e6037cfb40 100755 --- a/build/wince/shunt/io.cpp +++ b/build/wince/shunt/io.cpp @@ -103,6 +103,19 @@ MOZCE_SHUNT_API int mozce_isatty(int inHandle) return retval; } +MOZCE_SHUNT_API int mozce_fileno(FILE* file) +{ + MOZCE_PRECHECK + +#ifdef DEBUG + mozce_printf("mozce_fileno called\n"); +#endif + + // Windows SDK is broken. _fileno should return an int, but for whatever god forsaken reason, CE returns void*. + + return (int) _fileno(file); +} + #if 0 {