Use GMX_NATIVE_WINDOWS in path.cpp.
authorTeemu Murtola <teemu.murtola@gmail.com>
Thu, 3 May 2012 03:47:11 +0000 (06:47 +0300)
committerTeemu Murtola <teemu.murtola@gmail.com>
Thu, 3 May 2012 03:47:11 +0000 (06:47 +0300)
Change-Id: I0b321532e85cfb2429994171aade49f1021b51c7

src/gromacs/utility/path.cpp

index 4bf0e07afdf7057abcc5eb8550fe089aef6f9317..9f822cd7e86e3ae8b483f9879a3dc323404f6ad4 100644 (file)
  */
 #include "path.h"
 
+#include "gmx_header_config.h"
+
 #include <errno.h>
 #include <sys/stat.h>
 
-#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && !defined __CYGWIN__ && !defined __CYGWIN32__)
+#ifdef GMX_NATIVE_WINDOWS
 #include <direct.h>
 #endif
 
@@ -72,7 +74,7 @@ int Directory::create(const char *path)
     {
         return 0;
     }
-#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && !defined __CYGWIN__ && !defined __CYGWIN32__)
+#ifdef GMX_NATIVE_WINDOWS
     if (_mkdir(path))
 #else
     if (mkdir(path, S_IRWXU | S_IRWXG | S_IROTH | S_IWOTH) != 0)
@@ -102,7 +104,7 @@ bool Directory::exists(const char *path)
         }
         return false;
     }
-#if ((defined WIN32 || defined _WIN32 || defined WIN64 || defined _WIN64) && !defined __CYGWIN__ && !defined __CYGWIN32__)
+#ifdef GMX_NATIVE_WINDOWS
     return ((_S_IFDIR & info.st_mode) != 0);
 #else
     return S_ISDIR(info.st_mode);