#include "Stroika/Foundation/StroikaPreComp.h"
#include <cstdint>
#include "CompileTimeFlagChecker.inl"
Go to the source code of this file.
Namespaces | |
namespace | Stroika::Foundation |
Macros | |
#define | CompileTimeFlagChecker_HEADER(NS_PREFIX, NAME, VALUE) CompileTimeCheck_HEADER_INTERNAL_ (NS_PREFIX, CompileTimeChecker_##NAME, CompileTimeCheck_##NAME, VALUE) |
CompileTimeFlagChecker_HEADER () will generate a LINK ERROR if you ever compile a header with one value and the corresponding CompileTimeFlagChecker_SOURCE () with another value. | |
#define | CompileTimeFlagChecker_SOURCE(NS_PREFIX, NAME, VALUE) CompileTimeCheck_SOURCE_PRIVATE_1_ (NS_PREFIX, CompileTimeCheck_##NAME, VALUE) |
@todo This is still a pretty weak implementation, so could use some revisiting. But better now as of Stroika v2.1d18 @todo Make sure not actually generating code in release builds, but still generating enough code so we get linker erorr missing qStroika_Foundation_Debug_AssertionsChecked=1/0.
Definition in file CompileTimeFlagChecker.h.
#define CompileTimeFlagChecker_HEADER | ( | NS_PREFIX, | |
NAME, | |||
VALUE | |||
) | CompileTimeCheck_HEADER_INTERNAL_ (NS_PREFIX, CompileTimeChecker_##NAME, CompileTimeCheck_##NAME, VALUE) |
CompileTimeFlagChecker_HEADER () will generate a LINK ERROR if you ever compile a header with one value and the corresponding CompileTimeFlagChecker_SOURCE () with another value.
It is HOPED the linker will optimize these references out (else wise - they should be small, not super significant).
But still hopefully check them so that compiling with mixed CPP defines (-D defines) will cause an easily diagnosic error message.
If this check fails, you will see a linker message like
Definition at line 61 of file CompileTimeFlagChecker.h.
#define CompileTimeFlagChecker_SOURCE | ( | NS_PREFIX, | |
NAME, | |||
VALUE | |||
) | CompileTimeCheck_SOURCE_PRIVATE_1_ (NS_PREFIX, CompileTimeCheck_##NAME, VALUE) |
Put exactly one of these in a single .cpp file that should be the definition of what everything else must be consistent with. It should take the same arguments as the corresponding CompileTimeFlagChecker_SOURCE ().
Definition at line 93 of file CompileTimeFlagChecker.h.