Skip to content

Commit f86413e

Browse files
devnexenvuvova
authored andcommitted
Fix the build on OpenBSD (#488)
* rocksdb fails without timer_delete() - only use it when it exists
1 parent 14c2a9a commit f86413e

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

storage/rocksdb/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ IF (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/Makefile")
99
SKIP_ROCKSDB_PLUGIN("Missing Makefile in rocksdb directory. Try \"git submodule update\".")
1010
ENDIF()
1111

12+
CHECK_LIBRARY_EXISTS(rt timer_delete "" HAVE_TIMER_DELETE)
13+
IF (HAVE_TIMER_DELETE)
14+
ADD_DEFINITIONS(-DHAVE_TIMER_DELETE)
15+
ENDIF(HAVE_TIMER_DELETE)
16+
1217
CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
1318
IF(HAVE_SCHED_GETCPU)
1419
ADD_DEFINITIONS(-DHAVE_SCHED_GETCPU=1 -DROCKSDB_SCHED_GETCPU_PRESENT)

storage/rocksdb/rdb_io_watchdog.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#include <vector>
2323

2424
/* Rdb_io_watchdog doesn't work on Windows [yet] */
25-
#if !defined(_WIN32) && !defined(__APPLE__)
25+
#ifdef HAVE_TIMER_DELETE
2626

2727
namespace myrocks {
2828

storage/rocksdb/rdb_io_watchdog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
namespace myrocks {
3636

3737
// Rdb_io_watchdog does not support Windows ATM.
38-
#if !defined(_WIN32) && !defined(__APPLE__)
38+
#ifdef HAVE_TIMER_DELETE
3939

4040
class Rdb_io_watchdog {
4141
const int RDB_IO_WRITE_BUFFER_SIZE = 4096;

0 commit comments

Comments
 (0)