Fix "'RB_ROOT' undeclared" error on OpenBSD
authorTomohiro Kusumi <tkusumi@tuxera.com>
Sun, 30 Apr 2017 17:35:08 +0000 (20:35 +0300)
committerJens Axboe <axboe@fb.com>
Sun, 30 Apr 2017 22:51:21 +0000 (16:51 -0600)
OpenBSD has below compiler error due to RB_ROOT name conflict between
lib/rbtree.h and OpenBSD header. os/os-{net,open}bsd.h actually have
had a workaround for this by undefing their RB_XXX macros (which fio
doesn't use) for possible conflicts, but then "lib/rbtree.h" needs
to be included after os/os.h which includes os/os-openbsd.h.

t/dedupe.c: In function 'main':
t/dedupe.c:583: error: 'RB_ROOT' undeclared (first use in this function)
t/dedupe.c:583: error: (Each undeclared identifier is reported only once
t/dedupe.c:583: error: for each function it appears in.)

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
t/dedupe.c

index c0e9a6953bd501f4d2c635a21bae2b507fd6a39f..1f172a26986231d7f4402d2a76695557523f23bb 100644 (file)
@@ -14,7 +14,6 @@
 #include <fcntl.h>
 #include <string.h>
 
-#include "../lib/rbtree.h"
 #include "../flist.h"
 #include "../log.h"
 #include "../mutex.h"
@@ -25,6 +24,7 @@
 #include "../os/os.h"
 #include "../gettime.h"
 #include "../fio_time.h"
+#include "../lib/rbtree.h"
 
 #include "../lib/bloom.h"
 #include "debug.h"