diff options
Diffstat (limited to 'src/mongo/pch.h')
-rw-r--r-- | src/mongo/pch.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/mongo/pch.h b/src/mongo/pch.h index 8a419c5e6fc..b1db1664979 100644 --- a/src/mongo/pch.h +++ b/src/mongo/pch.h @@ -21,6 +21,8 @@ #ifndef MONGO_PCH_H #define MONGO_PCH_H +// MONGO_EXPOSE_MACROS is defined for internal mongo programs. +// C++ driver consumers do not define this. #if defined(MONGO_EXPOSE_MACROS) # define JS_C_STRINGS_ARE_UTF8 @@ -30,22 +32,27 @@ # define SUPPORT_UTF8 # undef _CRT_SECURE_NO_WARNINGS # define _CRT_SECURE_NO_WARNINGS + #endif +// our #define macros must not be active when we include +// system headers and boost headers +#include "mongo/client/undef_macros.h" + #if defined(_WIN32) // for rand_s() usage: # define _CRT_RAND_S # ifndef NOMINMAX # define NOMINMAX # endif -#define WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN # include <winsock2.h> //this must be included before the first windows.h include # include <ws2tcpip.h> # include <wspiapi.h> # include <windows.h> #endif -#if defined(__linux__) && defined(MONGO_EXPOSE_MACROS) +#if defined(__linux__) // glibc's optimized versions are better than g++ builtins # define __builtin_strcmp strcmp # define __builtin_strlen strlen @@ -56,7 +63,6 @@ # define __builtin_memmove memmove #endif - #include <ctime> #include <cstring> #include <string> @@ -88,6 +94,8 @@ #include <boost/thread/recursive_mutex.hpp> #include <boost/thread/xtime.hpp> +#include "mongo/client/redef_macros.h" + namespace mongo { using namespace std; @@ -141,8 +149,8 @@ namespace mongo { #include "util/assert_util.h" #include "util/debug_util.h" #include "util/goodies.h" -#include "util/log.h" #include "util/allocator.h" +#include "util/log.h" namespace mongo { |