THRIFT-2045: C++ compiler warning and build cleanup
Client: cpp compiler, go compiler, python compiler, compiler build
Patch: Ben Craig
diff --git a/compiler/cpp/src/platform.h b/compiler/cpp/src/platform.h
index 04f04c7..7eb891d 100644
--- a/compiler/cpp/src/platform.h
+++ b/compiler/cpp/src/platform.h
@@ -22,7 +22,11 @@
* is different for the non-POSIX MinGW
*/
-#ifdef MINGW
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef _WIN32
#include <direct.h>
#include <io.h>
#else
@@ -30,8 +34,14 @@
#include <sys/stat.h>
#endif
-#if defined MINGW
+#ifdef _WIN32
#define MKDIR(x) mkdir(x)
#else
#define MKDIR(x) mkdir(x, S_IRWXU | S_IRWXG | S_IRWXO)
#endif
+
+#ifdef PATH_MAX
+#define THRIFT_PATH_MAX PATH_MAX
+#else
+#define THRIFT_PATH_MAX MAX_PATH
+#endif