From 628da79d123a6ba4ac62ebc0916c15509610223e Mon Sep 17 00:00:00 2001 From: Zach Vorhies Date: Fri, 23 Oct 2026 16:31:22 -0700 Subject: [PATCH] fix: compile test-fork-locks as C++ under MI_USE_CXX (#619) The library is compiled as C++ with MI_USE_CXX=ON, so the MI_DEBUG test hooks from internal.h are exported with C++ linkage; the test was still compiled as C and failed to link. Add it to the LANGUAGE CXX list like the other internal.h-using tests. Local-Gate: v1 tree=f31954c4603d558eb5ed8253fb93089ebe2c9078 secs=59 lanes=lint:run Ci-Attestation: {"at":1792798621,"gate":"python/all/lint","host":"linux-x86_64","key":"217f3299a4ee3b2eb60995d8d8a267718740750b7d00f7bfd7de1ba459fa8d06","lane":"lint","parents":["aaef948845f03eecd7e80b29196a4e891bf55444"],"secs":59,"stamp":"9819106f71bf22a4512e74502602d4ad","tree":"f31954c4603d558eb5ed8253fb93089ebe2c9078","v":1,"via":"run"} --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1fb8cea1..ce6afd95 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -854,7 +854,7 @@ endif() # set language for source files now if(MI_USE_CXX) set_source_files_properties(${mi_sources} PROPERTIES LANGUAGE CXX ) - set_source_files_properties(test/test-diagnostic-walks.c test/test-snapshot-walk.c PROPERTIES LANGUAGE CXX) + set_source_files_properties(test/test-diagnostic-walks.c test/test-snapshot-walk.c test/test-fork-locks.c PROPERTIES LANGUAGE CXX) # #272 (P7b): test-purge-holes.c and test-profile-race.c reach `mimalloc/internal.h` # (`_mi_ptr_page`, `mi_page_block_is_purged`, `_mi_os_page_size`, ...), which is NOT wrapped # in `extern "C"`. With MI_USE_CXX the library's symbols are C++-mangled, so a C test cannot