diff --git a/deps/dablooms/CMakeLists.txt b/deps/dablooms/CMakeLists.txt index e0618d7..f8dee88 100644 --- a/deps/dablooms/CMakeLists.txt +++ b/deps/dablooms/CMakeLists.txt @@ -1,5 +1,5 @@ -add_library(dablooms dablooms.cpp murmur.cpp) +add_library(dablooms dablooms.c murmur.c) target_include_directories(dablooms PUBLIC ${CMAKE_CURRENT_LIST_DIR}) -target_link_libraries(dablooms) +target_link_libraries(dablooms m) add_subdirectory(test) \ No newline at end of file diff --git a/deps/dablooms/dablooms.cpp b/deps/dablooms/dablooms.c similarity index 100% rename from deps/dablooms/dablooms.cpp rename to deps/dablooms/dablooms.c diff --git a/deps/dablooms/murmur.cpp b/deps/dablooms/murmur.c similarity index 91% rename from deps/dablooms/murmur.cpp rename to deps/dablooms/murmur.c index 83baeb4..02e942f 100644 --- a/deps/dablooms/murmur.cpp +++ b/deps/dablooms/murmur.c @@ -92,50 +92,50 @@ void MurmurHash3_x64_128(const void *key, const int len, const uint32_t seed, vo { case 15: k2 ^= ((uint64_t)tail[14]) << 48; - [[fallthrough]]; + /* fallthrough */ case 14: k2 ^= ((uint64_t)tail[13]) << 40; - [[fallthrough]]; + /* fallthrough */ case 13: k2 ^= ((uint64_t)tail[12]) << 32; - [[fallthrough]]; + /* fallthrough */ case 12: k2 ^= ((uint64_t)tail[11]) << 24; - [[fallthrough]]; + /* fallthrough */ case 11: k2 ^= ((uint64_t)tail[10]) << 16; - [[fallthrough]]; + /* fallthrough */ case 10: k2 ^= ((uint64_t)tail[9]) << 8; - [[fallthrough]]; + /* fallthrough */ case 9: k2 ^= ((uint64_t)tail[8]) << 0; k2 *= c2; k2 = ROTL64(k2, 33); k2 *= c1; h2 ^= k2; - [[fallthrough]]; + /* fallthrough */ case 8: k1 ^= ((uint64_t)tail[7]) << 56; - [[fallthrough]]; + /* fallthrough */ case 7: k1 ^= ((uint64_t)tail[6]) << 48; - [[fallthrough]]; + /* fallthrough */ case 6: k1 ^= ((uint64_t)tail[5]) << 40; - [[fallthrough]]; + /* fallthrough */ case 5: k1 ^= ((uint64_t)tail[4]) << 32; - [[fallthrough]]; + /* fallthrough */ case 4: k1 ^= ((uint64_t)tail[3]) << 24; - [[fallthrough]]; + /* fallthrough */ case 3: k1 ^= ((uint64_t)tail[2]) << 16; - [[fallthrough]]; + /* fallthrough */ case 2: k1 ^= ((uint64_t)tail[1]) << 8; - [[fallthrough]]; + /* fallthrough */ case 1: k1 ^= ((uint64_t)tail[0]) << 0; k1 *= c1; diff --git a/deps/dablooms/murmur.h b/deps/dablooms/murmur.h index 6e3c133..f30ac3f 100644 --- a/deps/dablooms/murmur.h +++ b/deps/dablooms/murmur.h @@ -5,8 +5,17 @@ #ifndef _MURMURHASH3_H_ #define _MURMURHASH3_H_ +#ifdef __cplusplus +extern "C" +{ +#endif + #include void MurmurHash3_x64_128(const void *key, int len, uint32_t seed, void *out); +#ifdef __cplusplus +} +#endif + #endif // _MURMURHASH3_H_ diff --git a/deps/interval_tree/CMakeLists.txt b/deps/interval_tree/CMakeLists.txt index 2b297fa..8553f14 100644 --- a/deps/interval_tree/CMakeLists.txt +++ b/deps/interval_tree/CMakeLists.txt @@ -1,4 +1,4 @@ -add_library(interval_tree STATIC interval_tree.cpp) +add_library(interval_tree STATIC interval_tree.c) target_include_directories(interval_tree PUBLIC ${CMAKE_CURRENT_LIST_DIR}) target_include_directories(interval_tree PUBLIC ${CMAKE_SOURCE_DIR}/deps/rbtree) target_link_libraries(interval_tree rbtree) diff --git a/deps/interval_tree/interval_tree.cpp b/deps/interval_tree/interval_tree.c similarity index 100% rename from deps/interval_tree/interval_tree.cpp rename to deps/interval_tree/interval_tree.c diff --git a/deps/interval_tree/interval_tree_generic.h b/deps/interval_tree/interval_tree_generic.h index bf452c8..0c04395 100644 --- a/deps/interval_tree/interval_tree_generic.h +++ b/deps/interval_tree/interval_tree_generic.h @@ -12,6 +12,7 @@ extern "C" { #endif +#include #include "rbtree_augmented.h" /* diff --git a/deps/rbtree/CMakeLists.txt b/deps/rbtree/CMakeLists.txt index c7debda..c67f638 100644 --- a/deps/rbtree/CMakeLists.txt +++ b/deps/rbtree/CMakeLists.txt @@ -1,2 +1,2 @@ -add_library(rbtree STATIC rbtree.cpp) +add_library(rbtree STATIC rbtree.c) target_include_directories(rbtree PUBLIC ${CMAKE_CURRENT_LIST_DIR}) \ No newline at end of file diff --git a/deps/rbtree/rbtree.cpp b/deps/rbtree/rbtree.c similarity index 100% rename from deps/rbtree/rbtree.cpp rename to deps/rbtree/rbtree.c diff --git a/deps/rbtree/rbtree.h b/deps/rbtree/rbtree.h index 3f9b49a..521d652 100644 --- a/deps/rbtree/rbtree.h +++ b/deps/rbtree/rbtree.h @@ -22,6 +22,7 @@ extern "C" { #endif +#include #include struct rb_node diff --git a/deps/timeout/CMakeLists.txt b/deps/timeout/CMakeLists.txt index c105544..af4acd2 100644 --- a/deps/timeout/CMakeLists.txt +++ b/deps/timeout/CMakeLists.txt @@ -1,2 +1,2 @@ -add_library(timeout STATIC timeout.cpp timeout-bitops.cpp) +add_library(timeout STATIC timeout.c timeout-bitops.c) target_include_directories(timeout PUBLIC ${CMAKE_CURRENT_LIST_DIR}) \ No newline at end of file diff --git a/deps/timeout/timeout-bitops.cpp b/deps/timeout/timeout-bitops.c similarity index 100% rename from deps/timeout/timeout-bitops.cpp rename to deps/timeout/timeout-bitops.c diff --git a/deps/timeout/timeout.cpp b/deps/timeout/timeout.c similarity index 99% rename from deps/timeout/timeout.cpp rename to deps/timeout/timeout.c index a2d57b6..d1e76e4 100644 --- a/deps/timeout/timeout.cpp +++ b/deps/timeout/timeout.c @@ -136,7 +136,7 @@ #define WHEEL_MASK (WHEEL_LEN - 1) #define TIMEOUT_MAX ((TIMEOUT_C(1) << (WHEEL_BIT * WHEEL_NUM)) - 1) -#include "timeout-bitops.cpp" +#include "timeout-bitops.c" #if WHEEL_BIT == 6 #define ctz(n) ctz64(n) diff --git a/deps/toml/CMakeLists.txt b/deps/toml/CMakeLists.txt index 4c02fa1..0c77b1d 100644 --- a/deps/toml/CMakeLists.txt +++ b/deps/toml/CMakeLists.txt @@ -1,3 +1,3 @@ -add_library(toml toml.cpp) +add_library(toml toml.c) target_include_directories(toml PUBLIC ${CMAKE_CURRENT_LIST_DIR}) target_link_libraries(toml) \ No newline at end of file diff --git a/deps/toml/toml.cpp b/deps/toml/toml.c similarity index 100% rename from deps/toml/toml.cpp rename to deps/toml/toml.c