mirror of
https://github.com/google/benchmark.git
synced 2025-03-30 14:10:25 +08:00
add internal macros
This commit is contained in:
parent
c3187addd2
commit
f8342f39cf
40
src/internal_macros.h
Normal file
40
src/internal_macros.h
Normal file
@ -0,0 +1,40 @@
|
||||
#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__)
|
||||
# define OS_CYGWIN 1
|
||||
#elif defined(_WIN32)
|
||||
# define OS_WINDOWS 1
|
||||
#elif defined(__APPLE__)
|
||||
// TODO(ericwf) This doesn't actually check that it is a Mac OSX system. Just
|
||||
// that it is an apple system.
|
||||
# define OS_MACOSX 1
|
||||
#elif defined(__FreeBSD__)
|
||||
# define OS_FREEBSD 1
|
||||
#elif defined(__linux__)
|
||||
# define OS_LINUX 1
|
||||
#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_
|
Loading…
Reference in New Issue
Block a user