Skip to content

Commit 058f12a

Browse files
Staticly link the windows jnidispatch.dll when build with MSVC compiler
Without this modification the jnidispatch.dll (when built by MSVC) is dynamicly linked against msvcr100.dll. This requires the corresponding runtime libraries to be installed. Closes: #636
1 parent 6a288ba commit 058f12a

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

Diff for: CHANGES.md

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Bug Fixes
7272
* [#633](https://github.com/java-native-access/jna/pull/633): Restore default usage of platform native encoding for Java strings passed to native functions (was hard-coded to UTF-8 in 4.0 and later) [@amake](https://github.com/amake)
7373
* [#634](https://github.com/java-native-access/jna/pull/634): Improve BSTR handling and add `SysStringByteLen` and `SysStringLen` to `com.sun.jna.platform.win32.OleAuto` - [@matthiasblaesing](https://github.com/matthiasblaesing).
7474
* [#646](https://github.com/java-native-access/jna/issues/646): `platform.win32.COM.COMBindingBaseObject` swallows reason if instantiation fails - [@matthiasblaesing](https://github.com/matthiasblaesing).
75+
* [#636](https://github.com/java-native-access/jna/issues/636); Staticly link visual c++ runtime when building with MSVC - [@matthiasblaesing](https://github.com/matthiasblaesing).
7576

7677
Release 4.2.1
7778
=============

Diff for: lib/native/win32-x86-64.jar

34.5 KB
Binary file not shown.

Diff for: lib/native/win32-x86.jar

31.7 KB
Binary file not shown.

Diff for: native/Makefile

+9-4
Original file line numberDiff line numberDiff line change
@@ -207,19 +207,24 @@ STRIP=@echo
207207
LIBPFX=
208208
LIBSFX=.dll
209209
TESTLIB_TRUNC=$(BUILD)/testlib-truncated.dll
210+
210211
ifeq ($(ARCH),amd64)
211212
MINGW_PREFIX?=x86_64-w64-mingw32-
212213
FFI_CONFIG+=--host=x86_64-w64-mingw32
213-
# Need windres from mingw distribution, even if building with MSVC
214-
WINDRES=$(MINGW_PREFIX)windres
215-
MINGW=$(MINGW_PREFIX)gcc
216214
else
217-
MINGW_PREFIX?=i686-pc-mingw32-
215+
FFI_CONFIG+=--host=i686-w64-mingw32
216+
MINGW_PREFIX?=i686-w64-mingw32-
218217
endif
218+
# Need windres from mingw distribution, even if building with MSVC
219+
WINDRES=$(MINGW_PREFIX)windres
220+
MINGW=$(MINGW_PREFIX)gcc
219221

220222
ifeq ($(USE_MSVC),true)
221223
# MS compiler
222224
CC=$(FFI_SRC)/msvcc.sh
225+
ifneq ($(DYNAMIC_LIBFFI),true)
226+
CDEFINES+=-DUSE_STATIC_RTL
227+
endif
223228
COPT=
224229
CPP=cl -nologo -EP
225230
LD=link

0 commit comments

Comments
 (0)