Fix the build on OpenBSD (#488)

* rocksdb fails without timer_delete() - only use it when it exists
This commit is contained in:
David Carlier 2017-11-13 21:25:30 +00:00 committed by Sergei Golubchik
parent 14c2a9a52e
commit f86413ecc1
3 changed files with 7 additions and 2 deletions

View file

@ -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)

View file

@ -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 {

View file

@ -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;