Skip to content

Commit

Permalink
Add missing prototypes in ikvm-native.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Rønne Petersen committed Jun 7, 2014
1 parent 1ef4b48 commit 27c5887
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ikvm-native/jni.c
Expand Up @@ -486,18 +486,24 @@ static void* JNIEnv_vtable[] =
0 // jlong JNICALL GetDirectBufferCapacity(jobject buf);
};

JNIEXPORT void** JNICALL ikvm_GetJNIEnvVTable()
void** ikvm_GetJNIEnvVTable(void);

JNIEXPORT void** JNICALL ikvm_GetJNIEnvVTable(void)
{
return JNIEnv_vtable;
}

void* JNICALL ikvm_MarshalDelegate(void* p);

JNIEXPORT void* JNICALL ikvm_MarshalDelegate(void* p)
{
return p;
}

typedef jint (JNICALL *PJNI_ONLOAD)(JavaVM* vm, void* reserved);

jint JNICALL ikvm_CallOnLoad(PJNI_ONLOAD method, JavaVM* vm, void* reserved);

JNIEXPORT jint JNICALL ikvm_CallOnLoad(PJNI_ONLOAD method, JavaVM* vm, void* reserved)
{
return method(vm, reserved);
Expand Down
12 changes: 12 additions & 0 deletions ikvm-native/os.c
Expand Up @@ -61,16 +61,22 @@
#include <sys/mman.h>
#include "jni.h"

void* JNICALL ikvm_LoadLibrary(char* psz);

JNIEXPORT void* JNICALL ikvm_LoadLibrary(char* psz)
{
return g_module_open(psz, 0);
}

void JNICALL ikvm_FreeLibrary(GModule* handle);

JNIEXPORT void JNICALL ikvm_FreeLibrary(GModule* handle)
{
g_module_close(handle);
}

void* JNICALL ikvm_GetProcAddress(GModule* handle, char* name, jint argc);

JNIEXPORT void* JNICALL ikvm_GetProcAddress(GModule* handle, char* name, jint argc)
{
void *symbol;
Expand All @@ -83,16 +89,22 @@
return NULL;
}

void* JNICALL ikvm_mmap(int fd, jboolean writeable, jboolean copy_on_write, jlong position, jint size);

JNIEXPORT void* JNICALL ikvm_mmap(int fd, jboolean writeable, jboolean copy_on_write, jlong position, jint size)
{
return mmap(0, size, writeable ? PROT_WRITE | PROT_READ : PROT_READ, copy_on_write ? MAP_PRIVATE : MAP_SHARED, fd, position);
}

int JNICALL ikvm_munmap(void* address, jint size);

JNIEXPORT int JNICALL ikvm_munmap(void* address, jint size)
{
return munmap(address, size);
}

int JNICALL ikvm_msync(void* address, jint size);

JNIEXPORT int JNICALL ikvm_msync(void* address, jint size)
{
#if defined(__native_client__) && defined(USE_NEWLIB)
Expand Down

0 comments on commit 27c5887

Please sign in to comment.