diff options
author | José Fonseca <jfonseca@vmware.com> | 2014-02-25 15:28:03 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2014-02-25 15:28:03 +0000 |
commit | 1c6c2bc52d088962a0b0a0cac9121d11b24eba0b (patch) | |
tree | ad5171d13dc2ca7b93fccf5ef0e39a740db5a3b9 | |
parent | b9adf67e972b58da5c017e82bab20438b56f353c (diff) |
gltrace: Detect the availability of tr1/memory header.
Instead of trying to guess it.
Should fix issue #224
-rw-r--r-- | CMakeLists.txt | 5 | ||||
-rw-r--r-- | wrappers/gltrace_state.cpp | 8 |
2 files changed, 8 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 72a3f1b0..5fe0d501 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -100,6 +100,7 @@ endif () # Set global build options include (CheckCXXCompilerFlag) +include (CheckIncludeFileCXX) if (WIN32) # http://msdn.microsoft.com/en-us/library/aa383745.aspx @@ -192,6 +193,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") add_definitions (-D_GNU_SOURCE) endif () +check_include_file_cxx (tr1/memory HAVE_TR1_MEMORY) +if (HAVE_TR1_MEMORY) + add_definitions (-DHAVE_TR1_MEMORY) +endif () # Put all executables into the same top level build directory, regardless of # which subdirectory they are declared diff --git a/wrappers/gltrace_state.cpp b/wrappers/gltrace_state.cpp index e3423d15..61319b38 100644 --- a/wrappers/gltrace_state.cpp +++ b/wrappers/gltrace_state.cpp @@ -28,12 +28,10 @@ #include <assert.h> #include <map> -#if defined(_MSC_VER) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090) -#include <memory> -#else +#if defined(HAVE_TR1_MEMORY) #include <tr1/memory> -#include <memory> #endif +#include <memory> #include <os_thread.hpp> #include <glproc.hpp> @@ -41,7 +39,7 @@ namespace gltrace { -#if defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 +#if !defined(HAVE_TR1_MEMORY) typedef std::shared_ptr<Context> context_ptr_t; #else typedef std::tr1::shared_ptr<Context> context_ptr_t; |