summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--wrappers/gltrace_state.cpp8
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;