Fix compilation on MacOS X

Patch by Shachar Itzhaky.

* spot/parseaut/scanaut.ll, spot/parsetl/scantl.ll: Include
libc-config.h instead of config.h.
* NEWS: Mention the fix.
* THANKS: Add Shachar.
This commit is contained in:
Alexandre Duret-Lutz 2022-05-17 09:27:30 +02:00
parent 013c879b41
commit 3b809c0a14
4 changed files with 21 additions and 10 deletions

View file

@ -25,12 +25,15 @@
/* %option debug */
%top{
#include "config.h"
#include "libc-config.h"
/* Flex 2.6.4's test for <inttypes.h> relies on __STDC_VERSION__
which is undefined in C++. So without that, it will define
its own integer types, including a broken SIZE_MAX definition.
So let's define __STDC_VERSION__ to make sure <inttypes.h> gets
included. */
its own integer types, including a broken SIZE_MAX definition that
breaks compilation on OpenBSD. So let's define __STDC_VERSION__ to
make sure <inttypes.h> gets included. Redefining __STDC_VERSION__
this way can break all sort of macros defined in <cdefs.h>, so
we include "libc-config.h" instead of "config.h" above to define
those macros first. */
#if HAVE_INTTYPES_H && !(defined __STDC_VERSION__)
# define __STDC_VERSION__ 199901L
#endif

View file

@ -27,12 +27,15 @@
%option never-interactive
%top{
#include "config.h"
#include "libc-config.h"
/* Flex 2.6.4's test for <inttypes.h> relies on __STDC_VERSION__
which is undefined in C++. So without that, it will define
its own integer types, including a broken SIZE_MAX definition.
So let's define __STDC_VERSION__ to make sure <inttypes.h> gets
included. */
its own integer types, including a broken SIZE_MAX definition that
breaks compilation on OpenBSD. So let's define __STDC_VERSION__ to
make sure <inttypes.h> gets included. Redefining __STDC_VERSION__
this way can break all sort of macros defined in <cdefs.h>, so
we include "libc-config.h" instead of "config.h" above to define
those macros first. */
#if HAVE_INTTYPES_H && !(defined __STDC_VERSION__)
# define __STDC_VERSION__ 199901L
#endif