* src/native/vm/openjdk/jvm.cpp (JVM_RawMonitorCreate): Use Mutex
[cacao.git] / src / native / vm / openjdk / hpi.c
index fad4d264678b064a09c22a2e3382b9dd39da4ed3..3f4eeb7d9ae50e7ca94e11a17bf0e7b816f1a8d3 100644 (file)
 
 #include "config.h"
 
-/* We include hpi_md.h before hpi.h as the latter includes the
-   former. */
+// Include our JNI header before the HPI headers, because the HPI
+// headers include jni.h and we want to override the typedefs in
+// jni.h.
+#include "native/jni.hpp"
 
+// We include hpi_md.h before hpi.h as the latter includes the former.
 #include INCLUDE_HPI_MD_H
 #include INCLUDE_HPI_H
 
 #include "mm/memory.h"
 
-#include "native/jni.h"
-#include "native/native.h"
+#include "native/native.hpp"
 
 #include "native/vm/openjdk/hpi.h"
 
-#include "vm/properties.h"
+#include "vm/options.h"
+#include "vm/os.hpp"
+#include "vm/properties.hpp"
+#include "vm/utf8.h"
 #include "vm/vm.hpp"
 
-#include "vmcore/options.h"
-#include "vmcore/system.h"
-#include "vmcore/utf8.h"
-
 
 /* VM callback functions ******************************************************/
 
@@ -94,17 +95,17 @@ void hpi_initialize(void)
 
        /* Load libhpi.so */
 
-       boot_library_path = properties_get("sun.boot.library.path");
+       boot_library_path = Properties_get("sun.boot.library.path");
 
        len =
-               system_strlen(boot_library_path) +
-               system_strlen("/native_threads/libhpi.so") +
-               system_strlen("0");
+               os_strlen(boot_library_path) +
+               os_strlen("/native_threads/libhpi.so") +
+               os_strlen("0");
 
        p = MNEW(char, len);
 
-       system_strcpy(p, boot_library_path);
-       system_strcat(p, "/native_threads/libhpi.so");
+       os_strcpy(p, boot_library_path);
+       os_strcat(p, "/native_threads/libhpi.so");
 
        u = utf_new_char(p);
 
@@ -121,13 +122,12 @@ void hpi_initialize(void)
 
        /* Resolve the DLL_Initialize function from the library. */
 
-       dll_initialize = system_dlsym(handle, "DLL_Initialize");
+       dll_initialize = os_dlsym(handle, "DLL_Initialize");
 
     DLL_Initialize = (jint (JNICALL *)(GetInterfaceFunc *, void *)) (intptr_t) dll_initialize;
 
     if (opt_TraceHPI && DLL_Initialize == NULL)
-               log_println("hpi_init: HPI dlsym of DLL_Initialize failed: %s",
-                                       system_dlerror());
+               log_println("hpi_init: HPI dlsym of DLL_Initialize failed: %s", os_dlerror());
 
     if (DLL_Initialize == NULL ||
         (*DLL_Initialize)(&hpi_get_interface, &callbacks) < 0) {