diff options
author | Jose <jose@zeroc.com> | 2012-07-26 17:13:54 +0200 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2012-07-26 17:13:54 +0200 |
commit | ad088c09c2a5022eb12dbea4523242e05c5d7bdd (patch) | |
tree | cc69971ee6374439033067c698c5589f978864a7 /cpp/test/IceUtil/unicode/Client.cpp | |
parent | vsadding - fix for update reverse dependencies (diff) | |
download | ice-ad088c09c2a5022eb12dbea4523242e05c5d7bdd.tar.bz2 ice-ad088c09c2a5022eb12dbea4523242e05c5d7bdd.tar.xz ice-ad088c09c2a5022eb12dbea4523242e05c5d7bdd.zip |
MinGW & Ruby-1.9 updates
Diffstat (limited to 'cpp/test/IceUtil/unicode/Client.cpp')
-rw-r--r-- | cpp/test/IceUtil/unicode/Client.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/cpp/test/IceUtil/unicode/Client.cpp b/cpp/test/IceUtil/unicode/Client.cpp index 3f703e0f7f2..f05cb7646b7 100644 --- a/cpp/test/IceUtil/unicode/Client.cpp +++ b/cpp/test/IceUtil/unicode/Client.cpp @@ -23,7 +23,8 @@ using namespace std; // converts these BOMs back and forth. // -#ifdef _WIN32 +//COMPILERFIX: MINGW doesn't support wmain for console applications. +#if defined(_WIN32) && !defined(__MINGW32__) int wmain(int argc, wchar_t* argv[]) @@ -40,7 +41,12 @@ main(int argc, char* argv[]) if(argc > 1) { #ifdef _WIN32 + +# ifdef __MINGW32__ + dir = argv[1]; +# else dir = IceUtil::wstringToString(argv[1]); +# endif dir += "\\"; #else dir = argv[1]; @@ -174,6 +180,7 @@ main(int argc, char* argv[]) cout << "ok" << endl; } +#ifndef __MINGW32__ { cout << "testing UTF-8 filename... "; IceUtilInternal::ifstream fn(dir + "filename.txt"); @@ -200,11 +207,11 @@ main(int argc, char* argv[]) int fd = IceUtilInternal::open(filepath, O_RDONLY); test(fd > 0); -#if defined(_MSC_VER) && (_MSC_VER >= 1400) +# if defined(_MSC_VER) && (_MSC_VER >= 1400) test(_close(fd) == 0); -#else +# else test(close(fd) == 0); -#endif +# endif FILE* f = IceUtilInternal::fopen(filepath, "r"); test(f != 0); @@ -245,5 +252,6 @@ main(int argc, char* argv[]) cout << "ok" << endl; } +#endif return EXIT_SUCCESS; } |