@@ -20,27 +20,34 @@ def test_cpp_standards():
2020
2121 config = autoconfig .cxx_parsers_cfg .config .clone ()
2222
23+ cflags_common = ""
24+
25+ if platform .system () == "Darwin" :
26+ cflags_common = " -Dat_quick_exit=atexit -Dquick_exit=exit"
27+ # https://fr.mathworks.com/matlabcentral/answers/2013982-clibgen-generatelibrarydefinition-error-the-global-scope-has-no-quick_exit-on-mac-m2#answer_1439856
28+ # https://github.com/jetbrains/kotlin/commit/d50f585911dedec5723213da8835707ac95e1c01
29+
2330 parser .parse (["cpp_standards.hpp" ], config )
2431
2532 if platform .system () != 'Windows' :
26- config .cflags = "-std=c++98"
33+ config .cflags = "-std=c++98" + cflags_common
2734 parser .parse (["cpp_standards.hpp" ], config )
2835
29- config .cflags = "-std=c++03"
36+ config .cflags = "-std=c++03" + cflags_common
3037 parser .parse (["cpp_standards.hpp" ], config )
3138
32- config .cflags = "-std=c++11"
39+ config .cflags = "-std=c++11" + cflags_common
3340
3441 parser .parse (["cpp_standards.hpp" ], config )
3542
36- config .cflags = "-std=c++14"
43+ config .cflags = "-std=c++14" + cflags_common
3744 parser .parse (["cpp_standards.hpp" ], config )
3845
39- config .cflags = "-std=c++1z"
46+ config .cflags = "-std=c++1z" + cflags_common
4047 parser .parse (["cpp_standards.hpp" ], config )
4148
4249 # Pass down a flag that does not exist.
4350 # This should raise an exception.
44- config .cflags = "-std=c++00"
51+ config .cflags = "-std=c++00" + cflags_common
4552 with pytest .raises (RuntimeError ):
4653 parser .parse (["cpp_standards.hpp" ], config )
0 commit comments