aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorng0 <ng0@n0.is>2019-11-20 14:53:33 +0000
committerng0 <ng0@n0.is>2019-11-20 14:53:33 +0000
commitc4eb7c3e2afd631fa83f3d21555829178a5e10c1 (patch)
treeb56ef598e649be4a5b412503940f6d9394c685ad /src
parent13226e828c6b7d56c77444afe159c1ccf008d62d (diff)
downloadgnunet-c4eb7c3e2afd631fa83f3d21555829178a5e10c1.tar.gz
gnunet-c4eb7c3e2afd631fa83f3d21555829178a5e10c1.zip
use ifdef instead of if for __linux__ and BSD
Diffstat (limited to 'src')
-rw-r--r--src/nse/gnunet-service-nse.c2
-rw-r--r--src/testbed/gnunet-service-testbed_cpustatus.c2
-rw-r--r--src/transport/plugin_transport_udp_broadcasting.c14
-rw-r--r--src/util/network.c2
-rw-r--r--src/util/os_installation.c6
-rw-r--r--src/util/test_bio.c2
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 @@
75 (GNUNET_MQ_PRIO_BACKGROUND | GNUNET_MQ_PREF_UNRELIABLE \ 75 (GNUNET_MQ_PRIO_BACKGROUND | GNUNET_MQ_PREF_UNRELIABLE \
76 | GNUNET_MQ_PREF_CORK_ALLOWED) 76 | GNUNET_MQ_PREF_CORK_ALLOWED)
77 77
78#if BSD 78#ifdef BSD
79#define log2(a) (log (a) / log (2)) 79#define log2(a) (log (a) / log (2))
80#endif 80#endif
81 81
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 @@
43#include <kvm.h> 43#include <kvm.h>
44#endif 44#endif
45#endif 45#endif
46#if BSD 46#ifdef BSD
47#if HAVE_KVM_H 47#if HAVE_KVM_H
48#include <kvm.h> 48#include <kvm.h>
49#endif 49#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 @@
41#define LOG(kind, ...) GNUNET_log_from (kind, "transport-udp", __VA_ARGS__) 41#define LOG(kind, ...) GNUNET_log_from (kind, "transport-udp", __VA_ARGS__)
42 42
43/* *********** Cryogenic ********** */ 43/* *********** Cryogenic ********** */
44#if __linux__ 44#ifdef __linux__
45#include <sys/stat.h> 45#include <sys/stat.h>
46#include <fcntl.h> 46#include <fcntl.h>
47 47
@@ -92,7 +92,7 @@ struct BroadcastAddress
92 92
93 socklen_t addrlen; 93 socklen_t addrlen;
94 94
95#if __linux__ 95#ifdef __linux__
96 /** 96 /**
97 * Cryogenic handle. 97 * Cryogenic handle.
98 */ 98 */
@@ -277,7 +277,7 @@ udp_ipv4_broadcast_send (void *cls)
277 } 277 }
278 } 278 }
279 279
280#if __linux__ 280#ifdef __linux__
281 /* 281 /*
282 * Cryogenic 282 * Cryogenic
283 */ 283 */
@@ -359,7 +359,7 @@ udp_ipv6_broadcast_send (void *cls)
359 GNUNET_a2s ((const struct sockaddr *) &plugin->ipv6_multicast_address, 359 GNUNET_a2s ((const struct sockaddr *) &plugin->ipv6_multicast_address,
360 sizeof(struct sockaddr_in6))); 360 sizeof(struct sockaddr_in6)));
361 } 361 }
362#if __linux__ 362#ifdef __linux__
363 /* 363 /*
364 * Cryogenic 364 * Cryogenic
365 */ 365 */
@@ -448,7 +448,7 @@ iface_proc (void *cls,
448 (NULL != plugin->sockv4) && 448 (NULL != plugin->sockv4) &&
449 (addrlen == sizeof(struct sockaddr_in))) 449 (addrlen == sizeof(struct sockaddr_in)))
450 { 450 {
451#if __linux__ 451#ifdef __linux__
452 /* 452 /*
453 * setup Cryogenic FD for ipv4 broadcasting 453 * setup Cryogenic FD for ipv4 broadcasting
454 */ 454 */
@@ -503,7 +503,7 @@ iface_proc (void *cls,
503 } 503 }
504 else 504 else
505 { 505 {
506#if __linux__ 506#ifdef __linux__
507 /* 507 /*
508 * setup Cryogenic FD for ipv6 broadcasting 508 * setup Cryogenic FD for ipv6 broadcasting
509 */ 509 */
@@ -632,7 +632,7 @@ stop_broadcast (struct Plugin *plugin)
632 } 632 }
633 } 633 }
634 634
635#if __linux__ 635#ifdef __linux__
636 GNUNET_DISK_file_close (p->cryogenic_fd); 636 GNUNET_DISK_file_close (p->cryogenic_fd);
637#endif 637#endif
638 GNUNET_CONTAINER_DLL_remove (plugin->broadcast_head, 638 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)
962{ 962{
963 int ret = 0; 963 int ret = 0;
964 964
965#if __linux__ 965#ifdef __linux__
966 int value = 0; 966 int value = 0;
967 967
968 if (0 != 968 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)
134} 134}
135 135
136 136
137#if __linux__ 137#ifdef __linux__
138/** 138/**
139 * Try to determine path by reading /proc/PID/exe 139 * Try to determine path by reading /proc/PID/exe
140 * 140 *
@@ -383,7 +383,7 @@ os_get_gnunet_path ()
383 383
384 if (NULL != (ret = get_path_from_GNUNET_PREFIX ())) 384 if (NULL != (ret = get_path_from_GNUNET_PREFIX ()))
385 return ret; 385 return ret;
386#if __linux__ 386#ifdef __linux__
387 if (NULL != (ret = get_path_from_proc_maps ())) 387 if (NULL != (ret = get_path_from_proc_maps ()))
388 return ret; 388 return ret;
389 /* try path *first*, before /proc/exe, as /proc/exe can be wrong */ 389 /* try path *first*, before /proc/exe, as /proc/exe can be wrong */
@@ -421,7 +421,7 @@ os_get_exec_path ()
421{ 421{
422 char *ret = NULL; 422 char *ret = NULL;
423 423
424#if __linux__ 424#ifdef __linux__
425 if (NULL != (ret = get_path_from_proc_exe ())) 425 if (NULL != (ret = get_path_from_proc_exe ()))
426 return ret; 426 return ret;
427#endif 427#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 ()
200static int 200static int
201test_directory_r () 201test_directory_r ()
202{ 202{
203#if __linux__ 203#ifdef __linux__
204 char *msg; 204 char *msg;
205 char readResult[200]; 205 char readResult[200];
206 struct GNUNET_BIO_ReadHandle *fileR; 206 struct GNUNET_BIO_ReadHandle *fileR;