Fix Pre-defined Compiler Macros

- Use #if defined() instead of ifdef. This should fix freebsd/kfreebsd detection/build
master
Skunnyk 2017-11-02 23:18:42 +01:00
parent 5098cf7266
commit 39066554e8
2 changed files with 13 additions and 13 deletions

View File

@ -45,25 +45,25 @@
#include <sys/types.h>
#include <errno.h>
#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

View File

@ -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