got c11_sanity.c working (both segregated and single-header)

from now on I'm assuming both will work.
This commit is contained in:
2025-02-11 20:26:03 -05:00
parent f41658efd8
commit 90836817e9
4 changed files with 24 additions and 5 deletions
+17 -1
View File
@@ -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
+5 -2
View File
@@ -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"));
+1 -1
View File
@@ -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 }),
+1 -1
View File
@@ -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"