OSDN Git Service

meson: always define whether headers exist
authorEric Engestrom <eric.engestrom@intel.com>
Wed, 7 Nov 2018 15:00:24 +0000 (15:00 +0000)
committerEric Engestrom <eric@engestrom.ch>
Thu, 23 Jan 2020 17:00:12 +0000 (17:00 +0000)
Combined with -Wundef (added in 75758d2ccf & enforced in ba17673eed),
this provides absolute safety against #ifdef typos.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Android.common.mk
amdgpu/amdgpu_cs.c
meson.build
tests/amdgpu/basic_tests.c
tests/amdgpu/deadlock_tests.c
tests/kms/kms-steal-crtc.c
tests/kms/kms-universal-planes.c
tests/modetest/modetest.c
tests/vbltest/vbltest.c
xf86drmMode.c

index d0e5d55..37c2b23 100644 (file)
@@ -1,6 +1,9 @@
 # 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
index b4b7dcf..1bd974f 100644 (file)
@@ -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
 
index 4468ac3..ddcb884 100644 (file)
@@ -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
index f5caf8d..57496c8 100644 (file)
@@ -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>
index d6eb35b..a18d578 100644 (file)
@@ -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
 
index cd40758..4d884c0 100644 (file)
@@ -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
 
index 2163c98..1d79388 100644 (file)
@@ -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
 
index 09fd565..b907ab3 100644 (file)
@@ -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>
index 48708d2..1c2b519 100644 (file)
@@ -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
 
index 207d7be..0cf7992 100644 (file)
@@ -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>