Skip to content

Commit

Permalink
Enable checking for threads.h
Browse files Browse the repository at this point in the history
Also clean up some warnings in new threadsafe-related macros

Signed-off-by: Quincey Koziol <[email protected]>
  • Loading branch information
qkoziol committed Nov 19, 2024
1 parent e616ecc commit 9ba65be
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,7 @@ if (Threads_FOUND)
# Comment out check for C11 threads for now, since it conflicts with the
# current --std=c99 compile flags at configuration time. When we switch to
# --std=c11, this can be uncommented.
#CHECK_INCLUDE_FILE("threads.h" HAVE_THREADS_H)
CHECK_INCLUDE_FILE("threads.h" HAVE_THREADS_H)
if (WIN32)
# When Win32 is available, we use those threads
set (H5_HAVE_WIN_THREADS 1)
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2237,7 +2237,7 @@ if test "X$THREADS" = "Xyes"; then
# Comment out check for C11 threads for now, since it conflicts with the
# current --std=c99 compile flags at configuration time. When we switch to
# --std=c11, this can be uncommented.
#AC_CHECK_HEADERS([threads.h],[HAVE_THREADS_H="yes"],[HAVE_THREADS_H="no"])
AC_CHECK_HEADERS([threads.h],[HAVE_THREADS_H="yes"],[HAVE_THREADS_H="no"])
if test "x$HAVE_THREADS_H" = "xyes"; then
# Default or no --> C11 threads
if test "$withval" = "default" -o "$withval" = "no" ; then
Expand Down
8 changes: 4 additions & 4 deletions src/H5private.h
Original file line number Diff line number Diff line change
Expand Up @@ -1130,8 +1130,8 @@ extern char H5_lib_vers_info_g[];
#define H5CANCEL_DECL /* */

/* Disable & restore canceling the thread */
#define H5TS_DISABLE_CANCEL /* */
#define H5TS_RESTORE_CANCEL /* */
#define H5TS_DISABLE_CANCEL do {} while(0) /* no-op */
#define H5TS_RESTORE_CANCEL do {} while(0) /* no-op */
#endif

#ifdef H5_HAVE_THREADSAFE
Expand Down Expand Up @@ -1181,8 +1181,8 @@ extern char H5_lib_vers_info_g[];
#define H5DLFTT_DECL /* */

/* No locks (non-threadsafe builds) */
#define H5_API_LOCK /* */
#define H5_API_UNLOCK /* */
#define H5_API_LOCK do {} while(0) /* no-op */
#define H5_API_UNLOCK do {} while(0) /* no-op */

#endif /* H5_HAVE_THREADSAFE_API */

Expand Down

0 comments on commit 9ba65be

Please sign in to comment.