summaryrefslogtreecommitdiffstats
path: root/src/H5win32defs.h
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-07-02 19:46:43 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-07-02 19:46:43 (GMT)
commit4c2071bfd3270dc3a688914b4a058147b94b7023 (patch)
treec983b0bdd8e88ece2eb8bd2957d9921be59258d9 /src/H5win32defs.h
parent68d6981156f0f9c48a08d235c1073b46fd1f6c07 (diff)
parent88e8597cdef826c1087e4ec1383657a91dcb2a43 (diff)
downloadhdf5-4c2071bfd3270dc3a688914b4a058147b94b7023.zip
hdf5-4c2071bfd3270dc3a688914b4a058147b94b7023.tar.gz
hdf5-4c2071bfd3270dc3a688914b4a058147b94b7023.tar.bz2
Merge pull request #2671 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit '88e8597cdef826c1087e4ec1383657a91dcb2a43': Small changes discovered with mingw and windows defines moved
Diffstat (limited to 'src/H5win32defs.h')
-rw-r--r--src/H5win32defs.h48
1 files changed, 42 insertions, 6 deletions
diff --git a/src/H5win32defs.h b/src/H5win32defs.h
index 00df56d..71162eb 100644
--- a/src/H5win32defs.h
+++ b/src/H5win32defs.h
@@ -20,6 +20,45 @@
* inside H5private.h
*
*/
+#ifndef 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
/*
* _MSC_VER = 1900 VS2015
@@ -41,11 +80,6 @@ typedef __int64 h5_stat_size_t;
#define HDfstat(F,B) _fstati64(F,B)
#define HDisatty(F) _isatty(F)
-/* The isnan function needs underscore in VS2012 and earlier */
-#if (_MSC_VER <= 1700)
- #define HDisnan(X) _isnan(X)
-#endif /* MSC_VER < 1700 */
-
#define HDgetcwd(S,Z) _getcwd(S,Z)
#define HDgetdcwd(D,S,Z) _getdcwd(D,S,Z)
#define HDgetdrive() _getdrive()
@@ -111,8 +145,10 @@ struct timespec
};
#endif /* MSC_VER < 1900 */
-/* The round functions do not exist in VS2012 and earlier */
#if (_MSC_VER <= 1700)
+/* The isnan function needs underscore in VS2012 and earlier */
+#define HDisnan(X) _isnan(X)
+/* The round functions do not exist in VS2012 and earlier */
#define HDllround(V) Wllround(V)
#define HDllroundf(V) Wllroundf(V)
#define HDlround(V) Wlround(V)