Skip to content

Commit

Permalink
[build] Fix platform-related codes
Browse files Browse the repository at this point in the history
  • Loading branch information
masteryhx committed Apr 9, 2024
1 parent 5d70ad0 commit a9f4b16
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -728,6 +728,10 @@ set(SOURCES
env/fs_remap.cc
env/mock_env.cc
env/unique_id_gen.cc
env/flink/env_flink.cc
env/flink/jvm_util.cc
env/flink/jni_helper.cc
env/flink/env_flink_test_suite.cc
file/delete_scheduler.cc
file/file_prefetch_buffer.cc
file/file_util.cc
Expand Down Expand Up @@ -1016,11 +1020,7 @@ else()
port/port_posix.cc
env/env_posix.cc
env/fs_posix.cc
env/io_posix.cc
env/flink/env_flink.cc
env/flink/jvm_util.cc
env/flink/jni_helper.cc
env/flink/env_flink_test_suite.cc)
env/io_posix.cc)
endif()

if(USE_FOLLY_LITE)
Expand Down
8 changes: 4 additions & 4 deletions env/flink/jvm_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

#include "env/flink/jvm_util.h"

#define UNUSED(x) (void)(x)
#define UNUSED_JNI_PARAMETER(x) (void)(x)

namespace ROCKSDB_NAMESPACE {

std::atomic<JavaVM*> jvm_ = std::atomic<JavaVM*>(nullptr);

JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) {
UNUSED(reserved);
UNUSED_JNI_PARAMETER(reserved);
JNIEnv* env = nullptr;
if (vm->GetEnv((void**)&env, JNI_VERSION_1_8) != JNI_OK) {
return -1;
Expand All @@ -36,8 +36,8 @@ JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM* vm, void* reserved) {
}

JNIEXPORT void JNICALL JNI_OnUnload(JavaVM* vm, void* reserved) {
UNUSED(vm);
UNUSED(reserved);
UNUSED_JNI_PARAMETER(vm);
UNUSED_JNI_PARAMETER(reserved);
jvm_.store(nullptr);
}

Expand Down
3 changes: 1 addition & 2 deletions java/rocksjni/env_flink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@

#include <jni.h>

#include <vector>

#include "include/org_rocksdb_FlinkEnv.h"
#include "java/rocksjni/portal.h"
#include "rocksdb/env.h"

Expand Down

0 comments on commit a9f4b16

Please sign in to comment.