Re: RFC: policy change for header #includes
Francesco Chemolli <[email protected]> Tue, 7 Mar 2023 09:14:44 +0000
| Newsgroups | gmane.comp.web.squid.devel |
|---|---|
| Message-ID | <CA+Y8hcOPJq-VcKJu_m5ByJkfaHb7hWw5PEEimxXZ4tv1z2DMeg@mail.gmail.com> |
I like this idea; I would also complement it with the directive to use header <cXXXXX> instead of <XXXXX.h> whenever possible - this could also be automatically enforced On Tue, Mar 7, 2023 at 5:38 AM Amos Jeffries <[email protected]> wrote: > > 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 > > _______________________________________________ > squid-dev mailing list > [email protected] > http://lists.squid-cache.org/listinfo/squid-dev > -- Francesco _______________________________________________ squid-dev mailing list [email protected] http://lists.squid-cache.org/listinfo/squid-dev