Added guards so dlib::async code isn't pulled in when using old versions of visual studio (since they don't support c++11).

This commit is contained in:
Davis King 2016-08-04 21:12:00 -04:00
parent a5e264cb31
commit 8c037c3cb0
4 changed files with 10 additions and 6 deletions

View File

@ -26,7 +26,6 @@
#if __cplusplus >= 201103
#include "../dnn/cpu_dlib.cpp"
#include "../dnn/tensor_tools.cpp"
#include "../threads/async.cpp"
#endif
#ifndef DLIB_ISO_CPP_ONLY
@ -59,6 +58,7 @@
#include "../threads/threads_kernel_2.cpp"
#include "../threads/threads_kernel_shared.cpp"
#include "../threads/thread_pool_extension.cpp"
#include "../threads/async.cpp"
#include "../timer/timer.cpp"
#include "../stack_trace.cpp"

View File

@ -22,12 +22,7 @@
#include "threads/thread_pool_extension.h"
#include "threads/read_write_mutex_extension.h"
#include "threads/parallel_for_extension.h"
// things that require C++11
#if __cplusplus >= 201103
#include "threads/async.h"
#endif
#endif // DLIB_THREADs_

View File

@ -3,6 +3,9 @@
#ifndef 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 <stdlib.h>
#include "../string.h"
@ -37,6 +40,8 @@ namespace dlib
// ----------------------------------------------------------------------------------------
#endif
#endif // DLIB_AsYNC_CPP_

View File

@ -3,6 +3,9 @@
#ifndef 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 "thread_pool_extension.h"
#include <future>
@ -95,6 +98,7 @@ namespace dlib
#include "async.cpp"
#endif
#endif
#endif // DLIB_AsYNC_Hh_