summaryrefslogtreecommitdiffstats
path: root/src/H5win32defs.h
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-07-02 18:52:03 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-07-02 18:52:03 (GMT)
commit88e8597cdef826c1087e4ec1383657a91dcb2a43 (patch)
tree3f8c84ae38b72dc91fcc7ee82ab78b708ac0bf28 /src/H5win32defs.h
parentd05b58b5d4806d694f16d0fc698c5e1c057a411b (diff)
downloadhdf5-88e8597cdef826c1087e4ec1383657a91dcb2a43.zip
hdf5-88e8597cdef826c1087e4ec1383657a91dcb2a43.tar.gz
hdf5-88e8597cdef826c1087e4ec1383657a91dcb2a43.tar.bz2
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)