Skip to content

Commit

Permalink
don't bother checking for stl namespace and use std
Browse files Browse the repository at this point in the history
Because there are no compilers left that don't do std namespace.
  • Loading branch information
alk committed Feb 14, 2021
1 parent 0d6f32b commit 7c106ca
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 83 deletions.
20 changes: 0 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 0 additions & 6 deletions cmake/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
15 changes: 0 additions & 15 deletions m4/namespaces.m4

This file was deleted.

25 changes: 0 additions & 25 deletions m4/stl_namespace.m4

This file was deleted.

4 changes: 2 additions & 2 deletions src/heap-profiler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/malloc_extension.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
8 changes: 4 additions & 4 deletions src/tcmalloc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
6 changes: 0 additions & 6 deletions src/windows/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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 */

Expand Down

0 comments on commit 7c106ca

Please sign in to comment.