[squid-dev] RFC: policy change for header #includes
Amos Jeffries
squid3 at treenet.co.nz
Tue Mar 7 05:38:30 UTC 2023
Current Policy
<https://wiki.squid-cache.org/DeveloperResources/SquidCodingGuidelines#file-include-guidelines>:
"
4. system C headers (with a .h suffix):
* mandatory HAVE_FOO_H wrapper
"
I propose using the C++17 "__has_include(<foo.h>)" instead of HAVE_FOO_H
whenever we can. Which is:
* all .cc and .cci files
* any .h files in the src/ and tools/ areas
Pros:
* less configure.ac logic, smaller build logs
* removes need to do a full bootstrap + re-configure when a
third-party library or system header is added/remove/changed
* conversion can be semi-scripted
Cons AFAIK are all about how it cannot be a blanket requirement like
HAVE_FOO_H is:
* sometimes headers need to be forbidden include by ./configure logic
checks
* C language does not support the __has_include
Cheers
Amos
More information about the squid-dev
mailing list