Skip to content
Permalink
Browse files
Fix the build on OpenBSD (#488)
* rocksdb fails without timer_delete() - only use it when it exists
  • Loading branch information
devnexen authored and vuvova committed Nov 22, 2017
1 parent 14c2a9a commit f86413e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
@@ -9,6 +9,11 @@ IF (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/rocksdb/Makefile")
SKIP_ROCKSDB_PLUGIN("Missing Makefile in rocksdb directory. Try \"git submodule update\".")
ENDIF()

CHECK_LIBRARY_EXISTS(rt timer_delete "" HAVE_TIMER_DELETE)
IF (HAVE_TIMER_DELETE)
ADD_DEFINITIONS(-DHAVE_TIMER_DELETE)
ENDIF(HAVE_TIMER_DELETE)

CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
IF(HAVE_SCHED_GETCPU)
ADD_DEFINITIONS(-DHAVE_SCHED_GETCPU=1 -DROCKSDB_SCHED_GETCPU_PRESENT)
@@ -22,7 +22,7 @@
#include <vector>

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

namespace myrocks {

@@ -35,7 +35,7 @@
namespace myrocks {

// Rdb_io_watchdog does not support Windows ATM.
#if !defined(_WIN32) && !defined(__APPLE__)
#ifdef HAVE_TIMER_DELETE

class Rdb_io_watchdog {
const int RDB_IO_WRITE_BUFFER_SIZE = 4096;

0 comments on commit f86413e

Please sign in to comment.