summaryrefslogtreecommitdiffstats
path: root/src/H5PL.c
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2015-02-22 11:39:08 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2015-02-22 11:39:08 (GMT)
commit85a644221848b047a46bdcff5f3371d690a2f55a (patch)
tree05b3bec8882e5dc6896d641b1edb6d08bca41875 /src/H5PL.c
parent0ecf47141483e63a02f8b2f3b9d9c790a3ff4b63 (diff)
downloadhdf5-85a644221848b047a46bdcff5f3371d690a2f55a.zip
hdf5-85a644221848b047a46bdcff5f3371d690a2f55a.tar.gz
hdf5-85a644221848b047a46bdcff5f3371d690a2f55a.tar.bz2
[svn-r26273] Fixes compile failures when building on Windows when UNICODE is defined.
This was due to wrapping a variable with the TEXT() macro and not forcing the <function>A form of certain Win32 API calls are always used. Although we do not defined UNICODE in our builds, others have encountered problems when building HDF5 as a part of a larger project where UNICODE is defined. Fix for: HDFFV-8927 Tested on: 64-bit Windows 7, Visual Studio 2012, CMake 3.2 All combinations of static/shared and UNICODE defined/undefined NOTE: plugin tests are skipped with static builds
Diffstat (limited to 'src/H5PL.c')
-rw-r--r--src/H5PL.c33
1 files changed, 21 insertions, 12 deletions
diff --git a/src/H5PL.c b/src/H5PL.c
index c178cf8..96a4415 100644
--- a/src/H5PL.c
+++ b/src/H5PL.c
@@ -29,8 +29,6 @@
#include "H5PLprivate.h" /* Plugin */
#include "H5Zprivate.h" /* Filter pipeline */
-#ifndef H5_VMS
-
/****************/
/* Local Macros */
/****************/
@@ -41,7 +39,19 @@
/* Macros for supporting
* 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
#define H5PL_PATH_SEPARATOR ";"
@@ -50,7 +60,7 @@
#define H5PL_HANDLE HINSTANCE
/* 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 */
#define H5PL_GET_LIB_FUNC(H,N) GetProcAddress(H,N)
@@ -458,17 +468,17 @@ done:
static htri_t
H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
{
- WIN32_FIND_DATA fdFile;
- HANDLE hFind;
- char *pathname = NULL;
- char service[2048];
- htri_t ret_value = FALSE;
+ WIN32_FIND_DATAA fdFile;
+ HANDLE hFind;
+ char *pathname = NULL;
+ char service[2048];
+ htri_t ret_value = FALSE;
FUNC_ENTER_STATIC
/* Specify a file mask. *.* = We want everything! */
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")
do {
@@ -499,7 +509,7 @@ H5PL__find(H5PL_type_t plugin_type, int type_id, char *dir, const void **info)
HDassert(pathname);
pathname = (char *)H5MM_xfree(pathname);
} /* end if */
- } while(FindNextFile(hFind, &fdFile)); /* Find the next file. */
+ } while(FindNextFileA(hFind, &fdFile)); /* Find the next file. */
done:
if(hFind)
@@ -669,4 +679,3 @@ H5PL__close(H5PL_HANDLE handle)
FUNC_LEAVE_NOAPI(SUCCEED)
} /* end H5PL__close() */
-#endif /*H5_VMS*/