diff --git a/bin/build.ps1 b/bin/build.ps1 index 4a7f5f4..b4ea42c 100644 --- a/bin/build.ps1 +++ b/bin/build.ps1 @@ -217,7 +217,7 @@ if ($tests) Push-Location $path_root if ( Test-Path( $executable ) ) { - write-host "`nRunning tests/c11_sanity.exe" + write-host "`nRunning tests/c11_sanity_segregated.exe (segregated)" $time_taken = Measure-Command { & $executable | ForEach-Object { write-host `t $_ -ForegroundColor Green @@ -226,6 +226,22 @@ if ($tests) write-host "`ntest/code_sanity completed in $($time_taken.TotalMilliseconds) ms" } Pop-Location + + $compiler_args += ($flag_define + "TEST_SINGLEHEADER") + + $result = build-simple $path_build $includes $compiler_args $linker_args $unit $executable + + Push-Location $path_root + if ( Test-Path( $executable ) ) { + write-host "`nRunning tests/c11_sanity.exe (single header)" + $time_taken = Measure-Command { & $executable + | ForEach-Object { + write-host `t $_ -ForegroundColor Green + } + } + write-host "`ntest/code_sanity completed in $($time_taken.TotalMilliseconds) ms" + } +Pop-Location } Pop-Location # $path_root diff --git a/gen_c11/gen_c11.c b/gen_c11/gen_c11.c index f8c4e15..09a7139 100644 --- a/gen_c11/gen_c11.c +++ b/gen_c11/gen_c11.c @@ -7,7 +7,7 @@ #endif #ifndef GENERATE_SINGLEHEADER -#define GENERATE_SINGLEHEADER 0 +#define GENERATE_SINGLEHEADER 1 #endif #define path_refactor_script path_gen_c11 "c11.refactor" @@ -264,7 +264,6 @@ int main() print_fmt("%S", implementation_guard_start); new_line(); - define(lit("STB_SPRINTF_IMPLEMENTATION"), MT_Statement); define(lit("STB_SPRINTF_DECORATE(name)"), MT_Expression, .content = lit("md_##name"), .flags = MF_Functional); // print(); preprocess_if("MD_BUILD_STATIC"); { @@ -356,6 +355,10 @@ int main() print(banner_base); new_line(); + define(lit("STB_SPRINTF_IMPLEMENTATION"), MT_Statement); + print_section(refactor_and_format(r_tp_stb_sprintf_source), lit("STB snprintf Source")); + new_line(); + print_section(r_base_platform_c, lit("Platform")); print_section(r_base_debug_c, lit("Debug")); print_section(r_base_memory_substrate_c, lit("Memory Substrate")); diff --git a/gen_c11/gen_common.h b/gen_c11/gen_common.h index 7256863..dfe29ae 100644 --- a/gen_c11/gen_common.h +++ b/gen_c11/gen_common.h @@ -69,7 +69,7 @@ void register_library_macros() // third_party/stb/stb_sprintf.h gen_register_macros( args( ((gen_Macro) { lit("STB_SPRINTF_H_INCLUDE"), MT_Statement, }), - ((gen_Macro) { lit("STBSP__ASAN"), MT_Statement, MF_Allow_As_Attribute }), + ((gen_Macro) { lit("STBSP__ASAN"), MT_Statement, MF_Allow_As_Attribute }), ((gen_Macro) { lit("STBSP__PUBLICDEC"), MT_Expression, MF_Allow_As_Attribute }), ((gen_Macro) { lit("STBSP__ATTRIBUTE_FORMAT"), MT_Expression, MF_Functional | MF_Allow_As_Attribute }), ((gen_Macro) { lit("STBSP__NOTUSED"), MT_Expression, MF_Functional | MF_Allow_As_Attribute }), diff --git a/tests/c11_sanity.c b/tests/c11_sanity.c index 6b368b1..720789f 100644 --- a/tests/c11_sanity.c +++ b/tests/c11_sanity.c @@ -10,7 +10,7 @@ // This program expects to be run from the build directory (where it would be after being built) #define path_root -#define path_examples path_root ".examples/" +#define path_examples path_root "examples/" #define path_intro path_examples "intro/" #define path_hello_world_mdesk path_intro "hello_world.mdesk"