summaryrefslogtreecommitdiff
path: root/pch.h
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-09-14 17:08:06 +0200
committerAntonin Kral <a.kral@bobek.cz>2011-09-14 17:08:06 +0200
commit5d342a758c6095b4d30aba0750b54f13b8916f51 (patch)
tree762e9aa84781f5e3b96db2c02d356c29cf0217c0 /pch.h
parentcbe2d992e9cd1ea66af9fa91df006106775d3073 (diff)
downloadmongodb-5d342a758c6095b4d30aba0750b54f13b8916f51.tar.gz
Imported Upstream version 2.0.0
Diffstat (limited to 'pch.h')
-rw-r--r--pch.h36
1 files changed, 26 insertions, 10 deletions
diff --git a/pch.h b/pch.h
index c70f316..1e9684d 100644
--- a/pch.h
+++ b/pch.h
@@ -31,26 +31,33 @@
# 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
# ifndef NOMINMAX
# define NOMINMAX
# endif
+#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)
+// glibc's optimized versions are better than g++ builtins
+# define __builtin_strcmp strcmp
+# define __builtin_strlen strlen
+# define __builtin_memchr memchr
+# define __builtin_memcmp memcmp
+# define __builtin_memcpy memcpy
+# define __builtin_memset memset
+# define __builtin_memmove memmove
+#endif
+
+
#include <ctime>
+#include <cstring>
#include <sstream>
#include <string>
#include <memory>
@@ -69,9 +76,9 @@
#include "string.h"
#include "limits.h"
-#include <boost/any.hpp>
+//#include <boost/any.hpp>
#include "boost/thread/once.hpp"
-#include <boost/archive/iterators/transform_width.hpp>
+//#include <boost/archive/iterators/transform_width.hpp>
#define BOOST_FILESYSTEM_VERSION 2
#include <boost/filesystem/convenience.hpp>
#include <boost/filesystem/exception.hpp>
@@ -144,7 +151,11 @@ namespace mongo {
void asserted(const char *msg, const char *file, unsigned line);
}
-#define MONGO_assert(_Expression) (void)( (!!(_Expression)) || (mongo::asserted(#_Expression, __FILE__, __LINE__), 0) )
+
+
+// TODO: Rework the headers so we don't need this craziness
+#include "bson/inline_decls.h"
+#define MONGO_assert(_Expression) (void)( MONGO_likely(!!(_Expression)) || (mongo::asserted(#_Expression, __FILE__, __LINE__), 0) )
#include "util/debug_util.h"
#include "util/goodies.h"
@@ -162,6 +173,11 @@ namespace mongo {
using boost::uint32_t;
using boost::uint64_t;
+ /** called by mongos, mongod, test. do not call from clients and such.
+ invoked before about everything except global var construction.
+ */
+ void doPreServerStatupInits();
+
} // namespace mongo
#endif // MONGO_PCH_H