]> git.draconx.ca Git - cdecl99.git/commit
libcdecl: Prefer __inline in public header with GCC.
authorNick Bowler <nbowler@draconx.ca>
Thu, 21 Dec 2023 16:02:51 +0000 (11:02 -0500)
committerNick Bowler <nbowler@draconx.ca>
Thu, 21 Dec 2023 16:02:51 +0000 (11:02 -0500)
commitfd680aff4b56cdf9ece7d6ccfbd9e43ba88ef365
tree6cf20fe251e4790ac9cae8d37e49bf1eef29954f
parent108b2ebc0200fbc6218ca5165c25eea4e7890ac6
libcdecl: Prefer __inline in public header with GCC.

If the library is built using GCC with default options, the configure
tests for inline will determine it is supported, and the installed
headers will use it.

But that doesn't mean the user is running the compiler in the exactly
the same mode when including the headers.  If they then use GCC in
strict C89 mode, "inline" is not recognized as a keyword and compilation
will fail.  We can avoid this problem by just always using __inline on
GCC, with a fallback to the configure-detected result.
src/cdecl.h