diff --git a/SConstruct b/SConstruct index fc4d792cca9..3ae4c04dec6 100644 --- a/SConstruct +++ b/SConstruct @@ -576,7 +576,7 @@ elif "win32" == os.sys.platform: # some warnings we don't like: env.Append( CPPFLAGS=" /wd4355 /wd4800 /wd4267 /wd4244 " ) - env.Append( CPPDEFINES=["WIN32","_CONSOLE","_CRT_SECURE_NO_WARNINGS","HAVE_CONFIG_H","PCRE_STATIC","SUPPORT_UCP","SUPPORT_UTF8","PSAPI_VERSION=1" ] ) + env.Append( CPPDEFINES=["_CONSOLE","_CRT_SECURE_NO_WARNINGS","HAVE_CONFIG_H","PCRE_STATIC","SUPPORT_UCP","SUPPORT_UTF8","PSAPI_VERSION=1" ] ) #env.Append( CPPFLAGS=' /Yu"pch.h" ' ) # this would be for pre-compiled headers, could play with it later diff --git a/db/instance.cpp b/db/instance.cpp index 60a80cdad96..d4455cec2c7 100644 --- a/db/instance.cpp +++ b/db/instance.cpp @@ -71,7 +71,7 @@ namespace mongo { KillCurrentOp killCurrentOp; int lockFile = 0; -#ifdef WIN32 +#ifdef _WIN32 HANDLE lockFileHandle; #endif @@ -782,7 +782,7 @@ namespace mongo { /* This ought to be an unlink(), but Eliot says the last time that was attempted, there was a race condition with acquirePathLock(). */ -#ifdef WIN32 +#ifdef _WIN32 if( _chsize( lockFile , 0 ) ) log() << "couldn't remove fs lock " << getLastError() << endl; CloseHandle(lockFileHandle); @@ -858,7 +858,7 @@ namespace mongo { ss << getpid() << endl; string s = ss.str(); const char * data = s.c_str(); -#ifdef WIN32 +#ifdef _WIN32 assert ( _write( fd, data, strlen( data ) ) ); #else assert ( write( fd, data, strlen( data ) ) ); @@ -874,7 +874,7 @@ namespace mongo { oldFile = true; } -#ifdef WIN32 +#ifdef _WIN32 lockFileHandle = CreateFileA( name.c_str(), GENERIC_READ | GENERIC_WRITE, 0 /* do not allow anyone else access */, NULL, OPEN_ALWAYS /* success if fh can open */, 0, NULL ); @@ -945,7 +945,7 @@ namespace mongo { if (!errmsg.empty()) { cout << errmsg << endl; -#ifdef WIN32 +#ifdef _WIN32 CloseHandle( lockFileHandle ); #else close ( lockFile ); @@ -964,7 +964,7 @@ namespace mongo { uasserted(13597, "can't start without --journal enabled when journal/ files are present"); } -#ifdef WIN32 +#ifdef _WIN32 uassert( 13625, "Unable to truncate lock file", _chsize(lockFile, 0) == 0); writePid( lockFile ); _commit( lockFile ); diff --git a/db/instance.h b/db/instance.h index 6bac3d432e2..7bf163eb6ae 100644 --- a/db/instance.h +++ b/db/instance.h @@ -151,7 +151,7 @@ namespace mongo { }; extern int lockFile; -#ifdef WIN32 +#ifdef _WIN32 extern HANDLE lockFileHandle; #endif void acquirePathLock(bool doingRepair=false); // if doingRepair=true don't consider unclean shutdown an error diff --git a/db/security_key.cpp b/db/security_key.cpp index 1ea702127bd..eb6a026ee2a 100644 --- a/db/security_key.cpp +++ b/db/security_key.cpp @@ -41,7 +41,7 @@ namespace mongo { return false; } -#if !defined(WIN32) +#if !defined(_WIN32) // check permissions: must be X00, where X is >= 4 if ((stats.st_mode & (S_IRWXG|S_IRWXO)) != 0) { log() << "permissions on " << filename << " are too open" << endl; diff --git a/pch.h b/pch.h index 81abbaedc41..15819e2af31 100644 --- a/pch.h +++ b/pch.h @@ -31,13 +31,6 @@ # define _CRT_SECURE_NO_WARNINGS #endif -// [dm] i am not sure why we need this. -#if defined(WIN32) -# ifndef _WIN32 -# define _WIN32 -# endif -#endif - #if defined(_WIN32) // for rand_s() usage: # define _CRT_RAND_S diff --git a/util/concurrency/spin_lock.cpp b/util/concurrency/spin_lock.cpp index 679159ac7bb..1811f15d4bd 100644 --- a/util/concurrency/spin_lock.cpp +++ b/util/concurrency/spin_lock.cpp @@ -72,7 +72,7 @@ namespace mongo { } void SpinLock::unlock() { -#if defined(WIN32) +#if defined(_WIN32) LeaveCriticalSection(&_cs); #elif defined(__USE_XOPEN2K) pthread_spin_unlock(&_lock);