From 2c81be72eef5363736cf1892646c74a3311ee4c1 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Sun, 22 May 2022 17:03:17 -0400 Subject: add upstream 11.21 --- zen/build_info.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'zen/build_info.h') diff --git a/zen/build_info.h b/zen/build_info.h index 5a1d1635..b06c1302 100644 --- a/zen/build_info.h +++ b/zen/build_info.h @@ -8,25 +8,25 @@ #define BUILD_INFO_H_5928539285603428657 -#define ZEN_ARCH_32BIT 32 -#define ZEN_ARCH_64BIT 64 - #ifdef __LP64__ - #define ZEN_BUILD_ARCH ZEN_ARCH_64BIT - #else - #define ZEN_BUILD_ARCH ZEN_ARCH_32BIT - #endif +namespace zen +{ +enum class BuildArch +{ + bit32, + bit64, -static_assert(ZEN_BUILD_ARCH == sizeof(void*) * 8); +#ifdef __LP64__ + program = bit64 +#else + program = bit32 +#endif +}; +static_assert((BuildArch::program == BuildArch::bit32 ? 32 : 64) == sizeof(void*) * 8); -namespace zen -{ - #if ZEN_BUILD_ARCH == ZEN_ARCH_32BIT - const char cpuArchName[] = "i686"; - #else - const char cpuArchName[] = "x86-64"; - #endif + +constexpr const char* cpuArchName = BuildArch::program == BuildArch::bit32 ? "i686": "x86-64"; } -- cgit