Skip to content

Commit

Permalink
java: prefix C exports with evmc_java_
Browse files Browse the repository at this point in the history
Similarly to how we prefix with evmc_go_ in the go bindings.
  • Loading branch information
axic committed May 12, 2020
1 parent baca056 commit d4a3acf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions bindings/java/c/evmc-vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ JNIEXPORT jobject JNICALL Java_org_ethereum_evmc_EvmcVm_init(JNIEnv* jenv,
{
(void)jcls;
struct evmc_vm* evm = NULL;
jint rs = set_jvm(jenv);
jint rs = evmc_java_set_jvm(jenv);
(void)rs;
assert(rs == JNI_OK);
// load the EVM
Expand Down Expand Up @@ -101,7 +101,7 @@ JNIEXPORT void JNICALL Java_org_ethereum_evmc_EvmcVm_execute(JNIEnv* jenv,
struct evmc_host_context context = {jcontext_index};
struct evmc_vm* evm = (struct evmc_vm*)(*jenv)->GetDirectBufferAddress(jenv, jevm);
assert(evm != NULL);
const struct evmc_host_interface* host = get_host_interface();
const struct evmc_host_interface* host = evmc_java_get_host_interface();
struct evmc_result* result =
(struct evmc_result*)(*jenv)->GetDirectBufferAddress(jenv, jresult);
assert(result != NULL);
Expand Down
4 changes: 2 additions & 2 deletions bindings/java/c/host.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

static JavaVM* jvm;

int set_jvm(JNIEnv* jenv)
int evmc_java_set_jvm(JNIEnv* jenv)
{
return (*jenv)->GetJavaVM(jenv, &jvm);
}
Expand Down Expand Up @@ -532,7 +532,7 @@ static void emit_log_fn(struct evmc_host_context* context,
return;
}

const struct evmc_host_interface* get_host_interface()
const struct evmc_host_interface* evmc_java_get_host_interface()
{
static const struct evmc_host_interface host = {
account_exists_fn, get_storage_fn, set_storage_fn, get_balance_fn,
Expand Down
4 changes: 2 additions & 2 deletions bindings/java/c/host.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ struct evmc_host_context
int index;
};

int set_jvm(JNIEnv*);
const struct evmc_host_interface* get_host_interface();
int evmc_java_set_jvm(JNIEnv*);
const struct evmc_host_interface* evmc_java_get_host_interface();

#ifdef __cplusplus
}
Expand Down

0 comments on commit d4a3acf

Please sign in to comment.