diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-08-03 12:18:47 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-08-03 12:18:47 -0700 |
commit | 7e1b36e8985f2dd88646049661080eac065d36f9 (patch) | |
tree | 28ddd4795982ad6bc7c53a1654ec92ba7ad29be2 /lib.h | |
parent | 25969db825bf609cd5be9c5cee83bed15d4c62b0 (diff) | |
download | txr-7e1b36e8985f2dd88646049661080eac065d36f9.tar.gz txr-7e1b36e8985f2dd88646049661080eac065d36f9.tar.bz2 txr-7e1b36e8985f2dd88646049661080eac065d36f9.zip |
scanner: issue with <unistd.h> header.
Flex-generated scanners contain a #include <unistd.h>
directive, whose purpose seems to be to ensure that isatty is
declared. This #include is in a bad place, long after all our
headers have been declared. We define macros in lib.h and
elsewhere that can interfere with system headers.
The Homebrew distro people have run into this problem on OS/X.
Our lib.h defines a "noreturn" macro (that should arguably be
named NORETURN, to match the style for INLINE). A "noreturn"
macro interferes with __attribute__((noreturn)) syntax in
system headers. Our main strategy for not causing that problem
is to include all system headers first, before local headers.
* parser.l: include <unistd.h> right after "config.h", if
HAVE_UNISTD_H is defined. Define YY_NO_UNISTD_H to suppress
the flex-generated #include.
Diffstat (limited to 'lib.h')
0 files changed, 0 insertions, 0 deletions