From c4eb7c3e2afd631fa83f3d21555829178a5e10c1 Mon Sep 17 00:00:00 2001 From: ng0 Date: Wed, 20 Nov 2019 14:53:33 +0000 Subject: [PATCH] use ifdef instead of if for __linux__ and BSD --- src/nse/gnunet-service-nse.c | 2 +- src/testbed/gnunet-service-testbed_cpustatus.c | 2 +- src/transport/plugin_transport_udp_broadcasting.c | 14 +++++++------- src/util/network.c | 2 +- src/util/os_installation.c | 6 +++--- src/util/test_bio.c | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index fa9a2e950..3e72be1c5 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c @@ -75,7 +75,7 @@ (GNUNET_MQ_PRIO_BACKGROUND | GNUNET_MQ_PREF_UNRELIABLE \ | GNUNET_MQ_PREF_CORK_ALLOWED) -#if BSD +#ifdef BSD #define log2(a) (log (a) / log (2)) #endif diff --git a/src/testbed/gnunet-service-testbed_cpustatus.c b/src/testbed/gnunet-service-testbed_cpustatus.c index cd1878467..e96449def 100644 --- a/src/testbed/gnunet-service-testbed_cpustatus.c +++ b/src/testbed/gnunet-service-testbed_cpustatus.c @@ -43,7 +43,7 @@ #include #endif #endif -#if BSD +#ifdef BSD #if HAVE_KVM_H #include #endif diff --git a/src/transport/plugin_transport_udp_broadcasting.c b/src/transport/plugin_transport_udp_broadcasting.c index 5e72fad09..a65f5bd2f 100644 --- a/src/transport/plugin_transport_udp_broadcasting.c +++ b/src/transport/plugin_transport_udp_broadcasting.c @@ -41,7 +41,7 @@ #define LOG(kind, ...) GNUNET_log_from (kind, "transport-udp", __VA_ARGS__) /* *********** Cryogenic ********** */ -#if __linux__ +#ifdef __linux__ #include #include @@ -92,7 +92,7 @@ struct BroadcastAddress socklen_t addrlen; -#if __linux__ +#ifdef __linux__ /** * Cryogenic handle. */ @@ -277,7 +277,7 @@ udp_ipv4_broadcast_send (void *cls) } } -#if __linux__ +#ifdef __linux__ /* * Cryogenic */ @@ -359,7 +359,7 @@ udp_ipv6_broadcast_send (void *cls) GNUNET_a2s ((const struct sockaddr *) &plugin->ipv6_multicast_address, sizeof(struct sockaddr_in6))); } -#if __linux__ +#ifdef __linux__ /* * Cryogenic */ @@ -448,7 +448,7 @@ iface_proc (void *cls, (NULL != plugin->sockv4) && (addrlen == sizeof(struct sockaddr_in))) { -#if __linux__ +#ifdef __linux__ /* * setup Cryogenic FD for ipv4 broadcasting */ @@ -503,7 +503,7 @@ iface_proc (void *cls, } else { -#if __linux__ +#ifdef __linux__ /* * setup Cryogenic FD for ipv6 broadcasting */ @@ -632,7 +632,7 @@ stop_broadcast (struct Plugin *plugin) } } -#if __linux__ +#ifdef __linux__ GNUNET_DISK_file_close (p->cryogenic_fd); #endif GNUNET_CONTAINER_DLL_remove (plugin->broadcast_head, diff --git a/src/util/network.c b/src/util/network.c index 52ae3d2c7..223ce2080 100644 --- a/src/util/network.c +++ b/src/util/network.c @@ -962,7 +962,7 @@ GNUNET_NETWORK_socket_disable_corking (struct GNUNET_NETWORK_Handle *desc) { int ret = 0; -#if __linux__ +#ifdef __linux__ int value = 0; if (0 != diff --git a/src/util/os_installation.c b/src/util/os_installation.c index 846ceeeec..990acede4 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c @@ -134,7 +134,7 @@ GNUNET_OS_init (const struct GNUNET_OS_ProjectData *pd) } -#if __linux__ +#ifdef __linux__ /** * Try to determine path by reading /proc/PID/exe * @@ -383,7 +383,7 @@ os_get_gnunet_path () if (NULL != (ret = get_path_from_GNUNET_PREFIX ())) return ret; -#if __linux__ +#ifdef __linux__ if (NULL != (ret = get_path_from_proc_maps ())) return ret; /* try path *first*, before /proc/exe, as /proc/exe can be wrong */ @@ -421,7 +421,7 @@ os_get_exec_path () { char *ret = NULL; -#if __linux__ +#ifdef __linux__ if (NULL != (ret = get_path_from_proc_exe ())) return ret; #endif diff --git a/src/util/test_bio.c b/src/util/test_bio.c index 13ae1cf56..53b45c23a 100644 --- a/src/util/test_bio.c +++ b/src/util/test_bio.c @@ -200,7 +200,7 @@ test_bigmeta_rw () static int test_directory_r () { -#if __linux__ +#ifdef __linux__ char *msg; char readResult[200]; struct GNUNET_BIO_ReadHandle *fileR; -- 2.25.1