From 39fd512fe7475590598541e494d4cef82c452ac8 Mon Sep 17 00:00:00 2001 From: David Young Date: Fri, 7 Feb 2020 14:57:46 -0600 Subject: Make sure that H5TS_thread_id() is available as either a function or a macro in all configurations. Previously it was neither declared nor defined in --disable-threadsafety builds. The compiler's warning got lost in the noise---I first saw the issue because my -Werror branch stopped compiling cold---and the tests still linked and ran. --- src/H5TS.c | 9 --------- src/H5private.h | 8 +++++--- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/H5TS.c b/src/H5TS.c index 7a801e2..9503e05 100644 --- a/src/H5TS.c +++ b/src/H5TS.c @@ -639,13 +639,4 @@ H5TS_create_thread(void *(*func)(void *), H5TS_attr_t *attr, void *udata) } /* H5TS_create_thread */ -#else /* H5_HAVE_THREADSAFE */ - -uint64_t -H5TS_thread_id(void) -{ - return 0; -} - #endif /* H5_HAVE_THREADSAFE */ - diff --git a/src/H5private.h b/src/H5private.h index f0f3687..2f5a727 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1897,12 +1897,14 @@ H5_DLL double H5_trace(const double *calltime, const char *func, const char *typ /* global library version information string */ extern char H5_lib_vers_info_g[]; +/* Include required thread-safety header, always, for the H5TS_thread_id() + * definition. + */ +#include "H5TSprivate.h" + /* Lock headers */ #ifdef H5_HAVE_THREADSAFE -/* Include required thread-safety header */ -#include "H5TSprivate.h" - /* replacement structure for original global variable */ typedef struct H5_api_struct { H5TS_mutex_t init_lock; /* API entrance mutex */ -- cgit v0.12 From 3d2c0d7b0d3d41d88552d13d482bd264ec4e6269 Mon Sep 17 00:00:00 2001 From: David Young Date: Mon, 10 Feb 2020 13:31:56 -0600 Subject: Delete unhelpful comment per Jordan's question. --- src/H5private.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/H5private.h b/src/H5private.h index 2f5a727..700fe8a 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1897,9 +1897,6 @@ H5_DLL double H5_trace(const double *calltime, const char *func, const char *typ /* global library version information string */ extern char H5_lib_vers_info_g[]; -/* Include required thread-safety header, always, for the H5TS_thread_id() - * definition. - */ #include "H5TSprivate.h" /* Lock headers */ -- cgit v0.12