Peter Eisentraut <pe...@eisentraut.org> writes:
> Note that Autoconf uses a compilation test, not a preprocessor test, for 
> its AC_CHECK_HEADERS, so it uses .check_header() semantics.  And this 
> was the result of a long transition, because the compile test was 
> ultimately deemed to be better.  So in general, I would be wary about 
> moving away from .check_header() toward .has_header().  But it looks 
> like meson.build mixes those without much of a pattern, so maybe it 
> doesn't matter for now.

> But I'm also suspicious, because by this explanation, the 
> AC_CHECK_HEADERS calls on sys/event.h should fail on OpenBSD, but they 
> do not on the existing buildfarm members.

I was curious about this, so I tried it on a handy OpenBSD 7.7
installation.  Indeed, sys/event.h does not compile on its own:

$ cat tst.c
#include <sys/event.h>

int main() { return 0; }

$ cc tst.c  
In file included from tst.c:1:
/usr/include/sys/event.h:57:2: error: unknown type name '__uintptr_t'; did you 
mean '__uint128_t'?
        __uintptr_t     ident;          /* identifier for this event */
        ^
note: '__uint128_t' declared here
/usr/include/sys/event.h:61:2: error: unknown type name '__int64_t'; did you 
mean '__int128_t'?
        __int64_t       data;           /* filter data value */
        ^
note: '__int128_t' declared here
2 errors generated.

Whether this is intentional is hard to say, because I can't find
either event.h or any of the functions it declares in the OpenBSD
man pages.  But anyway, AC_CHECK_HEADERS does think that <sys/event.h>
is available, and that's because it does NOT just blindly include
the header-to-test.  It includes assorted standard headers
such as <stdint.h> first, thus dodging the problem.

I confirm Jacob's result that our meson.build fails to think
that <sys/event.h> is available, so we do need to do something.
I'm not excited about dropping the compilability check though.
If meson can't do that more like autoconf does it, I foresee
needing to build ad-hoc reimplementations of autoconf's logic.

                        regards, tom lane


Reply via email to