2015-03-07 01:35:00 +08:00
|
|
|
#ifndef BENCHMARK_INTERNAL_MACROS_H_
|
|
|
|
#define BENCHMARK_INTERNAL_MACROS_H_
|
|
|
|
|
|
|
|
#include "benchmark/macros.h"
|
|
|
|
|
|
|
|
#ifndef __has_feature
|
|
|
|
# define __has_feature(x) 0
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if __has_feature(cxx_attributes)
|
|
|
|
# define BENCHMARK_NORETURN [[noreturn]]
|
|
|
|
#elif defined(__GNUC__)
|
|
|
|
# define BENCHMARK_NORETURN __attribute__((noreturn))
|
|
|
|
#else
|
|
|
|
# define BENCHMARK_NORETURN
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__CYGWIN__)
|
2015-10-05 19:58:35 +08:00
|
|
|
# define BENCHMARK_OS_CYGWIN 1
|
2015-03-07 01:35:00 +08:00
|
|
|
#elif defined(_WIN32)
|
2015-10-05 19:58:35 +08:00
|
|
|
# define BENCHMARK_OS_WINDOWS 1
|
2015-03-07 01:35:00 +08:00
|
|
|
#elif defined(__APPLE__)
|
|
|
|
// TODO(ericwf) This doesn't actually check that it is a Mac OSX system. Just
|
|
|
|
// that it is an apple system.
|
2015-10-05 19:58:35 +08:00
|
|
|
# define BENCHMARK_OS_MACOSX 1
|
2015-03-07 01:35:00 +08:00
|
|
|
#elif defined(__FreeBSD__)
|
2015-10-05 19:58:35 +08:00
|
|
|
# define BENCHMARK_OS_FREEBSD 1
|
2015-03-07 01:35:00 +08:00
|
|
|
#elif defined(__linux__)
|
2015-10-05 19:58:35 +08:00
|
|
|
# define BENCHMARK_OS_LINUX 1
|
2015-03-07 01:35:00 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__clang__)
|
|
|
|
# define COMPILER_CLANG
|
|
|
|
#elif defined(_MSC_VER)
|
|
|
|
# define COMPILER_MSVC
|
|
|
|
#elif defined(__GNUC__)
|
|
|
|
# define COMPILER_GCC
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // BENCHMARK_INTERNAL_MACROS_H_
|