added missing exports (fixes #227)
[platform/upstream/glog.git] / src / stl_logging_unittest.cc
index 5dcbc44..89fd6a1 100644 (file)
@@ -31,8 +31,7 @@
 
 #ifdef HAVE_USING_OPERATOR
 
-#include "glog/stl_logging.h"
-
+#include <functional>
 #include <iostream>
 #include <map>
 #include <ostream>
 #include <vector>
 
 #ifdef __GNUC__
-# include <ext/hash_map>
-# include <ext/hash_set>
+// C++0x isn't enabled by default in GCC and libc++ does not have
+// non-standard ext/* and tr1/unordered_*.
+# if defined(_LIBCPP_VERSION)
+#  ifndef GLOG_STL_LOGGING_FOR_UNORDERED
+#  define GLOG_STL_LOGGING_FOR_UNORDERED
+#  endif
+# else
+#  ifndef GLOG_STL_LOGGING_FOR_EXT_HASH
+#  define GLOG_STL_LOGGING_FOR_EXT_HASH
+#  endif
+#  ifndef GLOG_STL_LOGGING_FOR_EXT_SLIST
+#  define GLOG_STL_LOGGING_FOR_EXT_SLIST
+#  endif
+#  ifndef GLOG_STL_LOGGING_FOR_TR1_UNORDERED
+#  define GLOG_STL_LOGGING_FOR_TR1_UNORDERED
+#  endif
+# endif
 #endif
 
 #include "glog/logging.h"
+#include "glog/stl_logging.h"
 #include "googletest.h"
 
 using namespace std;
-#ifdef __GNUC__
+#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
 using namespace __gnu_cxx;
 #endif
 
@@ -83,7 +98,7 @@ void TestSTLLogging() {
     CHECK_EQ(m, copied_m);  // This must compile.
   }
 
-#ifdef __GNUC__
+#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
   {
     // Test a hashed simple associative container.
     hash_set<int> hs;
@@ -98,7 +113,7 @@ void TestSTLLogging() {
   }
 #endif
 
-#ifdef __GNUC__
+#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
   {
     // Test a hashed pair associative container.
     hash_map<int, string> hm;
@@ -145,7 +160,7 @@ void TestSTLLogging() {
     CHECK_EQ(m, copied_m);  // This must compile.
   }
 
-#ifdef __GNUC__
+#ifdef GLOG_STL_LOGGING_FOR_EXT_HASH
   {
     // Test a hashed simple associative container.
     // Use a user defined hash function.