diff options
author | David Young <dyoung@hdfgroup.org> | 2020-02-17 16:47:29 (GMT) |
---|---|---|
committer | David Young <dyoung@hdfgroup.org> | 2020-02-17 16:47:29 (GMT) |
commit | 47b79b7422c91e53ae5d87bcda45d52798a64fb6 (patch) | |
tree | e00ad2dc80ba285fb12d7dfa1a7be7402c0f28e6 /src | |
parent | fa2b89c6b0c894915f12a1df594ef8c427adbc2d (diff) | |
parent | b4697f969295245840350e17d75d92a0fdd7e7a9 (diff) | |
download | hdf5-47b79b7422c91e53ae5d87bcda45d52798a64fb6.zip hdf5-47b79b7422c91e53ae5d87bcda45d52798a64fb6.tar.gz hdf5-47b79b7422c91e53ae5d87bcda45d52798a64fb6.tar.bz2 |
Merge pull request #2369 in HDFFV/hdf5 from ~DYOUNG/vs2010:develop to develop
Merged per discussion with Elena.
* commit 'b4697f969295245840350e17d75d92a0fdd7e7a9':
Use HD prefix.
Delete unhelpful comment per Jordan's question.
Make sure that H5TS_thread_id() is available as either a function or a macro in all configurations.
Provide local copies of err(3)- and errx(3)-alike functions for Visual Studio compatibility.
Provide C99/POSIX.1 format strings PRI[doux]{8,16,32,64,MAX,PTR} on systems that are missing <inttypes.h>.
Diffstat (limited to 'src')
-rw-r--r-- | src/H5TS.c | 9 | ||||
-rw-r--r-- | src/H5private.h | 5 | ||||
-rw-r--r-- | src/H5public.h | 40 |
3 files changed, 41 insertions, 13 deletions
@@ -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..700fe8a 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -1897,12 +1897,11 @@ 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 "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 */ diff --git a/src/H5public.h b/src/H5public.h index 86a1fbb..3312cf4 100644 --- a/src/H5public.h +++ b/src/H5public.h @@ -51,7 +51,45 @@ # endif #endif #ifdef H5_HAVE_INTTYPES_H -# include <inttypes.h> /* For uint64_t on some platforms */ +# include <inttypes.h> /* C99/POSIX.1 header for uint64_t, PRIu64 */ +#else /* H5_HAVE_INTTYPES_H */ +/* The following definitions should be suitable for 64-bit Windows, which is + * LLP64, and for 32-bit Windows, which is ILP32. Those are the only + * platforms where <inttypes.h> is likely to be missing. VS2015 and later + * *may* provide these definitions. + */ +#ifdef _WIN64 +# define PRIdPTR "lld" +# define PRIoPTR "llo" +# define PRIuPTR "llu" +# define PRIxPTR "llx" +#else /* _WIN64 */ +# define PRIdPTR "ld" +# define PRIoPTR "lo" +# define PRIuPTR "lu" +# define PRIxPTR "lx" +#endif /* _WIN64 */ + +# define PRId8 "d" +# define PRIo8 "o" +# define PRIu8 "u" +# define PRIx8 "x" +# define PRId16 "d" +# define PRIo16 "o" +# define PRIu16 "u" +# define PRIx16 "x" +# define PRId32 "d" +# define PRIo32 "o" +# define PRIu32 "u" +# define PRIx32 "x" +# define PRId64 "lld" +# define PRIo64 "llo" +# define PRIu64 "llu" +# define PRIx64 "llx" +# define PRIdMAX "lld" +# define PRIoMAX "llo" +# define PRIuMAX "llu" +# define PRIxMAX "llx" #endif #ifdef H5_HAVE_STDDEF_H # include <stddef.h> |