meson: always define whether headers exist
Combined with -Wundef (added inmain75758d2ccf
& enforced inba17673eed
), this provides absolute safety against #ifdef typos. Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
parent
077e64292c
commit
074947ee4b
|
@ -1,6 +1,9 @@
|
||||||
# XXX: Consider moving these to config.h analogous to autoconf.
|
# XXX: Consider moving these to config.h analogous to autoconf.
|
||||||
LOCAL_CFLAGS += \
|
LOCAL_CFLAGS += \
|
||||||
-DMAJOR_IN_SYSMACROS=1 \
|
-DMAJOR_IN_SYSMACROS=1 \
|
||||||
|
-DHAVE_ALLOCA_H=0 \
|
||||||
|
-DHAVE_SYS_SELECT_H=0 \
|
||||||
|
-DHAVE_SYS_SYSCTL_H=0 \
|
||||||
-DHAVE_VISIBILITY=1 \
|
-DHAVE_VISIBILITY=1 \
|
||||||
-fvisibility=hidden \
|
-fvisibility=hidden \
|
||||||
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
|
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#ifdef HAVE_ALLOCA_H
|
#if HAVE_ALLOCA_H
|
||||||
# include <alloca.h>
|
# include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ dep_m = cc.find_library('m', required : false)
|
||||||
# FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
|
# FreeBSD requires sys/types.h for sys/sysctl.h, add it as part of the
|
||||||
# includes when checking for headers.
|
# includes when checking for headers.
|
||||||
foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
|
foreach header : ['sys/sysctl.h', 'sys/select.h', 'alloca.h']
|
||||||
config.set('HAVE_' + header.underscorify().to_upper(),
|
config.set10('HAVE_' + header.underscorify().to_upper(),
|
||||||
cc.compiles('#include <sys/types.h>\n#include <@0@>'.format(header), name : '@0@ works'.format(header)))
|
cc.compiles('#include <sys/types.h>\n#include <@0@>'.format(header), name : '@0@ works'.format(header)))
|
||||||
endforeach
|
endforeach
|
||||||
if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
|
if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#endif
|
#endif
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifdef HAVE_ALLOCA_H
|
#if HAVE_ALLOCA_H
|
||||||
# include <alloca.h>
|
# include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef HAVE_ALLOCA_H
|
#if HAVE_ALLOCA_H
|
||||||
# include <alloca.h>
|
# include <alloca.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
#if HAVE_SYS_SELECT_H
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
#if HAVE_SYS_SELECT_H
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
#if HAVE_SYS_SELECT_H
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <poll.h>
|
#include <poll.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
#if HAVE_SYS_SELECT_H
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#ifdef HAVE_SYS_SYSCTL_H
|
#if HAVE_SYS_SYSCTL_H
|
||||||
#include <sys/sysctl.h>
|
#include <sys/sysctl.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
Loading…
Reference in New Issue