aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2024-01-24 10:35:52 -0500
committerMike Frysinger <vapier@gentoo.org>2024-01-24 10:35:52 -0500
commit063a90661c0423172e23405c2548e649a1631796 (patch)
tree361a0b04b7d9b28d772a5964b029ad137f194ef5
parentbuild: use standard config.h naming (diff)
downloadpax-utils-063a90661c0423172e23405c2548e649a1631796.tar.gz
pax-utils-063a90661c0423172e23405c2548e649a1631796.tar.bz2
pax-utils-063a90661c0423172e23405c2548e649a1631796.zip
build: use standard HAVE_xxx define style
Use the more standard HAVE_xxx convention, and only define when available. This avoids further confusion with code that is using "#ifdef" already. Signed-off-by: Mike Frysinger <vapier@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r--meson.build4
-rw-r--r--porting.h20
2 files changed, 11 insertions, 13 deletions
diff --git a/meson.build b/meson.build
index c91bb64..e891d98 100644
--- a/meson.build
+++ b/meson.build
@@ -48,11 +48,9 @@ foreach x : [
'elf-hints.h',
'glob.h',
]
- x_exists = 0
if cc.has_header(x)
- x_exists = 1
+ probe_results.set('HAVE_' + x.to_upper().underscorify(), 1)
endif
- probe_results.set('HAS_' + x.to_upper().underscorify(), x_exists)
endforeach
configure_file(
diff --git a/porting.h b/porting.h
index 1ace55e..68e2b6c 100644
--- a/porting.h
+++ b/porting.h
@@ -40,36 +40,36 @@
#include <time.h>
#include <unistd.h>
#include "elf.h"
-#if HAS_ALLOCA_H
+#ifdef HAVE_ALLOCA_H
# include <alloca.h>
#endif
-#if HAS_SYS_PRCTL_H
+#ifdef HAVE_SYS_PRCTL_H
# include <sys/prctl.h>
-# if HAS_LINUX_SECCOMP_H
+# ifdef HAVE_LINUX_SECCOMP_H
# include <linux/seccomp.h>
# endif
-# if HAS_LINUX_SECUREBITS_H
+# ifdef HAVE_LINUX_SECUREBITS_H
# include <linux/securebits.h>
# endif
#endif
-#if HAS_ENDIAN_H && HAS_BYTESWAP_H
+#if defined(HAVE_ENDIAN_H) && defined(HAVE_BYTESWAP_H)
# include <byteswap.h>
# include <endian.h>
-#elif HAS_SYS_ENDIAN_H
+#elif defined(HAVE_SYS_ENDIAN_H)
# include <sys/endian.h>
-#elif HAS_ISA_DEFS_H
+#elif defined(HAVE_ISA_DEFS_H)
# include <sys/isa_defs.h>
-#elif HAS_MACHINE_ENDIAN_H
+#elif defined(HAVE_MACHINE_ENDIAN_H)
# include <machine/endian.h>
#endif
-#ifdef HAS_GLOB_H
+#ifdef HAVE_GLOB_H
# include <glob.h>
#endif
#if defined(__GLIBC__) || defined(__UCLIBC__) || defined(__NetBSD__)
# define __PAX_UTILS_DEFAULT_LD_CACHE_CONFIG "/etc/ld.so.conf"
-#elif HAS_ELF_HINTS_H
+#elif defined(HAVE_ELF_HINTS_H)
# include <elf-hints.h>
# define __PAX_UTILS_DEFAULT_LD_CACHE_CONFIG _PATH_ELF_HINTS
#else