summaryrefslogtreecommitdiffstats
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rwxr-xr-xmake/dynlink-unix-CustomJavaCode.java2
-rwxr-xr-xmake/dynlink-windows-CustomJavaCode.java4
-rwxr-xr-xmake/dynlink-windows.cfg21
-rwxr-xr-xmake/stub_includes/windows/dynamic-linker.h5
4 files changed, 19 insertions, 13 deletions
diff --git a/make/dynlink-unix-CustomJavaCode.java b/make/dynlink-unix-CustomJavaCode.java
index 36a1603..5d10edf 100755
--- a/make/dynlink-unix-CustomJavaCode.java
+++ b/make/dynlink-unix-CustomJavaCode.java
@@ -6,7 +6,7 @@ public long openLibrary(String pathname) {
// other words, one can actually link against the library instead of
// having to dlsym all entry points. System.loadLibrary() uses
// RTLD_LOCAL visibility so can't be used for this purpose.
- return dlopen(pathname, RTLD_GLOBAL);
+ return dlopen(pathname, RTLD_LAZY | RTLD_GLOBAL);
}
public long lookupSymbol(long libraryHandle, String symbolName) {
diff --git a/make/dynlink-windows-CustomJavaCode.java b/make/dynlink-windows-CustomJavaCode.java
index 986ec81..4101f4c 100755
--- a/make/dynlink-windows-CustomJavaCode.java
+++ b/make/dynlink-windows-CustomJavaCode.java
@@ -1,9 +1,9 @@
public long openLibrary(String libraryName) {
- return LoadLibraryA(libraryName);
+ return LoadLibraryW(libraryName);
}
public long lookupSymbol(long libraryHandle, String symbolName) {
- return GetProcAddress(libraryHandle, symbolName);
+ return GetProcAddressA(libraryHandle, symbolName);
}
public void closeLibrary(long libraryHandle) {
diff --git a/make/dynlink-windows.cfg b/make/dynlink-windows.cfg
index 871326e..fe69e1c 100755
--- a/make/dynlink-windows.cfg
+++ b/make/dynlink-windows.cfg
@@ -8,18 +8,23 @@ HierarchicalNativeOutput false
IncludeAs CustomJavaCode WindowsDynamicLinkerImpl dynlink-windows-CustomJavaCode.java
CustomCCode #include <windows.h>
-CustomCCode /* This typedef is only needed for VC6 */
-CustomCCode #if _MSC_VER <= 1200
+CustomCCode /* This typedef is apparently needed for compilers before VC8,
+CustomCCode and for the embedded ARM compilers we're using */
+CustomCCode #if (_MSC_VER < 1400) || defined(UNDER_CE)
CustomCCode typedef int intptr_t;
CustomCCode #endif
+CustomCCode /* GetProcAddress doesn't exist in A/W variants under desktop Windows */
+CustomCCode #ifndef UNDER_CE
+CustomCCode #define GetProcAddressA GetProcAddress
+CustomCCode #endif
-ArgumentIsString LoadLibraryA 0
-ArgumentIsString GetProcAddress 1
+ArgumentIsString LoadLibraryW 0
+ArgumentIsString GetProcAddressA 1
Opaque long HANDLE
Opaque long PROC
# Hide the platform-specific functions
-AccessControl GetLastError PRIVATE
-AccessControl LoadLibraryA PRIVATE
-AccessControl GetProcAddress PRIVATE
-AccessControl FreeLibrary PRIVATE
+AccessControl GetLastError PRIVATE
+AccessControl LoadLibraryW PRIVATE
+AccessControl GetProcAddressA PRIVATE
+AccessControl FreeLibrary PRIVATE
diff --git a/make/stub_includes/windows/dynamic-linker.h b/make/stub_includes/windows/dynamic-linker.h
index e8a8bd5..1b06902 100755
--- a/make/stub_includes/windows/dynamic-linker.h
+++ b/make/stub_includes/windows/dynamic-linker.h
@@ -17,6 +17,7 @@ typedef struct _handle* HANDLE;
typedef HANDLE HMODULE;
typedef long LONG;
typedef const char* LPCSTR;
+typedef const short* LPCWSTR;
typedef void* LPVOID;
typedef struct _proc* PROC;
typedef unsigned int* PUINT;
@@ -26,6 +27,6 @@ typedef unsigned short WORD;
// Dynamic loading routines
WINBASEAPI DWORD WINAPI GetLastError(VOID);
-WINBASEAPI HMODULE WINAPI LoadLibraryA(LPCSTR lpLibFileName);
-WINBASEAPI PROC WINAPI GetProcAddress(HMODULE hModule, LPCSTR lpProcName);
+WINBASEAPI HMODULE WINAPI LoadLibraryW(LPCWSTR lpLibFileName);
+WINBASEAPI PROC WINAPI GetProcAddressA(HMODULE hModule, LPCSTR lpProcName);
WINBASEAPI BOOL WINAPI FreeLibrary(HMODULE hLibModule);