summaryrefslogtreecommitdiffstats
path: root/lib/libcxx/utils/google-benchmark/src/internal_macros.h
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2018-09-11 18:18:58 +0000
committerrobert <robert@openbsd.org>2018-09-11 18:18:58 +0000
commit820e1f31efc1d6ed04795ba2e79f3044e1907492 (patch)
tree815cebb3734784074b661935c33f00bd5eb4d862 /lib/libcxx/utils/google-benchmark/src/internal_macros.h
parentNuke unused LIST() ieee80211com_head. (diff)
downloadwireguard-openbsd-820e1f31efc1d6ed04795ba2e79f3044e1907492.tar.xz
wireguard-openbsd-820e1f31efc1d6ed04795ba2e79f3044e1907492.zip
import of libc++ 6.0.0
Diffstat (limited to 'lib/libcxx/utils/google-benchmark/src/internal_macros.h')
-rw-r--r--lib/libcxx/utils/google-benchmark/src/internal_macros.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/lib/libcxx/utils/google-benchmark/src/internal_macros.h b/lib/libcxx/utils/google-benchmark/src/internal_macros.h
new file mode 100644
index 00000000000..ab9dd85c102
--- /dev/null
+++ b/lib/libcxx/utils/google-benchmark/src/internal_macros.h
@@ -0,0 +1,55 @@
+#ifndef BENCHMARK_INTERNAL_MACROS_H_
+#define BENCHMARK_INTERNAL_MACROS_H_
+
+#include "benchmark/macros.h"
+
+#ifndef __has_feature
+#define __has_feature(x) 0
+#endif
+
+#if defined(__clang__)
+#define COMPILER_CLANG
+#elif defined(_MSC_VER)
+#define COMPILER_MSVC
+#elif defined(__GNUC__)
+#define COMPILER_GCC
+#endif
+
+#if __has_feature(cxx_attributes)
+#define BENCHMARK_NORETURN [[noreturn]]
+#elif defined(__GNUC__)
+#define BENCHMARK_NORETURN __attribute__((noreturn))
+#elif defined(COMPILER_MSVC)
+#define BENCHMARK_NORETURN __declspec(noreturn)
+#else
+#define BENCHMARK_NORETURN
+#endif
+
+#if defined(__CYGWIN__)
+#define BENCHMARK_OS_CYGWIN 1
+#elif defined(_WIN32)
+#define BENCHMARK_OS_WINDOWS 1
+#elif defined(__APPLE__)
+#include "TargetConditionals.h"
+ #if defined(TARGET_OS_MAC)
+ #define BENCHMARK_OS_MACOSX 1
+ #if defined(TARGET_OS_IPHONE)
+ #define BENCHMARK_OS_IOS 1
+ #endif
+ #endif
+#elif defined(__FreeBSD__)
+#define BENCHMARK_OS_FREEBSD 1
+#elif defined(__linux__)
+#define BENCHMARK_OS_LINUX 1
+#elif defined(__native_client__)
+#define BENCHMARK_OS_NACL 1
+#elif defined(EMSCRIPTEN)
+#define BENCHMARK_OS_EMSCRIPTEN 1
+#endif
+
+#if !__has_feature(cxx_exceptions) && !defined(__cpp_exceptions) \
+ && !defined(__EXCEPTIONS)
+#define BENCHMARK_HAS_NO_EXCEPTIONS
+#endif
+
+#endif // BENCHMARK_INTERNAL_MACROS_H_