#ifndef AGAPROCONFIG_H #define AGAPROCONFIG_H #cmakedefine HAS_BOOST #cmakedefine HAS_SKSTREAM #cmakedefine HAS_SSE #cmakedefine HAS_C11 ////////////////////////////// ////// Define OS_TYPE //////// ////////////////////////////// #define OS_LINUX 1 #define OS_WINDOWS 2 #define OS_CYGWIN 3 // rather useless ==> to be removed ?? #define OS_APPLE 4 #define OS_TYPE @CMAKE_OS_TYPE@ ///////////////////////////////////////////////////// //////// Choose your version of the program(s) ////// ///////////////////////////////////////////////////// #define NRV_ONLINE 1 #define NRV_OFFLINE 2 #define NRV_TYPE @CMAKE_NRV_TYPE@ #if NRV_TYPE != NRV_ONLINE # undef NRV_TYPE # define NRV_TYPE NRV_OFFLINE #endif #if NRV_TYPE == NRV_ONLINE #if (OS_TYPE != OS_LINUX) #error The online version can only be built on Linux #endif #endif ////////////////////////////////////////////// //////// Choose your version of threads ////// ////////////////////////////////////////////// #define THR_NONE 0 // no threads #define THR_BOOST 1 // using boost c++ libraries #define THR_STD 2 // using std in c++11 (if supported by compiler) // THR_TYPE should be defined in the project #define THR_TYPE @CMAKE_THR_TYPE@ #if THR_TYPE == THR_BOOST #define thrLib boost #define thrYield() ( thrLib::this_thread::yield() ) #define thrSleep(msecs) ( thrLib::this_thread::sleep(thrLib::posix_time::milliseconds(msecs)) ) #define thrLock thrLib::mutex::scoped_lock #elif THR_TYPE == THR_STD #define thrLib std #define thrYield() ( thrLib::this_thread::yield() ) #define thrSleep(msecs) ( thrLib::this_thread::sleep_for(thrLib::chrono::milliseconds(msecs)) ) #define thrLock thrLib::unique_lock #elif THR_TYPE == THR_NONE #define thrLib #define thrYield() #define thrSleep(msecs) #define thrLock #else #error THR_TYPE should be either THR_BOOST, THR_STD or THR_NONE #endif #endif