summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5config.h.in3
-rw-r--r--src/H5public.h15
2 files changed, 18 insertions, 0 deletions
diff --git a/src/H5config.h.in b/src/H5config.h.in
index 23ee0f9..ac0e50c 100644
--- a/src/H5config.h.in
+++ b/src/H5config.h.in
@@ -164,6 +164,9 @@
/* The number of bytes in a size_t. */
#undef SIZEOF_SIZE_T
+/* The number of bytes in a ssize_t. */
+#undef SIZEOF_SSIZE_T
+
/* The number of bytes in a uint16_t. */
#undef SIZEOF_UINT16_T
diff --git a/src/H5public.h b/src/H5public.h
index 8cbb25f..e455ed1f 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -99,6 +99,21 @@ typedef int herr_t;
typedef unsigned int hbool_t;
typedef int htri_t;
+/* Define the ssize_t type if it not is defined */
+#if H5_SIZEOF_SSIZE_T==0
+#if H5_SIZEOF_SIZE_T==H5_SIZEOF_INT
+typedef int ssize_t;
+#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG
+typedef long ssize_t;
+#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG_LONG
+typedef long long ssize_t;
+#elif H5_SIZEOF_SIZE_T==H5_SIZEOF___INT64
+typedef __int64 ssize_t;
+#else /* Can't find matching type for ssize_t */
+# error "nothing appropriate for ssize_t"
+#endif
+#endif
+
/*
* The sizes of file objects have their own types defined here. If large
* sizes are enabled then use a 64-bit data type, otherwise use the size of