* configure.ac (AC_CHECK_HEADERS): Added signal.h.
[cacao.git] / src / native / vm / openjdk / hpi.c
index 87f0a7d4059e6beb222458cd3cb9ae0970ac9f06..7b89c594ae59419cf60009127e22c412e62c7e87 100644 (file)
 #include "native/jni.h"
 #include "native/native.h"
 
-#include "vm/properties.h"
-#include "vm/vm.h"
+#include "native/vm/openjdk/hpi.h"
 
-#include "vmcore/options.h"
-#include "vmcore/system.h"
-#include "vmcore/utf8.h"
+#include "vm/options.h"
+#include "vm/os.hpp"
+#include "vm/properties.h"
+#include "vm/utf8.h"
+#include "vm/vm.hpp"
 
 
 /* VM callback functions ******************************************************/
@@ -78,13 +79,14 @@ HPI_SystemInterface  *hpi_system        = NULL;
 
 void hpi_initialize(void)
 {
-       char        *boot_library_path;
-       int          len;
-       char        *p;
-       utf         *u;
-       lt_dlhandle  handle;
-       lt_ptr       dll_initialize;
-       int          result;
+       const char* boot_library_path;
+       int   len;
+       char* p;
+       utf*  u;
+       void* handle;
+       void* dll_initialize;
+       int   result;
+
     jint (JNICALL * DLL_Initialize)(GetInterfaceFunc *, void *);
 
        TRACESUBSYSTEMINITIALIZATION("hpi_init");
@@ -94,14 +96,14 @@ void hpi_initialize(void)
        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);
 
@@ -118,12 +120,12 @@ void hpi_initialize(void)
 
        /* Resolve the DLL_Initialize function from the library. */
 
-       dll_initialize = lt_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", lt_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) {