From 09abf1b529b4226f585ecfbb20866715b901755b Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 1 Dec 2021 13:34:22 +0800 Subject: +fpm --- .../fpm/3rdparty/googlebench/src/arraysize.h | 33 ++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Client/ThirdParty/fpm/3rdparty/googlebench/src/arraysize.h (limited to 'Client/ThirdParty/fpm/3rdparty/googlebench/src/arraysize.h') diff --git a/Client/ThirdParty/fpm/3rdparty/googlebench/src/arraysize.h b/Client/ThirdParty/fpm/3rdparty/googlebench/src/arraysize.h new file mode 100644 index 0000000..51a50f2 --- /dev/null +++ b/Client/ThirdParty/fpm/3rdparty/googlebench/src/arraysize.h @@ -0,0 +1,33 @@ +#ifndef BENCHMARK_ARRAYSIZE_H_ +#define BENCHMARK_ARRAYSIZE_H_ + +#include "internal_macros.h" + +namespace benchmark { +namespace internal { +// The arraysize(arr) macro returns the # of elements in an array arr. +// The expression is a compile-time constant, and therefore can be +// used in defining new arrays, for example. If you use arraysize on +// a pointer by mistake, you will get a compile-time error. +// + +// This template function declaration is used in defining arraysize. +// Note that the function doesn't need an implementation, as we only +// use its type. +template +char (&ArraySizeHelper(T (&array)[N]))[N]; + +// That gcc wants both of these prototypes seems mysterious. VC, for +// its part, can't decide which to use (another mystery). Matching of +// template overloads: the final frontier. +#ifndef COMPILER_MSVC +template +char (&ArraySizeHelper(const T (&array)[N]))[N]; +#endif + +#define arraysize(array) (sizeof(::benchmark::internal::ArraySizeHelper(array))) + +} // end namespace internal +} // end namespace benchmark + +#endif // BENCHMARK_ARRAYSIZE_H_ -- cgit v1.1-26-g67d0