File: CGAL_test_cpp_version.cpp

package info (click to toggle)
cgal 6.1.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 144,952 kB
  • sloc: cpp: 811,597; ansic: 208,576; sh: 493; python: 411; makefile: 286; javascript: 174
file content (26 lines) | stat: -rw-r--r-- 622 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#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

int main() {
#if ! defined(__cplusplus)
  std::cout << "Undefined";
  return 1;
#else
  std::cout << __cplusplus;
#endif

#if __has_feature(cxx_thread_local) || \
    ( __GNUC__ > 0 && __cplusplus >= 201103L )
  return 0;
#else
  return 1;
#endif
}