diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:57:46 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:57:46 +0200 |
commit | ad4e3d2c55e75193c41356c23619f80add41db18 (patch) | |
tree | dd836d120f50e472106e04968ef8185c25e4242e /zen/build_info.h | |
parent | 7.4 (diff) | |
download | FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.tar.gz FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.tar.bz2 FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.zip |
7.5
Diffstat (limited to 'zen/build_info.h')
-rw-r--r-- | zen/build_info.h | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/zen/build_info.h b/zen/build_info.h index 4eeb8195..7c738847 100644 --- a/zen/build_info.h +++ b/zen/build_info.h @@ -4,17 +4,35 @@ // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** -#ifndef BUILDINFO_H_INCLUDED -#define BUILDINFO_H_INCLUDED +#ifndef BUILDINFO_H_5928539285603428657 +#define BUILDINFO_H_5928539285603428657 namespace zen { -//determine build info -//safer than checking for _WIN64 (defined on windows for 64-bit compilations only) while _WIN32 is always defined (even for x64 compiler!) -static const bool is32BitBuild = sizeof(void*) == 4; -static const bool is64BitBuild = sizeof(void*) == 8; +//determine build info: defines ZEN_BUILD_32BIT or ZEN_BUILD_64BIT -static_assert(is32BitBuild || is64BitBuild, ""); +#ifdef ZEN_WIN + #ifdef _WIN64 + #define ZEN_BUILD_64BIT + #else + #define ZEN_BUILD_32BIT + #endif + +#else + #ifdef __LP64__ + #define ZEN_BUILD_64BIT + #else + #define ZEN_BUILD_32BIT + #endif +#endif + +#ifdef ZEN_BUILD_32BIT + static_assert(sizeof(void*) == 4, ""); +#endif + +#ifdef ZEN_BUILD_64BIT + static_assert(sizeof(void*) == 8, ""); +#endif } -#endif //BUILDINFO_H_INCLUDED +#endif //BUILDINFO_H_5928539285603428657 |