diff options
author | Aliaksey Kandratsenka <alkondratenko@gmail.com> | 2021-02-14 14:14:55 -0800 |
---|---|---|
committer | Aliaksey Kandratsenka <alkondratenko@gmail.com> | 2021-02-14 15:44:14 -0800 |
commit | 7c106ca241a344993f8011397de8004a224e094a (patch) | |
tree | 4747d67b2e292e9572fd9514f89e45f479784ec2 | |
parent | 0d6f32b9cef7ee044e55a746e7c76db62d23cd86 (diff) | |
download | gperftools-7c106ca241a344993f8011397de8004a224e094a.tar.gz |
don't bother checking for stl namespace and use std
Because there are no compilers left that don't do std namespace.
-rw-r--r-- | CMakeLists.txt | 20 | ||||
-rw-r--r-- | cmake/config.h.in | 6 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | m4/namespaces.m4 | 15 | ||||
-rw-r--r-- | m4/stl_namespace.m4 | 25 | ||||
-rw-r--r-- | src/heap-profiler.cc | 4 | ||||
-rw-r--r-- | src/malloc_extension.cc | 4 | ||||
-rw-r--r-- | src/tcmalloc.cc | 8 | ||||
-rw-r--r-- | src/windows/config.h | 6 |
9 files changed, 8 insertions, 83 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c657a6a..a51e5df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -332,10 +332,6 @@ else() set(HAVE_STD_ALIGN_VAL_T 0) endif() -check_c_source_compiles( - "namespace abc { void foo() {} } int main() { abc::foo(); return 0; }" - HAVE_NAMESPACES) - check_c_source_compiles(" #include <unwind.h> int main() @@ -470,22 +466,6 @@ check_cxx_source_compiles( int main() { pthread_t th; pthread_join(th, 0); return 0; }" have_pthread_despite_asking_for) -check_cxx_source_compiles( - "#include <vector> - int main() { vector<int> t; return 0; }" - STL_NAMESPACE_NONE) -if(STL_NAMESPACE_NONE) - set(STL_NAMESPACE "") -else() - check_cxx_source_compiles( - "#include <vector> - int main() { std::vector<int> t; return 0; }" - STL_NAMESPACE_STD) - if (STL_NAMESPACE_STD) - set(STL_NAMESPACE "std") - endif() -endif() - check_variable_exists("program_invocation_name" HAVE_PROGRAM_INVOCATION_NAME) if(MINGW) diff --git a/cmake/config.h.in b/cmake/config.h.in index baaa5b0..ef3926f 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -123,9 +123,6 @@ /* Define to 1 if you have a working `mmap' system call. */ #cmakedefine HAVE_MMAP -/* define if the compiler implements namespaces */ -#cmakedefine HAVE_NAMESPACES - /* Define to 1 if you have the <poll.h> header file. */ #cmakedefine HAVE_POLL_H @@ -293,9 +290,6 @@ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 -/* the namespace where STL code like vector<> is defined */ -#define STL_NAMESPACE @STL_NAMESPACE@ - /* Define 8 bytes of allocation alignment for tcmalloc */ #cmakedefine TCMALLOC_ALIGN_8BYTES diff --git a/configure.ac b/configure.ac index e809386..cfabdbf 100644 --- a/configure.ac +++ b/configure.ac @@ -544,9 +544,6 @@ AC_LANG_RESTORE AM_CONDITIONAL(HAVE_PTHREAD_DESPITE_ASKING_FOR, test x"$acx_pthread_despite_asking_for" = xyes) -# Find out what namespace 'normal' STL code lives in -AC_CXX_STL_NAMESPACE - # Figure out where libc has program_invocation_name AC_PROGRAM_INVOCATION_NAME diff --git a/m4/namespaces.m4 b/m4/namespaces.m4 deleted file mode 100644 index d78dbe4..0000000 --- a/m4/namespaces.m4 +++ /dev/null @@ -1,15 +0,0 @@ -# Checks whether the compiler implements namespaces -AC_DEFUN([AC_CXX_NAMESPACES], - [AC_CACHE_CHECK(whether the compiler implements namespaces, - ac_cv_cxx_namespaces, - [AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([namespace Outer { - namespace Inner { int i = 0; }}], - [using namespace Outer::Inner; return i;], - ac_cv_cxx_namespaces=yes, - ac_cv_cxx_namespaces=no) - AC_LANG_RESTORE]) - if test "$ac_cv_cxx_namespaces" = yes; then - AC_DEFINE(HAVE_NAMESPACES, 1, [define if the compiler implements namespaces]) - fi]) diff --git a/m4/stl_namespace.m4 b/m4/stl_namespace.m4 deleted file mode 100644 index 989ad80..0000000 --- a/m4/stl_namespace.m4 +++ /dev/null @@ -1,25 +0,0 @@ -# We check what namespace stl code like vector expects to be executed in - -AC_DEFUN([AC_CXX_STL_NAMESPACE], - [AC_CACHE_CHECK( - what namespace STL code is in, - ac_cv_cxx_stl_namespace, - [AC_REQUIRE([AC_CXX_NAMESPACES]) - AC_LANG_SAVE - AC_LANG_CPLUSPLUS - AC_TRY_COMPILE([#include <vector>], - [vector<int> t; return 0;], - ac_cv_cxx_stl_namespace=none) - AC_TRY_COMPILE([#include <vector>], - [std::vector<int> t; return 0;], - ac_cv_cxx_stl_namespace=std) - AC_LANG_RESTORE]) - if test "$ac_cv_cxx_stl_namespace" = none; then - AC_DEFINE(STL_NAMESPACE,, - [the namespace where STL code like vector<> is defined]) - fi - if test "$ac_cv_cxx_stl_namespace" = std; then - AC_DEFINE(STL_NAMESPACE,std, - [the namespace where STL code like vector<> is defined]) - fi -]) diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc index afb34e5..a47a533 100644 --- a/src/heap-profiler.cc +++ b/src/heap-profiler.cc @@ -82,8 +82,8 @@ #endif #endif -using STL_NAMESPACE::string; -using STL_NAMESPACE::sort; +using std::string; +using std::sort; //---------------------------------------------------------------------- // Flags that control heap-profiling diff --git a/src/malloc_extension.cc b/src/malloc_extension.cc index 6e69552..43377d8 100644 --- a/src/malloc_extension.cc +++ b/src/malloc_extension.cc @@ -53,8 +53,8 @@ #include "maybe_threads.h" #include "base/googleinit.h" -using STL_NAMESPACE::string; -using STL_NAMESPACE::vector; +using std::string; +using std::vector; static void DumpAddressMap(string* result) { *result += "\nMAPPED_LIBRARIES:\n"; diff --git a/src/tcmalloc.cc b/src/tcmalloc.cc index ab7e1f6..6d3929d 100644 --- a/src/tcmalloc.cc +++ b/src/tcmalloc.cc @@ -142,10 +142,10 @@ // Some windows file somewhere (at least on cygwin) #define's small (!) #undef small -using STL_NAMESPACE::max; -using STL_NAMESPACE::min; -using STL_NAMESPACE::numeric_limits; -using STL_NAMESPACE::vector; +using std::max; +using std::min; +using std::numeric_limits; +using std::vector; #include "libc_override.h" diff --git a/src/windows/config.h b/src/windows/config.h index 24692b5..a6bdaa3 100644 --- a/src/windows/config.h +++ b/src/windows/config.h @@ -128,9 +128,6 @@ /* Define to 1 if you have a working `mmap' system call. */ /* #undef HAVE_MMAP */ -/* define if the compiler implements namespaces */ -#define HAVE_NAMESPACES 1 - /* Define to 1 if you have the <poll.h> header file. */ /* #undef HAVE_POLL_H */ @@ -284,9 +281,6 @@ /* Define to 1 if you have the ANSI C header files. */ #define STDC_HEADERS 1 -/* the namespace where STL code like vector<> is defined */ -#define STL_NAMESPACE std - /* Define 8 bytes of allocation alignment for tcmalloc */ /* #undef TCMALLOC_ALIGN_8BYTES */ |