]> git.draconx.ca Git - dxcommon.git/commit
Add a configure test for C99-ish "for" declarations.
authorNick Bowler <nbowler@draconx.ca>
Thu, 30 Nov 2023 01:33:29 +0000 (20:33 -0500)
committerNick Bowler <nbowler@draconx.ca>
Thu, 30 Nov 2023 01:53:07 +0000 (20:53 -0500)
commit6405aa895740d960d6f6e70976eeb44bd403f952
treebdaf6478d521d89778f11d68c4771d41ecee9ace
parented04bed43efece46d2b476fbb0260f1d1b8aa1fe
Add a configure test for C99-ish "for" declarations.

Several C89-era compilers support for loop declarations (although
I'm not sure if they implement C99 block scoping rules exactly and
this new macro doesn't check for that).

It is generally easy to simply not use this feature, so conditional
compilation based on its presence is of limited utility.  But it can
sometimes be handy to know when (optionally) including third-party
code that depends on this syntax.

The test is short-circuited based on Autoconf's C version probes, which
requires an annoying amount of complexity because Autoconf 2.70 has
totally broken C99 detection and Autoconf 2.71 includes incompatible
changes to previously-documented behaviour.
m4/fordecl.m4 [new file with mode: 0644]
tests/macros.at