summaryrefslogtreecommitdiff
path: root/src/mongo/platform
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-10-07 19:10:19 -0400
committerAndrew Morrow <acm@10gen.com>2013-10-08 14:09:38 -0400
commitc70a72b151fcfab26d0db5e8ceeb7c04a96ce449 (patch)
tree3f61387c49fee351a92874c2f33bd1fddb46f076 /src/mongo/platform
parentd1677de5267ca8a289eb6f53297978fa36fbed58 (diff)
downloadmongo-c70a72b151fcfab26d0db5e8ceeb7c04a96ce449.tar.gz
SERVER-11070 When using libc++, things are never found in TR1, even in C++03 mode
Diffstat (limited to 'src/mongo/platform')
-rw-r--r--src/mongo/platform/hash_namespace.h13
-rw-r--r--src/mongo/platform/unordered_map.h13
-rw-r--r--src/mongo/platform/unordered_set.h13
3 files changed, 27 insertions, 12 deletions
diff --git a/src/mongo/platform/hash_namespace.h b/src/mongo/platform/hash_namespace.h
index 652887c7002..71283686761 100644
--- a/src/mongo/platform/hash_namespace.h
+++ b/src/mongo/platform/hash_namespace.h
@@ -15,10 +15,15 @@
#pragma once
-// NOTE(acm): Before gcc-4.7, __cplusplus is always defined to be 1,
-// so we can't reliably detect C++11 support by exclusively checking
-// the value of __cplusplus.
-#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
+// We need to drag in a C++ header so we can examine __GXX_EXPERIMENTAL_CXX0X__ or
+// _LIBCPP_VERSION meaningfully. The <new> header is pretty lightweight, mostly unavoidable,
+// and almost certain to bring in the standard library configuration macros.
+#include <new>
+
+// NOTE(acm): Before gcc-4.7, __cplusplus is always defined to be 1, so we can't reliably
+// detect C++11 support by exclusively checking the value of __cplusplus. Additionaly, libc++,
+// whether in C++11 or C++03 mode, doesn't use TR1 and drops things into std instead.
+#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(_LIBCPP_VERSION)
#include <functional>
diff --git a/src/mongo/platform/unordered_map.h b/src/mongo/platform/unordered_map.h
index a246fe6ecc4..4cc9b37b9dc 100644
--- a/src/mongo/platform/unordered_map.h
+++ b/src/mongo/platform/unordered_map.h
@@ -15,10 +15,15 @@
#pragma once
-// NOTE(acm): Before gcc-4.7, __cplusplus is always defined to be 1,
-// so we can't reliably detect C++11 support by exclusively checking
-// the value of __cplusplus.
-#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
+// We need to drag in a C++ header so we can examine __GXX_EXPERIMENTAL_CXX0X__ or
+// _LIBCPP_VERSION meaningfully. The <new> header is pretty lightweight, mostly unavoidable,
+// and almost certain to bring in the standard library configuration macros.
+#include <new>
+
+// NOTE(acm): Before gcc-4.7, __cplusplus is always defined to be 1, so we can't reliably
+// detect C++11 support by exclusively checking the value of __cplusplus. Additionaly, libc++,
+// whether in C++11 or C++03 mode, doesn't use TR1 and drops things into std instead.
+#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(_LIBCPP_VERSION)
#include <unordered_map>
diff --git a/src/mongo/platform/unordered_set.h b/src/mongo/platform/unordered_set.h
index 79c91d66065..b47c3ae10bf 100644
--- a/src/mongo/platform/unordered_set.h
+++ b/src/mongo/platform/unordered_set.h
@@ -15,10 +15,15 @@
#pragma once
-// NOTE(acm): Before gcc-4.7, __cplusplus is always defined to be 1,
-// so we can't reliably detect C++11 support by exclusively checking
-// the value of __cplusplus.
-#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)
+// We need to drag in a C++ header so we can examine __GXX_EXPERIMENTAL_CXX0X__ or
+// _LIBCPP_VERSION meaningfully. The <new> header is pretty lightweight, mostly unavoidable,
+// and almost certain to bring in the standard library configuration macros.
+#include <new>
+
+// NOTE(acm): Before gcc-4.7, __cplusplus is always defined to be 1, so we can't reliably
+// detect C++11 support by exclusively checking the value of __cplusplus. Additionaly, libc++,
+// whether in C++11 or C++03 mode, doesn't use TR1 and drops things into std instead.
+#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__) || defined(_LIBCPP_VERSION)
#include <unordered_set>