mirror of https://github.com/CGAL/cgal
Use the same test as in <CGAL/config.h>
This commit is contained in:
parent
360697e23c
commit
95f3b09de3
|
|
@ -1,5 +1,10 @@
|
|||
#include <iostream>
|
||||
|
||||
// This file displays the value of `__cplusplus` on `stderr`, and then
|
||||
// return 0 if and only if C++ `thread_local` feature can be used.
|
||||
// The tests are the same as for the definition of
|
||||
// `CGAL_CAN_USE_CXX11_THREAD_LOCAL` in `<CGAL/config.h>`.
|
||||
|
||||
#ifndef __has_feature
|
||||
#define __has_feature(x) 0 // Compatibility with non-clang compilers.
|
||||
#endif
|
||||
|
|
@ -10,10 +15,12 @@ int main() {
|
|||
return 1;
|
||||
#else
|
||||
std::cout << __cplusplus;
|
||||
# if __has_feature(cxx_thread_local) || __cplusplus >= 201103L
|
||||
#endif
|
||||
|
||||
#if __has_feature(cxx_thread_local) || \
|
||||
( (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L )
|
||||
return 0;
|
||||
# else
|
||||
#else
|
||||
return 1;
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -473,6 +473,7 @@ using std::max;
|
|||
#if __has_feature(cxx_thread_local) || \
|
||||
( (__GNUC__ * 100 + __GNUC_MINOR__) >= 408 && __cplusplus >= 201103L ) || \
|
||||
( _MSC_VER >= 1900 )
|
||||
// see also Installation/config/support/CGAL_test_cpp_version.cpp
|
||||
#define CGAL_CAN_USE_CXX11_THREAD_LOCAL
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue