From a835d1e65a3dbae4feca742db93d0b2e1a9ff29c Mon Sep 17 00:00:00 2001 From: Allen Byrne Date: Mon, 11 Apr 2011 15:52:09 -0500 Subject: [svn-r20472] Add message that H5_HAVE_WIN_THREADS requires WINVER >= 0x600 (VISTA or WIN7) --- CMakeLists.txt | 3 ++- config/cmake/H5pubconf.h.in | 3 +++ config/cmake/HDF5Tests.c | 17 +++++++++++++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bfabef..d17ec97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -608,8 +608,9 @@ IF (WIN32 AND NOT CYGWIN) IF (HDF5_ENABLE_PARALLEL) MESSAGE (FATAL " **** Parallel and Threadsafe options are mutually exclusive **** ") ENDIF (HDF5_ENABLE_PARALLEL) - SET (H5_HAVE_WIN_THREADS 1) SET (H5_HAVE_THREADSAFE 1) + SET (H5_HAVE_WIN_THREADS 1) + MESSAGE (STATUS " **** Windows Threads only available in WINVER>=0x600 (Vista or Windows 7)**** ") ENDIF (HDF5_ENABLE_THREADSAFE) ENDIF (WIN32 AND NOT CYGWIN) diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in index 0dbd1ec..cd05639 100644 --- a/config/cmake/H5pubconf.h.in +++ b/config/cmake/H5pubconf.h.in @@ -294,6 +294,9 @@ /* Define to 1 if you have the header file. */ #cmakedefine H5_HAVE_PTHREAD_H @H5_HAVE_PTHREAD_H@ +/* Define to 1 if you have the 'InitOnceExecuteOnce' function. */ +#cmakedefine H5_HAVE_WIN_THREADS @H5_HAVE_WIN_THREADS@ + /* Define to 1 if you have the `random' function. */ #cmakedefine H5_HAVE_RANDOM @H5_HAVE_RANDOM@ diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c index ea4a648..55e91a4 100644 --- a/config/cmake/HDF5Tests.c +++ b/config/cmake/HDF5Tests.c @@ -384,4 +384,21 @@ int main () #endif /* HAVE_GPFS */ +#ifdef HAVE_WIN_THREADS + +#include +int main () +{ + BOOL first_init_g=INIT_ONCE_STATIC_INIT; + BOOL CALLBACK win32_first_thread_init(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContext); + BOOL ret=FALSE; + + ret=InitOnceExecuteOnce(&first_init_g, win32_first_thread_init, NULL, NULL); + exit(ret ? 0 : 1); +} +BOOL CALLBACK +win32_first_thread_init(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContext) +{return TRUE;} + +#endif /* HAVE_WIN_THREADS */ -- cgit v0.12