summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Morrow <acm@10gen.com>2013-05-29 16:35:31 -0400
committerAndrew Morrow <acm@10gen.com>2013-05-31 11:08:13 -0400
commit2dfcfdf52ff8074f85f3a3a91a6f48ac2545dc5d (patch)
treec698683b6a619329ba0f25cf4b2d4a2f3cdd7351
parent49549b8e8650346540063b9c5b61b020d2021e24 (diff)
downloadmongo-2dfcfdf52ff8074f85f3a3a91a6f48ac2545dc5d.tar.gz
SERVER-8046 Don't prohibit clang from using an unnamed namespace
-rw-r--r--src/mongo/bson/mutable/document.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mongo/bson/mutable/document.cpp b/src/mongo/bson/mutable/document.cpp
index ae24667a186..76935d00d11 100644
--- a/src/mongo/bson/mutable/document.cpp
+++ b/src/mongo/bson/mutable/document.cpp
@@ -387,8 +387,9 @@ namespace mutablebson {
// Work around http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29365. Note that the selection of
// minor version 4 is somewhat arbitrary. It does appear that the fix for this was backported
-// to earlier versions. This is a conservative choice that we can revisit later.
-#if !defined(__GNUC__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+// to earlier versions. This is a conservative choice that we can revisit later. We need the
+// __clang__ here because Clang claims to be gcc of some version.
+#if defined(__clang__) || !defined(__GNUC__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
namespace {
#endif
@@ -536,7 +537,7 @@ namespace mutablebson {
return Status(ErrorCodes::IllegalOperation, "cannot add the root as a child");
}
-#if !defined(__GNUC__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
+#if defined(__clang__) || !defined(__GNUC__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4)
} // namespace
#endif