diff options
Diffstat (limited to 'cpp/src/IcePatch2/Util.cpp')
-rw-r--r-- | cpp/src/IcePatch2/Util.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cpp/src/IcePatch2/Util.cpp b/cpp/src/IcePatch2/Util.cpp index afc0a63e795..fa90c6fed94 100644 --- a/cpp/src/IcePatch2/Util.cpp +++ b/cpp/src/IcePatch2/Util.cpp @@ -7,6 +7,14 @@ // // ********************************************************************** +// +// We need to include io.h first to get the proper signature for +// _wfindfirst +// +#ifdef _WIN32 +# include <io.h> +#endif + #include <IceUtil/DisableWarnings.h> #include <IceUtil/IceUtil.h> #include <IcePatch2/Util.h> @@ -17,7 +25,6 @@ #ifdef _WIN32 # include <direct.h> -# include <io.h> #else # include <unistd.h> # include <dirent.h> @@ -501,11 +508,8 @@ IcePatch2::readDirectory(const string& pa) struct _wfinddata_t data; const wstring fs = IceUtil::stringToWstring(simplify(path + "/*")); -#if defined(_MSC_VER) && (_MSC_VER < 1300)
- // - // TODO: Why is this cast necessary? - // - long h = _wfindfirst(const_cast<wchar_t*>(fs.c_str()), &data); +#if defined(_MSC_VER) && (_MSC_VER < 1300) + long h = _wfindfirst(fs.c_str()), &data); #else intptr_t h = _wfindfirst(fs.c_str(), &data); #endif |