diff --git a/CMakeLists.txt b/CMakeLists.txt index 70050037c..b62075d01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -398,6 +398,12 @@ if (HAVE_EXECINFO_H) set (HAVE_STACKTRACE 1) endif (HAVE_EXECINFO_H) +if (HAVE_CXX11_ATOMIC) + set (ac_cv_cxx11_atomic 1) +else (HAVE_CXX11_ATOMIC) + set (ac_cv_cxx11_atomic 0) +endif (HAVE_CXX11_ATOMIC) + if (WITH_SYMBOLIZE) if (WIN32 OR CYGWIN) cmake_push_check_state (RESET) @@ -466,7 +472,7 @@ else (WITH_THREADS AND Threads_FOUND) set (NO_THREADS 1) endif (WITH_THREADS AND Threads_FOUND) -# fopen/open on Cygwin can not handle unix-type paths like /home/.... +# fopen/open on Cygwin can not handle unix-type paths like /home/.... # therefore we translate TEST_SRC_DIR to windows-path. if (CYGWIN) execute_process (COMMAND cygpath.exe -m ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/bazel/glog.bzl b/bazel/glog.bzl index 40833b461..69c4517bc 100644 --- a/bazel/glog.bzl +++ b/bazel/glog.bzl @@ -187,6 +187,7 @@ def glog_library(namespace = "google", with_gflags = 1, **kwargs): ) common_config = { + "@ac_cv_cxx11_atomic@": "1", "@ac_cv_cxx11_nullptr_t@": "1", "@ac_cv_cxx_using_operator@": "1", "@ac_cv_have_inttypes_h@": "0", diff --git a/src/glog/logging.h.in b/src/glog/logging.h.in index a9b0d461d..c8e912881 100644 --- a/src/glog/logging.h.in +++ b/src/glog/logging.h.in @@ -99,7 +99,7 @@ #include #endif -#ifdef HAVE_CXX11_ATOMIC +#if @ac_cv_cxx11_atomic@ #include #elif defined(OS_WINDOWS) #include