summaryrefslogtreecommitdiffstats
path: root/src/H5public.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2002-01-08 16:12:03 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2002-01-08 16:12:03 (GMT)
commit2c3a0ba8808769e5138e57195b42191b91bafbe2 (patch)
tree263228f0a4bff02bfa694d87fb266eb68f1637ea /src/H5public.h
parent3daae4c89d3203dff3455c000912482b6c20e298 (diff)
downloadhdf5-2c3a0ba8808769e5138e57195b42191b91bafbe2.zip
hdf5-2c3a0ba8808769e5138e57195b42191b91bafbe2.tar.gz
hdf5-2c3a0ba8808769e5138e57195b42191b91bafbe2.tar.bz2
[svn-r4797] Purpose:
Bug fix Description: The 'ssize_t' is not defined in Windows. Solution: Bring over chunk of code from development branch to define it, if it's not defined by the system. Platforms tested: FreeBSD 4.5 (sleipnir)
Diffstat (limited to 'src/H5public.h')
-rw-r--r--src/H5public.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/H5public.h b/src/H5public.h
index d85df43..18527e1 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -100,6 +100,27 @@ 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
+/* Undefine this size, we will re-define it in one of the sections below */
+#undef H5_SIZEOF_SSIZE_T
+#if H5_SIZEOF_SIZE_T==H5_SIZEOF_INT
+typedef int ssize_t;
+# define H5_SIZEOF_SSIZE_T H5_SIZEOF_INT
+#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG
+typedef long ssize_t;
+# define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG
+#elif H5_SIZEOF_SIZE_T==H5_SIZEOF_LONG_LONG
+typedef long long ssize_t;
+# define H5_SIZEOF_SSIZE_T H5_SIZEOF_LONG_LONG
+#elif H5_SIZEOF_SIZE_T==H5_SIZEOF___INT64
+typedef __int64 ssize_t;
+# define H5_SIZEOF_SSIZE_T H5_SIZEOF___INT64
+#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