summaryrefslogtreecommitdiff
path: root/src/lib/rib.c
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2021-06-26 00:20:17 +0200
committerSander Vrijders <sander@ouroboros.rocks>2021-06-28 15:29:16 +0200
commitcb70b78c443de5f8b95c4469dd8eb7f77af880ed (patch)
treeae90c387087b5288fe4651db485c6cdd1ef80b7c /src/lib/rib.c
parent2a46ecf6e64f1a725a3660ea03d6c9946e74de0f (diff)
downloadouroboros-cb70b78c443de5f8b95c4469dd8eb7f77af880ed.tar.gz
ouroboros-cb70b78c443de5f8b95c4469dd8eb7f77af880ed.zip
build: Fix compilation with fuse (RIB) on FreeBSD
Compilation failed on FreeBSD 14 with fuse enabled because of some missing definitions. __XSI_VISIBLE must be set before including <ouroboros/rib.h> for some definitions in <sys/stat.h>. FreeBSD doesn't know the MSG_CONFIRM flag to sendto() or CLOCK_REALTIME_COARSE, which are Linux-specific. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
Diffstat (limited to 'src/lib/rib.c')
-rw-r--r--src/lib/rib.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/lib/rib.c b/src/lib/rib.c
index d9f59a3e..0418252b 100644
--- a/src/lib/rib.c
+++ b/src/lib/rib.c
@@ -24,6 +24,10 @@
#include "config.h"
+#if defined (__FreeBSD__)
+#define __XSI_VISIBLE 500
+#endif
+
#include <ouroboros/errno.h>
#include <ouroboros/list.h>
#include <ouroboros/rib.h>
@@ -41,9 +45,7 @@
#define FUSE_USE_VERSION 26
#if defined (__linux__)
#define __USE_XOPEN
-#elif defined (__FreeBSD__)
-#define __XSI_VISIBLE 500
-#endif
+#endif /* __linux__ */
#include <fuse.h>
#ifndef CLOCK_REALTIME_COARSE
@@ -266,7 +268,6 @@ static void * fuse_thr(void * o)
}
#endif /* HAVE_FUSE */
-
int rib_init(const char * mountpt)
{
#ifdef HAVE_FUSE