16 * @todo This is still a pretty weak implementation, so could use some revisiting. But better now
17 * as of Stroika v2.1d18
18 *
19 * @todo Make sure not actually generating code in release builds, but still generating enough code so
20 * we get linker erorr missing qStroika_Foundation_Debug_AssertionsChecked=1/0.
21 *
22 */
23
24namespace Stroika::Foundation::Debug {
25
26struct CompileTimeFlagChecker {
27using HiddenValueType = uint8_t;
28 };
29
30 /**
31 * \brief CompileTimeFlagChecker_HEADER () will generate a LINK ERROR if you ever compile a header with one value and
32 * the corresponding CompileTimeFlagChecker_SOURCE () with another value.
33 *
34 * It is HOPED the linker will optimize these references out (else wise - they should be small, not super significant).
35 *
36 * But still hopefully check them so that compiling with mixed CPP defines (-D defines) will cause an easily diagnosic error message.
37 *
38 * If this check fails, you will see a linker message like
39 * \code
40 * unresolved external symbol "unsigned char Stroika::Foundation::Debug::CompileTimeCheck_VARIABLENAME_BADVALUE
41 * \endcode
42 *
43 * \par Example Usage
44 * \code
45 * error LNK2001: unresolved external symbol "unsigned char Stroika::Foundation::Debug::CompileTimeCheck_qTraceToFile_0
46 * \endcode
47 * means that the variable qTraceToFile was defined '0' in some header, but some other value (that would be 1) in the cpp file where Stroika was built.
48 *
49 * \note The CompileTimeFlagChecker_HEADER () must occur in the global namespace (in order to forward declare the shared variable in a specific namespace