From 25ba47bc97bd7dd3f9f9ee0c13d04c1ea041dd7b Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 13 Jun 2014 03:44:34 -0500 Subject: [svn-r25274] Adds #defines that ensures that DllMain is only compiled in when the thread-safe shared library is built on Windows. Fixes HDFFV-8837. Tested on 64-bit Windows 7 with VS2012. --- src/H5.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/H5.c b/src/H5.c index 9ece760..af8b668 100644 --- a/src/H5.c +++ b/src/H5.c @@ -842,7 +842,8 @@ H5free_memory(void *mem) } /* end H5free_memory() */ -#ifdef H5_HAVE_WIN32_API +#if defined(H5_HAVE_THREADSAFE) && defined(H5_BUILT_AS_DYNAMIC_LIB) \ + && defined(H5_HAVE_WIN32_API) && defined(H5_HAVE_WIN_THREADS) /*------------------------------------------------------------------------- * Function: DllMain * @@ -851,6 +852,9 @@ H5free_memory(void *mem) * NOTE: The main purpose of this is for handling Win32 thread cleanup * on thread/process detach. * + * Only enabled when the shared Windows library is built with + * thread safety enabled. + * * Return: TRUE on success, FALSE on failure * *------------------------------------------------------------------------- @@ -897,4 +901,4 @@ DllMain(_In_ HINSTANCE hinstDLL, _In_ DWORD fdwReason, _In_ LPVOID lpvReserved) return fOkay; } -#endif /* H5_HAVE_WIN32_API */ +#endif /* H5_HAVE_WIN32_API && H5_BUILT_AS_DYNAMIC_LIB && H5_HAVE_WIN_THREADS && H5_HAVE_THREADSAFE*/ -- cgit v0.12