This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=811651673916b07d74b8e7284da71e02b12019f6

commit 811651673916b07d74b8e7284da71e02b12019f6
Author: Guillem Jover <[email protected]>
AuthorDate: Mon May 27 00:45:20 2024 +0200

    build: Check whether HAVE_* macros for headers are defined
    
    The autoconf HAVE_ macros for headers are only defined if the header is
    present. So we should check for that and not only for whether the macro
    is true.
---
 dselect/main.cc           |  2 +-
 lib/dpkg/t/c-tarextract.c |  4 ++--
 lib/dpkg/tarfn.c          |  2 +-
 m4/dpkg-types.m4          |  4 ++--
 src/deb/main.c            |  2 +-
 src/divert/main.c         |  2 +-
 src/main/main.c           |  2 +-
 src/query/main.c          |  2 +-
 src/realpath/main.c       |  2 +-
 src/split/main.c          |  2 +-
 src/statoverride/main.c   |  2 +-
 src/trigger/main.c        |  2 +-
 utils/start-stop-daemon.c | 10 +++++-----
 13 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/dselect/main.cc b/dselect/main.cc
index 372a16d7b..9726c52f8 100644
--- a/dselect/main.cc
+++ b/dselect/main.cc
@@ -28,7 +28,7 @@
 
 #include <errno.h>
 #include <limits.h>
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #include <ctype.h>
diff --git a/lib/dpkg/t/c-tarextract.c b/lib/dpkg/t/c-tarextract.c
index 82a8dab2a..c68b5d2f4 100644
--- a/lib/dpkg/t/c-tarextract.c
+++ b/lib/dpkg/t/c-tarextract.c
@@ -22,10 +22,10 @@
 #include <compat.h>
 
 #include <sys/types.h>
-#if HAVE_SYS_SYSMACROS_H
+#ifdef HAVE_SYS_SYSMACROS_H
 #include <sys/sysmacros.h> /* Needed on AIX for major()/minor(). */
 #endif
-#if HAVE_SYS_MKDEV_H
+#ifdef HAVE_SYS_MKDEV_H
 #include <sys/mkdev.h> /* Needed on Solaris for major()/minor(). */
 #endif
 
diff --git a/lib/dpkg/tarfn.c b/lib/dpkg/tarfn.c
index e95e6417e..2ce07a0e4 100644
--- a/lib/dpkg/tarfn.c
+++ b/lib/dpkg/tarfn.c
@@ -22,7 +22,7 @@
 #include <config.h>
 #include <compat.h>
 
-#if HAVE_SYS_SYSMACROS_H
+#ifdef HAVE_SYS_SYSMACROS_H
 #include <sys/sysmacros.h>
 #endif
 #include <sys/stat.h>
diff --git a/m4/dpkg-types.m4 b/m4/dpkg-types.m4
index 1159967d9..1e47ad2dd 100644
--- a/m4/dpkg-types.m4
+++ b/m4/dpkg-types.m4
@@ -23,7 +23,7 @@ AC_DEFUN([DPKG_TYPE_STRUCT_PSINFO], [
 #undef _FILE_OFFSET_BITS
 #endif
 #define _STRUCTURED_PROC 1
-#if HAVE_SYS_PROCFS_H
+#ifdef HAVE_SYS_PROCFS_H
 #include <sys/procfs.h>
 #endif
   ]])
@@ -37,7 +37,7 @@ AC_DEFUN([DPKG_DECL_SYS_SIGLIST], [
   AC_CHECK_DECLS([sys_siglist], [], [], [[
 #include <signal.h>
 /* NetBSD declares sys_siglist in unistd.h.  */
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
 #  include <unistd.h>
 #endif
   ]])
diff --git a/src/deb/main.c b/src/deb/main.c
index 2c5381172..b7fe11c25 100644
--- a/src/deb/main.c
+++ b/src/deb/main.c
@@ -26,7 +26,7 @@
 #include <sys/wait.h>
 
 #include <limits.h>
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #include <errno.h>
diff --git a/src/divert/main.c b/src/divert/main.c
index caa508132..0266abfa3 100644
--- a/src/divert/main.c
+++ b/src/divert/main.c
@@ -28,7 +28,7 @@
 #include <sys/stat.h>
 
 #include <errno.h>
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #include <fcntl.h>
diff --git a/src/main/main.c b/src/main/main.c
index 15918fb7f..ecaed5f32 100644
--- a/src/main/main.c
+++ b/src/main/main.c
@@ -29,7 +29,7 @@
 
 #include <errno.h>
 #include <limits.h>
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #include <string.h>
diff --git a/src/query/main.c b/src/query/main.c
index 4fce45050..c6259574e 100644
--- a/src/query/main.c
+++ b/src/query/main.c
@@ -28,7 +28,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #include <errno.h>
diff --git a/src/realpath/main.c b/src/realpath/main.c
index 387294a61..c6a1d084e 100644
--- a/src/realpath/main.c
+++ b/src/realpath/main.c
@@ -25,7 +25,7 @@
 #include <sys/stat.h>
 
 #include <errno.h>
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #include <string.h>
diff --git a/src/split/main.c b/src/split/main.c
index eba2333c3..729f1c50b 100644
--- a/src/split/main.c
+++ b/src/split/main.c
@@ -26,7 +26,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <inttypes.h>
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #include <string.h>
diff --git a/src/statoverride/main.c b/src/statoverride/main.c
index 4269cbe65..1ba091f70 100644
--- a/src/statoverride/main.c
+++ b/src/statoverride/main.c
@@ -26,7 +26,7 @@
 #include <sys/stat.h>
 
 #include <errno.h>
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #include <string.h>
diff --git a/src/trigger/main.c b/src/trigger/main.c
index 2bba56db4..7eb1b5a3b 100644
--- a/src/trigger/main.c
+++ b/src/trigger/main.c
@@ -25,7 +25,7 @@
 #include <sys/types.h>
 
 #include <fcntl.h>
-#if HAVE_LOCALE_H
+#ifdef HAVE_LOCALE_H
 #include <locale.h>
 #endif
 #include <string.h>
diff --git a/utils/start-stop-daemon.c b/utils/start-stop-daemon.c
index 5dd90fd48..5e1ddeb38 100644
--- a/utils/start-stop-daemon.c
+++ b/utils/start-stop-daemon.c
@@ -1622,7 +1622,7 @@ proc_status_field(pid_t pid, const char *field)
 
        return value;
 }
-#elif (defined(OS_Solaris) || defined(OS_AIX)) && HAVE_STRUCT_PSINFO
+#elif (defined(OS_Solaris) || defined(OS_AIX)) && defined(HAVE_STRUCT_PSINFO)
 static bool
 proc_get_psinfo(pid_t pid, struct psinfo *psinfo)
 {
@@ -1753,7 +1753,7 @@ pid_is_exec(pid_t pid, const struct stat *esb)
 
        return (sb.st_dev == esb->st_dev && sb.st_ino == esb->st_ino);
 }
-#elif (defined(OS_Solaris) || defined(OS_AIX)) && HAVE_STRUCT_PSINFO
+#elif (defined(OS_Solaris) || defined(OS_AIX)) && defined(HAVE_STRUCT_PSINFO)
 static bool
 pid_is_exec(pid_t pid, const struct stat *esb)
 {
@@ -1946,7 +1946,7 @@ pid_is_child(pid_t pid, pid_t ppid)
 
        return (pid_t)pbi.pbi_ppid == ppid;
 }
-#elif (defined(OS_Solaris) || defined(OS_AIX)) && HAVE_STRUCT_PSINFO
+#elif (defined(OS_Solaris) || defined(OS_AIX)) && defined(HAVE_STRUCT_PSINFO)
 static bool
 pid_is_child(pid_t pid, pid_t ppid)
 {
@@ -2055,7 +2055,7 @@ pid_is_user(pid_t pid, uid_t uid)
 
        return pbi.pbi_ruid == uid;
 }
-#elif (defined(OS_Solaris) || defined(OS_AIX)) && HAVE_STRUCT_PSINFO
+#elif (defined(OS_Solaris) || defined(OS_AIX)) && defined(HAVE_STRUCT_PSINFO)
 static bool
 pid_is_user(pid_t pid, uid_t uid)
 {
@@ -2180,7 +2180,7 @@ pid_is_cmd(pid_t pid, const char *name)
 
        return false;
 }
-#elif (defined(OS_Solaris) || defined(OS_AIX)) && HAVE_STRUCT_PSINFO
+#elif (defined(OS_Solaris) || defined(OS_AIX)) && defined(HAVE_STRUCT_PSINFO)
 static bool
 pid_is_cmd(pid_t pid, const char *name)
 {

-- 
Dpkg.Org's dpkg

Reply via email to