diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2011-04-20 18:17:25 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2011-04-20 18:17:25 (GMT) |
commit | 27be7d1e2d95618c72bbefbed54e644b3b2d21ae (patch) | |
tree | 340f1389648dbe534a5182edbe32d5a86227f92a /config/cmake/HDF5Tests.c | |
parent | 6b50db00cb90e1bd6854c2713411127161be362d (diff) | |
download | hdf5-27be7d1e2d95618c72bbefbed54e644b3b2d21ae.zip hdf5-27be7d1e2d95618c72bbefbed54e644b3b2d21ae.tar.gz hdf5-27be7d1e2d95618c72bbefbed54e644b3b2d21ae.tar.bz2 |
[svn-r20572] Bug #5929: On windows check for existence of InitOnceExecuteOnce for use by threads.
merge from 1.8 r20568
Diffstat (limited to 'config/cmake/HDF5Tests.c')
-rw-r--r-- | config/cmake/HDF5Tests.c | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/config/cmake/HDF5Tests.c b/config/cmake/HDF5Tests.c index 55e91a4..f580bbc 100644 --- a/config/cmake/HDF5Tests.c +++ b/config/cmake/HDF5Tests.c @@ -327,16 +327,6 @@ int main () #endif /* DEV_T_IS_SCALAR */ -#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) -#ifndef __cplusplus -typedef int foo_t; -static INLINE_TEST_INLINE foo_t static_foo () { return 0; } -INLINE_TEST_INLINE foo_t foo () {return 0; } -int main() { return 0; } -#endif - -#endif /* INLINE_TEST */ - #ifdef HAVE_OFF64_T #include <sys/types.h> int main() @@ -384,21 +374,31 @@ int main () #endif /* HAVE_GPFS */ -#ifdef HAVE_WIN_THREADS +#ifdef HAVE_IOEO #include <windows.h> +typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); 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); + PGNSI pGNSI; + pGNSI = (PGNSI) GetProcAddress( + GetModuleHandle(TEXT("kernel32.dll")), + "InitOnceExecuteOnce"); + if(NULL == pGNSI) + return 1; + else + return 0; } -BOOL CALLBACK -win32_first_thread_init(PINIT_ONCE InitOnce, PVOID Parameter, PVOID *lpContext) -{return TRUE;} -#endif /* HAVE_WIN_THREADS */ +#endif /* HAVE_IOEO */ + +#if defined( INLINE_TEST_inline ) || defined( INLINE_TEST___inline__ ) || defined( INLINE_TEST___inline ) +#ifndef __cplusplus +typedef int foo_t; +static INLINE_TEST_INLINE foo_t static_foo () { return 0; } +INLINE_TEST_INLINE foo_t foo () {return 0; } +int main() { return 0; } +#endif + +#endif /* INLINE_TEST */ |