summaryrefslogtreecommitdiff
path: root/src/mbyte.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-01-24 15:36:03 +0100
committerBram Moolenaar <Bram@vim.org>2016-01-24 15:36:03 +0100
commit938ee834d345062cd94f8fdfd54fad0019432a83 (patch)
tree7f5197eb27ce7d78484487fdd79ccaab6640352c /src/mbyte.c
parent6039c7f05376f0e470cf62bf2757e653aea357f3 (diff)
downloadvim-git-938ee834d345062cd94f8fdfd54fad0019432a83.tar.gz
patch 7.4.1165v7.4.1165
Problem: When defining DYNAMIC_ICONV_DLL in the makefile, the build fails. Solution: Add #ifdef's. (Taro Muraoka) Try the newer version first.
Diffstat (limited to 'src/mbyte.c')
-rw-r--r--src/mbyte.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/mbyte.c b/src/mbyte.c
index edca9a709..0e4b7e495 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -4392,21 +4392,21 @@ iconv_string(vcp, str, slen, unconvlenp, resultlenp)
* Dynamically load the "iconv.dll" on Win32.
*/
-#ifndef DYNAMIC_ICONV /* just generating prototypes */
-# define HINSTANCE int
-#endif
+# ifndef DYNAMIC_ICONV /* must be generating prototypes */
+# define HINSTANCE int
+# endif
static HINSTANCE hIconvDLL = 0;
static HINSTANCE hMsvcrtDLL = 0;
-# ifndef DYNAMIC_ICONV_DLL
-# define DYNAMIC_ICONV_DLL "iconv.dll"
-# define DYNAMIC_ICONV_DLL_ALT1 "libiconv.dll"
-# define DYNAMIC_ICONV_DLL_ALT2 "libiconv2.dll"
-# define DYNAMIC_ICONV_DLL_ALT3 "libiconv-2.dll"
-# endif
-# ifndef DYNAMIC_MSVCRT_DLL
-# define DYNAMIC_MSVCRT_DLL "msvcrt.dll"
-# endif
+# ifndef DYNAMIC_ICONV_DLL
+# define DYNAMIC_ICONV_DLL "iconv.dll"
+# define DYNAMIC_ICONV_DLL_ALT1 "libiconv.dll"
+# define DYNAMIC_ICONV_DLL_ALT2 "libiconv2.dll"
+# define DYNAMIC_ICONV_DLL_ALT3 "libiconv-2.dll"
+# endif
+# ifndef DYNAMIC_MSVCRT_DLL
+# define DYNAMIC_MSVCRT_DLL "msvcrt.dll"
+# endif
/*
* Get the address of 'funcname' which is imported by 'hInst' DLL.
@@ -4459,14 +4459,22 @@ iconv_enabled(verbose)
if (hIconvDLL != 0 && hMsvcrtDLL != 0)
return TRUE;
- /* The iconv DLL file goes under different names, try them all. */
- hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL);
- if (hIconvDLL == 0)
- hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL_ALT1);
+ /* The iconv DLL file goes under different names, try them all.
+ * Do the "2" version first, it's newer. */
+#ifdef DYNAMIC_ICONV_DLL_ALT2
if (hIconvDLL == 0)
hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL_ALT2);
+#endif
+#ifdef DYNAMIC_ICONV_DLL_ALT3
if (hIconvDLL == 0)
hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL_ALT3);
+#endif
+ if (hIconvDLL == 0)
+ hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL);
+#ifdef DYNAMIC_ICONV_DLL_ALT1
+ if (hIconvDLL == 0)
+ hIconvDLL = vimLoadLib(DYNAMIC_ICONV_DLL_ALT1);
+#endif
if (hIconvDLL != 0)
hMsvcrtDLL = vimLoadLib(DYNAMIC_MSVCRT_DLL);