From 75610bbfc9063e948848a47aceb1f95c887aa0ee Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Mon, 10 Oct 2016 15:07:34 +0100 Subject: [PATCH 6/8] Fix remaining -Wundef warnings Vaguely based on a patch from Thomas Zimmermann, but with a different solution to RECURSIVE_MARSHAL_WRITE_TRACE, and additionally fixing a build failure that only occurs when targeting Unix without libsystemd, and another that occurs when targeting Windows. Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=97357 --- dbus/dbus-marshal-recursive-util.c | 3 +++ dbus/dbus-sysdeps-win.c | 4 ++-- dbus/dbus-userdb-util.c | 2 +- test/test-segfault.c | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/dbus/dbus-marshal-recursive-util.c b/dbus/dbus-marshal-recursive-util.c index e00ac5c..c60c72c 100644 --- a/dbus/dbus-marshal-recursive-util.c +++ b/dbus/dbus-marshal-recursive-util.c @@ -35,6 +35,9 @@ #define PRIx64 "I64x" #endif +/** turn this on to get deluged in TypeWriter verbose spam */ +#define RECURSIVE_MARSHAL_WRITE_TRACE 0 + static void basic_value_zero (DBusBasicValue *value) { diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index c68c6ca..343a51d 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -2464,7 +2464,7 @@ static void dump_backtrace_for_thread (HANDLE hThread) sf.AddrFrame.Mode = AddrModeFlat; sf.AddrPC.Offset = context.Eip; sf.AddrPC.Mode = AddrModeFlat; -#elif _M_X64 +#elif defined(_M_X64) dwImageType = IMAGE_FILE_MACHINE_AMD64; sf.AddrPC.Offset = context.Rip; sf.AddrPC.Mode = AddrModeFlat; @@ -2472,7 +2472,7 @@ static void dump_backtrace_for_thread (HANDLE hThread) sf.AddrFrame.Mode = AddrModeFlat; sf.AddrStack.Offset = context.Rsp; sf.AddrStack.Mode = AddrModeFlat; -#elif _M_IA64 +#elif defined(_M_IA64) dwImageType = IMAGE_FILE_MACHINE_IA64; sf.AddrPC.Offset = context.StIIP; sf.AddrPC.Mode = AddrModeFlat; diff --git a/dbus/dbus-userdb-util.c b/dbus/dbus-userdb-util.c index 888a23e..44a1a78 100644 --- a/dbus/dbus-userdb-util.c +++ b/dbus/dbus-userdb-util.c @@ -29,7 +29,7 @@ #include "dbus-protocol.h" #include -#if HAVE_SYSTEMD +#ifdef HAVE_SYSTEMD #include #endif diff --git a/test/test-segfault.c b/test/test-segfault.c index b6c0f8a..cd80db6 100644 --- a/test/test-segfault.c +++ b/test/test-segfault.c @@ -44,7 +44,7 @@ main (int argc, char **argv) SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)&exception_handler); #endif -#if HAVE_SETRLIMIT +#ifdef HAVE_SETRLIMIT /* No core dumps please, we know we crashed. */ struct rlimit r = { 0, }; -- 2.9.3