Home | History | Annotate | Download | only in src
      1 #ifndef BENCHMARK_INTERNAL_MACROS_H_
      2 #define BENCHMARK_INTERNAL_MACROS_H_
      3 
      4 #include "benchmark/macros.h"
      5 
      6 #ifndef __has_feature
      7 # define __has_feature(x) 0
      8 #endif
      9 
     10 #if __has_feature(cxx_attributes)
     11 # define BENCHMARK_NORETURN [[noreturn]]
     12 #elif defined(__GNUC__)
     13 # define BENCHMARK_NORETURN __attribute__((noreturn))
     14 #else
     15 # define BENCHMARK_NORETURN
     16 #endif
     17 
     18 #if defined(__CYGWIN__)
     19 # define BENCHMARK_OS_CYGWIN 1
     20 #elif defined(_WIN32)
     21 # define BENCHMARK_OS_WINDOWS 1
     22 #elif defined(__APPLE__)
     23 // TODO(ericwf) This doesn't actually check that it is a Mac OSX system. Just
     24 // that it is an apple system.
     25 # define BENCHMARK_OS_MACOSX 1
     26 #elif defined(__FreeBSD__)
     27 # define BENCHMARK_OS_FREEBSD 1
     28 #elif defined(__linux__)
     29 # define BENCHMARK_OS_LINUX 1
     30 #endif
     31 
     32 #if defined(__clang__)
     33 # define COMPILER_CLANG
     34 #elif defined(_MSC_VER)
     35 # define COMPILER_MSVC
     36 #elif defined(__GNUC__)
     37 # define COMPILER_GCC
     38 #endif
     39 
     40 #endif // BENCHMARK_INTERNAL_MACROS_H_
     41