patch 8.2.4144: cannot load libsodium dynamically
Problem: Cannot load libsodium dynamically.
Solution: Support dynamic loading on MS-Windows. (Ken Takata, closes #9554)
diff --git a/src/Make_mvc.mak b/src/Make_mvc.mak
index b33d24b..6889a91 100644
--- a/src/Make_mvc.mak
+++ b/src/Make_mvc.mak
@@ -42,10 +42,10 @@
# Sound support: SOUND=yes (default is yes)
#
# Sodium support: SODIUM=[Path to Sodium directory]
-# Dynamic built with libsodium
-# You need to install the msvc package from
-# https://download.libsodium.org/libsodium/releases/
-# and package the libsodium.dll with Vim
+# DYNAMIC_SODIUM=yes (to load the Sodium DLL dynamically)
+# You need to install the msvc package from
+# https://download.libsodium.org/libsodium/releases/
+# and package the libsodium.dll with Vim
#
#
# DLL support (EXPERIMENTAL): VIMDLL=yes (default is no)
@@ -384,6 +384,9 @@
!ifndef SODIUM
SODIUM = no
!endif
+!ifndef DYNAMIC_SODIUM
+DYNAMIC_SODIUM = yes
+!endif
!if "$(SODIUM)" != "no"
! if "$(CPU)" == "AMD64"
@@ -397,8 +400,13 @@
!if "$(SODIUM)" != "no"
SOD_INC = /I "$(SODIUM)\include"
+! if "$(DYNAMIC_SODIUM)" == "yes"
+SOD_DEFS = -DHAVE_SODIUM -DDYNAMIC_SODIUM
+SOD_LIB =
+! else
SOD_DEFS = -DHAVE_SODIUM
SOD_LIB = $(SOD_LIB)\libsodium.lib
+! endif
!endif
!ifndef NETBEANS