From 39066554e8436d9e3dae646415c0544192612ee0 Mon Sep 17 00:00:00 2001 From: Skunnyk Date: Thu, 2 Nov 2017 23:18:42 +0100 Subject: [PATCH] Fix Pre-defined Compiler Macros - Use #if defined() instead of ifdef. This should fix freebsd/kfreebsd detection/build --- panel-plugin/net.c | 14 +++++++------- panel-plugin/net.h | 12 ++++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/panel-plugin/net.c b/panel-plugin/net.c index 6e8276c..fde4ab1 100644 --- a/panel-plugin/net.c +++ b/panel-plugin/net.c @@ -45,25 +45,25 @@ #include #include -#ifdef __HPUX__ +#if defined(__HPUX__) # include "wormulon/hpux.h" # include "wormulon/hpux.c" -#elif __APPLE__ +#elif defined(__APPLE__) # include "src/macos.h" # include "src/macos.c" -#elif __FreeBSD__ || __DragonFly__ || __FreeBSD_kernel__ +#elif (defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)) # include "wormulon/freebsd.h" # include "wormulon/freebsd.c" -#elif __linux__ +#elif defined(__linux__) # include "wormulon/linux.h" # include "wormulon/linux.c" -#elif __OpenBSD__ || __MicroBSD__ +#elif (defined(__OpenBSD__) || defined(__MicroBSD__)) # include "wormulon/openbsd.h" # include "wormulon/openbsd.c" -#elif __NetBSD__ +#elif defined(__NetBSD__) # include "wormulon/netbsd.h" # include "wormulon/netbsd.c" -#elif __Solaris__ +#elif defined(__Solaris__) # include "wormulon/solaris.h" # include "wormulon/solaris.c" #else diff --git a/panel-plugin/net.h b/panel-plugin/net.h index a268088..4c17e46 100644 --- a/panel-plugin/net.h +++ b/panel-plugin/net.h @@ -66,29 +66,29 @@ typedef struct DataStats stats; int up; int up_update_count; -#ifdef __HPUX__ +#if defined(__HPUX__) int wait_pcks_counter; nmapi_logstat* if_ptr; -#elif __FreeBSD__ || __DragonFly__ || __FreeBSD_kernel__ +#elif (defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)) int watchif; int dev_opened; -#elif __NetBSD__ +#elif defined(__NetBSD__) int mib_name1[6]; int mib_name2[6]; char* buf1; char* buf2; int alloc1; int alloc2; -#elif __OpenBSD__ || __MicroBSD__ || __APPLE__ +#elif (defined(__OpenBSD__) || defined(__MicroBSD__) || defined(__APPLE__)) int mib_name1[6]; int mib_name2[6]; char* buf1; char* buf2; int alloc1; int alloc2; -#elif __linux__ +#elif defined(__linux__) FILE* proc_net_dev; -#elif __Solaris__ +#elif defined(__Solaris__) #else #error "OS not supported" #endif