aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac6
-rw-r--r--src/include/platform.h8
-rw-r--r--src/nat/gnunet-helper-nat-client.c5
-rw-r--r--src/nse/gnunet-service-nse.c2
-rw-r--r--src/testbed/gnunet-service-testbed_cpustatus.c2
-rw-r--r--src/util/disk.c2
6 files changed, 10 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac
index 25a558902..c5c6586e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -132,8 +132,6 @@ AS_CASE(["$host_os"],
132 AC_PATH_XTRA 132 AC_PATH_XTRA
133 ], 133 ],
134 [*freebsd*],[ 134 [*freebsd*],[
135 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
136 AC_DEFINE_UNQUOTED(FREEBSD,1,[This is a FreeBSD system])
137 CFLAGS="-D_THREAD_SAFE $CFLAGS" 135 CFLAGS="-D_THREAD_SAFE $CFLAGS"
138 build_target="freebsd" 136 build_target="freebsd"
139 LIBPREFIX= 137 LIBPREFIX=
@@ -141,8 +139,6 @@ AS_CASE(["$host_os"],
141 UNIXONLY="#" 139 UNIXONLY="#"
142 ], 140 ],
143 [*openbsd*],[ 141 [*openbsd*],[
144 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
145 AC_DEFINE_UNQUOTED(OPENBSD,1,[This is an OpenBSD system])
146 LIBS=`echo $LIBS | sed -e "s/-ldl//"` 142 LIBS=`echo $LIBS | sed -e "s/-ldl//"`
147 build_target="openbsd" 143 build_target="openbsd"
148 LIBPREFIX= 144 LIBPREFIX=
@@ -150,8 +146,6 @@ AS_CASE(["$host_os"],
150 UNIXONLY="#" 146 UNIXONLY="#"
151 ], 147 ],
152 [*netbsd*],[ 148 [*netbsd*],[
153 AC_DEFINE_UNQUOTED(SOMEBSD,1,[This is a BSD system])
154 AC_DEFINE_UNQUOTED(NETBSD,1,[This is a NetBSD system])
155 build_target="netbsd" 149 build_target="netbsd"
156 LIBPREFIX= 150 LIBPREFIX=
157 DLLDIR=lib 151 DLLDIR=lib
diff --git a/src/include/platform.h b/src/include/platform.h
index 0dddd9741..976c9eac7 100644
--- a/src/include/platform.h
+++ b/src/include/platform.h
@@ -115,11 +115,10 @@
115#include <time.h> 115#include <time.h>
116#endif 116#endif
117#endif 117#endif
118 118#ifdef BSD
119#ifdef SOMEBSD
120#include <net/if.h> 119#include <net/if.h>
121#endif 120#endif
122#ifdef FREEBSD 121#if defined(BSD) && defined(__FreeBSD__) && defined(__FreeBSD_kernel__)
123#include <semaphore.h> 122#include <semaphore.h>
124#endif 123#endif
125#ifdef DARWIN 124#ifdef DARWIN
@@ -188,7 +187,8 @@
188 187
189#include <sys/mman.h> 188#include <sys/mman.h>
190 189
191#ifdef FREEBSD 190/* FreeBSD_kernel is not defined on the now discontinued kFreeBSD */
191#if defined(BSD) && defined(__FreeBSD__) && defined(__FreeBSD_kernel__)
192#define __BYTE_ORDER BYTE_ORDER 192#define __BYTE_ORDER BYTE_ORDER
193#define __BIG_ENDIAN BIG_ENDIAN 193#define __BIG_ENDIAN BIG_ENDIAN
194#endif 194#endif
diff --git a/src/nat/gnunet-helper-nat-client.c b/src/nat/gnunet-helper-nat-client.c
index 12abfd2df..0271d6e0f 100644
--- a/src/nat/gnunet-helper-nat-client.c
+++ b/src/nat/gnunet-helper-nat-client.c
@@ -249,7 +249,8 @@ send_icmp_udp (const struct in_addr *my_ip, const struct in_addr *other)
249 off = 0; 249 off = 0;
250 ip_pkt.vers_ihl = 0x45; 250 ip_pkt.vers_ihl = 0x45;
251 ip_pkt.tos = 0; 251 ip_pkt.tos = 0;
252#ifdef FREEBSD 252 /* should this be BSD only? */
253#if defined(BSD) && defined(__FreeBSD__) && defined(__FreeBSD_kernel__)
253 ip_pkt.pkt_len = sizeof(packet); /* Workaround PR kern/21737 */ 254 ip_pkt.pkt_len = sizeof(packet); /* Workaround PR kern/21737 */
254#else 255#else
255 ip_pkt.pkt_len = htons (sizeof(packet)); 256 ip_pkt.pkt_len = htons (sizeof(packet));
@@ -360,7 +361,7 @@ send_icmp (const struct in_addr *my_ip, const struct in_addr *other)
360 off = 0; 361 off = 0;
361 ip_pkt.vers_ihl = 0x45; 362 ip_pkt.vers_ihl = 0x45;
362 ip_pkt.tos = 0; 363 ip_pkt.tos = 0;
363#ifdef FREEBSD 364#if defined(BSD) && defined(__FreeBSD__) && defined(__FreeBSD_kernel__)
364 ip_pkt.pkt_len = sizeof(packet); /* Workaround PR kern/21737 */ 365 ip_pkt.pkt_len = sizeof(packet); /* Workaround PR kern/21737 */
365#else 366#else
366 ip_pkt.pkt_len = htons (sizeof(packet)); 367 ip_pkt.pkt_len = htons (sizeof(packet));
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c
index e31b07d14..d16abed71 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 FREEBSD 78#if 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 f38b9aee6..5eaeaf952 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 SOMEBSD 46#if 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/util/disk.c b/src/util/disk.c
index 47a0ed5c9..866dbc301 100644
--- a/src/util/disk.c
+++ b/src/util/disk.c
@@ -1505,7 +1505,7 @@ GNUNET_DISK_file_sync (const struct GNUNET_DISK_FileHandle *h)
1505 return GNUNET_SYSERR; 1505 return GNUNET_SYSERR;
1506 } 1506 }
1507 1507
1508#if defined(FREEBSD) || defined(OPENBSD) || defined(DARWIN) 1508#if ! defined(LINUX) || ! defined(GNU)
1509 return fsync (h->fd) == -1 ? GNUNET_SYSERR : GNUNET_OK; 1509 return fsync (h->fd) == -1 ? GNUNET_SYSERR : GNUNET_OK;
1510#else 1510#else
1511 return fdatasync (h->fd) == -1 ? GNUNET_SYSERR : GNUNET_OK; 1511 return fdatasync (h->fd) == -1 ? GNUNET_SYSERR : GNUNET_OK;