mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 7.4.1383
Problem: GvimExt only loads the old libintl.dll. Solution: Also try loading libint-8.dll. (Ken Takata, closes #608)
This commit is contained in:
@@ -158,6 +158,7 @@ HBITMAP IconToBitmap(HICON hIcon, HBRUSH hBackground, int width, int height)
|
|||||||
# define VIMPACKAGE "vim"
|
# define VIMPACKAGE "vim"
|
||||||
# ifndef GETTEXT_DLL
|
# ifndef GETTEXT_DLL
|
||||||
# define GETTEXT_DLL "libintl.dll"
|
# define GETTEXT_DLL "libintl.dll"
|
||||||
|
# define GETTEXT_DLL_ALT "libintl-8.dll"
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
// Dummy functions
|
// Dummy functions
|
||||||
@@ -194,21 +195,36 @@ dyn_libintl_init(char *dir)
|
|||||||
{(char *)"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain},
|
{(char *)"bindtextdomain", (FARPROC*)&dyn_libintl_bindtextdomain},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
DWORD len, len2;
|
||||||
|
LPWSTR buf = NULL;
|
||||||
|
LPWSTR buf2 = NULL;
|
||||||
|
|
||||||
// No need to initialize twice.
|
// No need to initialize twice.
|
||||||
if (hLibintlDLL)
|
if (hLibintlDLL)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
// Load gettext library, first try the Vim runtime directory, then search
|
// Load gettext library from the Vim runtime directory.
|
||||||
// the path.
|
// Add the directory to $PATH temporarily.
|
||||||
strcat(dir, GETTEXT_DLL);
|
len = GetEnvironmentVariableW(L"PATH", NULL, 0);
|
||||||
hLibintlDLL = LoadLibrary(dir);
|
len2 = MAX_PATH + 1 + len;
|
||||||
if (!hLibintlDLL)
|
buf = (LPWSTR)malloc(len * sizeof(WCHAR));
|
||||||
|
buf2 = (LPWSTR)malloc(len2 * sizeof(WCHAR));
|
||||||
|
if (buf != NULL && buf2 != NULL)
|
||||||
{
|
{
|
||||||
|
GetEnvironmentVariableW(L"PATH", buf, len);
|
||||||
|
_snwprintf(buf2, len2, L"%S;%s", dir, buf);
|
||||||
|
SetEnvironmentVariableW(L"PATH", buf2);
|
||||||
hLibintlDLL = LoadLibrary(GETTEXT_DLL);
|
hLibintlDLL = LoadLibrary(GETTEXT_DLL);
|
||||||
|
#ifdef GETTEXT_DLL_ALT
|
||||||
|
if (!hLibintlDLL)
|
||||||
|
hLibintlDLL = LoadLibrary(GETTEXT_DLL_ALT);
|
||||||
|
#endif
|
||||||
|
SetEnvironmentVariableW(L"PATH", buf);
|
||||||
|
}
|
||||||
|
free(buf);
|
||||||
|
free(buf2);
|
||||||
if (!hLibintlDLL)
|
if (!hLibintlDLL)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
|
||||||
|
|
||||||
// Get the addresses of the functions we need.
|
// Get the addresses of the functions we need.
|
||||||
for (i = 0; libintl_entry[i].name != NULL
|
for (i = 0; libintl_entry[i].name != NULL
|
||||||
|
@@ -42,6 +42,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
#include <shlobj.h>
|
#include <shlobj.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
/* Accommodate old versions of VC that don't have a modern Platform SDK */
|
/* Accommodate old versions of VC that don't have a modern Platform SDK */
|
||||||
#if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR)
|
#if (defined(_MSC_VER) && _MSC_VER < 1300) || !defined(MAXULONG_PTR)
|
||||||
|
@@ -747,6 +747,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
1383,
|
||||||
/**/
|
/**/
|
||||||
1382,
|
1382,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user