summaryrefslogtreecommitdiffstats
path: root/src/H5public.h
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2005-04-29 22:00:32 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2005-04-29 22:00:32 (GMT)
commit1b7ae2a5b729ce09209b36a47dd80a74b8cdadbc (patch)
tree73b84bc0f8c5cb70c38c7589bfe3b49d1728fd32 /src/H5public.h
parent8f4b37accf49681ff657bcd4496f3bd023895141 (diff)
downloadhdf5-1b7ae2a5b729ce09209b36a47dd80a74b8cdadbc.zip
hdf5-1b7ae2a5b729ce09209b36a47dd80a74b8cdadbc.tar.gz
hdf5-1b7ae2a5b729ce09209b36a47dd80a74b8cdadbc.tar.bz2
[svn-r10701]
Purpose: Bug fix Description: Some platforms (Windows) don't have the long long type, which causes automatic Fortran type matching to fail. A solution is to use HDF5's long_long type. Solution: Changed H5match_types.c to use long_long type. Moved definition of long_long out of H5private.h and into H5public.h. Platforms tested: mir, copper, pommier
Diffstat (limited to 'src/H5public.h')
-rw-r--r--src/H5public.h44
1 files changed, 23 insertions, 21 deletions
diff --git a/src/H5public.h b/src/H5public.h
index a5678a6..99437d7 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -106,6 +106,24 @@ typedef int herr_t;
typedef unsigned int hbool_t;
typedef int htri_t;
+/*
+ * Although `long long' is part of the revised ANSI-C some compilers don't
+ * support it yet. We define `long_long' as the longest integral integer type
+ * supported by the compiler, usually 64 bits. It must be legal to qualify
+ * `long_long' with `unsigned'.
+ */
+#if H5_SIZEOF_LONG_LONG>0
+# define long_long long long
+#elif H5_SIZEOF___INT64>0
+# define long_long __int64 /*Win32*/
+# undef H5_SIZEOF_LONG_LONG
+# define H5_SIZEOF_LONG_LONG H5_SIZEOF___INT64
+#else
+# define long_long long int
+# undef H5_SIZEOF_LONG_LONG
+# define H5_SIZEOF_LONG_LONG H5_SIZEOF_LONG
+#endif
+
/* 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 */
@@ -117,11 +135,8 @@ typedef int ssize_t;
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;
+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
@@ -134,13 +149,9 @@ typedef __int64 ssize_t;
*/
#ifdef H5_HAVE_LARGE_HSIZET
# if H5_SIZEOF_LONG_LONG>=8
-typedef unsigned long long hsize_t;
-typedef signed long long hssize_t;
+typedef unsigned long_long hsize_t;
+typedef signed long_long hssize_t;
# define H5_SIZEOF_HSIZE_T H5_SIZEOF_LONG_LONG
-# elif H5_SIZEOF___INT64>=8
-typedef unsigned __int64 hsize_t;
-typedef signed __int64 hssize_t;
-# define H5_SIZEOF_HSIZE_T H5_SIZEOF___INT64
# endif
#else /* H5_HAVE_LARGE_HSIZET */
typedef size_t hsize_t;
@@ -149,7 +160,7 @@ typedef ssize_t hssize_t;
#endif /* H5_HAVE_LARGE_HSIZET */
/*
- * File addresses have there own types.
+ * File addresses have their own types.
*/
#if H5_SIZEOF_INT64_T>=8
typedef uint64_t haddr_t;
@@ -173,19 +184,12 @@ typedef ssize_t hssize_t;
# define HADDR_AS_MPI_TYPE MPI_UNSIGNED_LONG
# endif /* H5_HAVE_PARALLEL */
#elif H5_SIZEOF_LONG_LONG>=8
- typedef unsigned long long haddr_t;
+ typedef unsigned long_long haddr_t;
# define HADDR_UNDEF ((haddr_t)(long long)(-1))
# define H5_SIZEOF_HADDR_T H5_SIZEOF_LONG_LONG
# ifdef H5_HAVE_PARALLEL
# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
# endif /* H5_HAVE_PARALLEL */
-#elif H5_SIZEOF___INT64>=8
- typedef unsigned __int64 haddr_t;
-# define HADDR_UNDEF ((haddr_t)(__int64)(-1))
-# define H5_SIZEOF_HADDR_T H5_SIZEOF___INT64
-# ifdef H5_HAVE_PARALLEL
-# define HADDR_AS_MPI_TYPE MPI_LONG_LONG_INT
-# endif /* H5_HAVE_PARALLEL */
#else
# error "nothing appropriate for haddr_t"
#endif
@@ -195,8 +199,6 @@ typedef ssize_t hssize_t;
# define H5_PRINTF_HADDR_FMT "%lu"
#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF_LONG_LONG
# define H5_PRINTF_HADDR_FMT "%"H5_PRINTF_LL_WIDTH"u"
-#elif H5_SIZEOF_HADDR_T ==H5_SIZEOF___INT64
-# define H5_PRINTF_HADDR_FMT "%"H5_PRINTF_LL_WIDTH"u"
#else
# error "nothing appropriate for H5_PRINTF_HADDR_FMT"
#endif