Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make __has_include portable in C

Tags:

c

include

__has_include is included in the C++ standard since C++17. However, in C, is just supported by compilers that implement it as an extension. As far as I am aware, just GCC and clang support it. Is there a way I can accomplish a similar effect portably in C? MSVC just seems to support it for C++.

like image 717
Giuppox Avatar asked Jul 05 '26 04:07

Giuppox


1 Answers

__has_include was added to C23; see here.

like image 158
Paul J. Lucas Avatar answered Jul 07 '26 19:07

Paul J. Lucas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!