Commit 8c037c3c authored by Davis King's avatar Davis King

Added guards so dlib::async code isn't pulled in when using old versions of…

Added guards so dlib::async code isn't pulled in when using old versions of visual studio (since they don't support c++11).
parent a5e264cb
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
#if __cplusplus >= 201103 #if __cplusplus >= 201103
#include "../dnn/cpu_dlib.cpp" #include "../dnn/cpu_dlib.cpp"
#include "../dnn/tensor_tools.cpp" #include "../dnn/tensor_tools.cpp"
#include "../threads/async.cpp"
#endif #endif
#ifndef DLIB_ISO_CPP_ONLY #ifndef DLIB_ISO_CPP_ONLY
...@@ -59,6 +58,7 @@ ...@@ -59,6 +58,7 @@
#include "../threads/threads_kernel_2.cpp" #include "../threads/threads_kernel_2.cpp"
#include "../threads/threads_kernel_shared.cpp" #include "../threads/threads_kernel_shared.cpp"
#include "../threads/thread_pool_extension.cpp" #include "../threads/thread_pool_extension.cpp"
#include "../threads/async.cpp"
#include "../timer/timer.cpp" #include "../timer/timer.cpp"
#include "../stack_trace.cpp" #include "../stack_trace.cpp"
......
...@@ -22,12 +22,7 @@ ...@@ -22,12 +22,7 @@
#include "threads/thread_pool_extension.h" #include "threads/thread_pool_extension.h"
#include "threads/read_write_mutex_extension.h" #include "threads/read_write_mutex_extension.h"
#include "threads/parallel_for_extension.h" #include "threads/parallel_for_extension.h"
// things that require C++11
#if __cplusplus >= 201103
#include "threads/async.h" #include "threads/async.h"
#endif
#endif // DLIB_THREADs_ #endif // DLIB_THREADs_
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
#ifndef DLIB_AsYNC_CPP_ #ifndef DLIB_AsYNC_CPP_
#define DLIB_AsYNC_CPP_ #define DLIB_AsYNC_CPP_
// C++11 things don't work in old versions of visual studio
#if !defined( _MSC_VER) || _MSC_VER >= 1900
#include "async.h" #include "async.h"
#include <stdlib.h> #include <stdlib.h>
#include "../string.h" #include "../string.h"
...@@ -37,6 +40,8 @@ namespace dlib ...@@ -37,6 +40,8 @@ namespace dlib
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
#endif
#endif // DLIB_AsYNC_CPP_ #endif // DLIB_AsYNC_CPP_
...@@ -3,6 +3,9 @@ ...@@ -3,6 +3,9 @@
#ifndef DLIB_AsYNC_Hh_ #ifndef DLIB_AsYNC_Hh_
#define DLIB_AsYNC_Hh_ #define DLIB_AsYNC_Hh_
// C++11 things don't work in old versions of visual studio
#if !defined( _MSC_VER) || _MSC_VER >= 1900
#include "async_abstract.h" #include "async_abstract.h"
#include "thread_pool_extension.h" #include "thread_pool_extension.h"
#include <future> #include <future>
...@@ -95,6 +98,7 @@ namespace dlib ...@@ -95,6 +98,7 @@ namespace dlib
#include "async.cpp" #include "async.cpp"
#endif #endif
#endif
#endif // DLIB_AsYNC_Hh_ #endif // DLIB_AsYNC_Hh_
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment