News for hackers. Stuff that matters.
Re:The C23 edition of Modern C is now available for free by kccqzy on Tuesday October 15, 2024 @03:31PM (#41852251)
Yeah plenty of headers first have `#ifdef __cplusplus` and then they add `extern "C"`. And of course even then they have to avoid doing things unacceptable in C++ such as using "new" as the name of a variable.

It takes a little bit of an effort to make a header work on C and C++. A lot less effort than making a single Python file work with Python 2 and 3.

Re:The C23 edition of Modern C is now available for free by flohofwoe on Wednesday October 16, 2024 @02:42AM (#41856228)
The '#ifdef __cplusplus extern "C" { }' thing only removes C++ name mangling from exported symbols, it doesn't switch the C++ language into "C mode" (unfortunately).