Commit 074947ee authored by Eric Engestrom's avatar Eric Engestrom Committed by Eric Engestrom

meson: always define whether headers exist

Combined with -Wundef (added in 75758d2c & enforced in ba17673e),
this provides absolute safety against #ifdef typos.
Signed-off-by: Eric Engestrom's avatarEric Engestrom <eric.engestrom@intel.com>
Reviewed-by: default avatarEmil Velikov <emil.velikov@collabora.com>
parent 077e6429
Pipeline #102067 passed with stage
in 3 minutes and 15 seconds
# XXX: Consider moving these to config.h analogous to autoconf.
LOCAL_CFLAGS += \
-DMAJOR_IN_SYSMACROS=1 \
-DHAVE_ALLOCA_H=0 \
-DHAVE_SYS_SELECT_H=0 \
-DHAVE_SYS_SYSCTL_H=0 \
-DHAVE_VISIBILITY=1 \
-fvisibility=hidden \
-DHAVE_LIBDRM_ATOMIC_PRIMITIVES=1
......
......@@ -28,7 +28,7 @@
#include <pthread.h>
#include <sched.h>
#include <sys/ioctl.h>
#ifdef HAVE_ALLOCA_H
#if HAVE_ALLOCA_H
# include <alloca.h>
#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
# includes when checking for headers.
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)))
endforeach
if (cc.has_header_symbol('sys/sysmacros.h', 'major') and
......
......@@ -30,7 +30,7 @@
#endif
#include <sys/stat.h>
#include <fcntl.h>
#ifdef HAVE_ALLOCA_H
#if HAVE_ALLOCA_H
# include <alloca.h>
#endif
#include <sys/wait.h>
......
......@@ -24,7 +24,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#ifdef HAVE_ALLOCA_H
#if HAVE_ALLOCA_H
# include <alloca.h>
#endif
......
......@@ -28,7 +28,7 @@
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#ifdef HAVE_SYS_SELECT_H
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
......
......@@ -28,7 +28,7 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#ifdef HAVE_SYS_SELECT_H
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
......
......@@ -51,7 +51,7 @@
#include <errno.h>
#include <poll.h>
#include <sys/time.h>
#ifdef HAVE_SYS_SELECT_H
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#include <math.h>
......
......@@ -33,7 +33,7 @@
#include <errno.h>
#include <poll.h>
#include <sys/time.h>
#ifdef HAVE_SYS_SELECT_H
#if HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
......
......@@ -42,7 +42,7 @@
#include <stdint.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#ifdef HAVE_SYS_SYSCTL_H
#if HAVE_SYS_SYSCTL_H
#include <sys/sysctl.h>
#endif
#include <stdio.h>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment