mirror of
https://github.com/HDFGroup/hdf5.git
synced 2025-01-24 15:25:00 +08:00
[svn-r26216] Removed inappropriate TEXT() macro from the plugin name and changed a few Win32 API calls to use the <function>A version, which forces char behavior (vs. wchar_t) when UNICODE is defined. This only affects Windows.
Fixes HDFFV-8927 Tested on 64-bit Windows 7 with Visual Studio 2012 and CMake 3.2 with UNICODE/_UNICODE both defined and undefined.
This commit is contained in:
parent
27a385d557
commit
c3385d9010
22
src/H5PL.c
22
src/H5PL.c
@ -40,7 +40,19 @@
|
|||||||
/* Macros for supporting
|
/* Macros for supporting
|
||||||
* both Windows and Unix */
|
* both Windows and Unix */
|
||||||
/****************************/
|
/****************************/
|
||||||
/* Windows support */
|
/* Windows support
|
||||||
|
*
|
||||||
|
* SPECIAL WINDOWS NOTE
|
||||||
|
*
|
||||||
|
* Some of the Win32 API functions expand to fooA or fooW depending on
|
||||||
|
* whether UNICODE or _UNICODE are defined. You MUST explicitly use
|
||||||
|
* the A version of the functions to force char * behavior until we
|
||||||
|
* work out a scheme for proper Windows Unicode support.
|
||||||
|
*
|
||||||
|
* If you do not do this, people will be unable to incorporate our
|
||||||
|
* source code into their own CMake builds if they define UNICODE.
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef H5_HAVE_WIN32_API
|
#ifdef H5_HAVE_WIN32_API
|
||||||
|
|
||||||
#define H5PL_PATH_SEPARATOR ";"
|
#define H5PL_PATH_SEPARATOR ";"
|
||||||
@ -49,7 +61,7 @@
|
|||||||
#define H5PL_HANDLE HINSTANCE
|
#define H5PL_HANDLE HINSTANCE
|
||||||
|
|
||||||
/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */
|
/* Get a handle to a plugin library. Windows: TEXT macro handles Unicode strings */
|
||||||
#define H5PL_OPEN_DLIB(S) LoadLibraryEx(TEXT(S), NULL, LOAD_WITH_ALTERED_SEARCH_PATH)
|
#define H5PL_OPEN_DLIB(S) LoadLibraryExA(S, NULL, LOAD_WITH_ALTERED_SEARCH_PATH)
|
||||||
|
|
||||||
/* Get the address of a symbol in dynamic library */
|
/* Get the address of a symbol in dynamic library */
|
||||||
#define H5PL_GET_LIB_FUNC(H,N) GetProcAddress(H,N)
|
#define H5PL_GET_LIB_FUNC(H,N) GetProcAddress(H,N)
|
||||||
@ -457,7 +469,7 @@ done:
|
|||||||
static htri_t
|
static htri_t
|
||||||
H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
|
H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
|
||||||
{
|
{
|
||||||
WIN32_FIND_DATA fdFile;
|
WIN32_FIND_DATAA fdFile;
|
||||||
HANDLE hFind;
|
HANDLE hFind;
|
||||||
char *pathname = NULL;
|
char *pathname = NULL;
|
||||||
char service[2048];
|
char service[2048];
|
||||||
@ -467,7 +479,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
|
|||||||
|
|
||||||
/* Specify a file mask. *.* = We want everything! */
|
/* Specify a file mask. *.* = We want everything! */
|
||||||
sprintf(service, "%s\\*.dll", dir);
|
sprintf(service, "%s\\*.dll", dir);
|
||||||
if((hFind = FindFirstFile(service, &fdFile)) == INVALID_HANDLE_VALUE)
|
if((hFind = FindFirstFileA(service, &fdFile)) == INVALID_HANDLE_VALUE)
|
||||||
HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory")
|
HGOTO_ERROR(H5E_PLUGIN, H5E_OPENERROR, FAIL, "can't open directory")
|
||||||
|
|
||||||
do {
|
do {
|
||||||
@ -498,7 +510,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
|
|||||||
HDassert(pathname);
|
HDassert(pathname);
|
||||||
pathname = (char *)H5MM_xfree(pathname);
|
pathname = (char *)H5MM_xfree(pathname);
|
||||||
} /* end if */
|
} /* end if */
|
||||||
} while(FindNextFile(hFind, &fdFile)); /* Find the next file. */
|
} while(FindNextFileA(hFind, &fdFile)); /* Find the next file. */
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if(hFind)
|
if(hFind)
|
||||||
|
Loading…
Reference in New Issue
Block a user