Skip to content

Commit

Permalink
Provide missing Java 9+ support in JvmFuncs for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
olpaw committed Nov 4, 2019
1 parent b823858 commit 413730e
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions substratevm/mx.substratevm/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@
"subDir": "src",
"native": "static_lib",
"deliverable" : "jvm",
"use_jdk_headers" : True,
"os_arch" : {
"windows": {
"amd64" : {
Expand Down
36 changes: 36 additions & 0 deletions substratevm/src/com.oracle.svm.native.jvm.windows/src/JvmFuncs.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
#include <windows.h>
#include <errno.h>

#include <jni.h>

#define JNIEXPORT __declspec(dllexport)
#define JNIIMPORT __declspec(dllimport)

Expand Down Expand Up @@ -159,6 +161,9 @@ JNIEXPORT jlong JVM_CurrentTimeMillis(void *env, void * ignored) {
return Java_java_lang_System_currentTimeMillis(env, ignored);
}

JNIEXPORT void JVM_BeforeHalt() {
}

JNIEXPORT void JVM_Halt(int retcode) {
_exit(retcode);
}
Expand Down Expand Up @@ -217,3 +222,34 @@ int jio_vsnprintf(char *str, size_t count, const char *fmt, va_list args) {
return result;
}

#ifdef JNI_VERSION_9
JNIEXPORT void JVM_AddModuleExports(JNIEnv *env, jobject from_module, const char* package, jobject to_module) {
fprintf(stderr, "JVM_AddModuleExports called\n");
}

JNIEXPORT void JVM_AddModuleExportsToAllUnnamed(JNIEnv *env, jobject from_module, const char* package) {
fprintf(stderr, "JVM_AddModuleExportsToAllUnnamed called\n");
}

JNIEXPORT void JVM_AddModuleExportsToAll(JNIEnv *env, jobject from_module, const char* package) {
fprintf(stderr, "JVM_AddModuleExportsToAll called\n");
}

JNIEXPORT void JVM_AddReadsModule(JNIEnv *env, jobject from_module, jobject source_module) {
fprintf(stderr, "JVM_AddReadsModule called\n");
}

JNIEXPORT void JVM_DefineModule(JNIEnv *env, jobject module, jboolean is_open, jstring version,
jstring location, const char* const* packages, jsize num_packages) {
fprintf(stderr, "JVM_DefineModule called\n");
}

int jio_snprintf(char *str, size_t count, const char *fmt, ...) {
va_list args;
int len;
va_start(args, fmt);
len = jio_vsnprintf(str, count, fmt, args);
va_end(args);
return len;
}
#endif

0 comments on commit 413730e

Please sign in to comment.