summaryrefslogtreecommitdiffstats
path: root/config/cmake/H5pubconf.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'config/cmake/H5pubconf.h.in')
-rw-r--r--config/cmake/H5pubconf.h.in23
1 files changed, 19 insertions, 4 deletions
diff --git a/config/cmake/H5pubconf.h.in b/config/cmake/H5pubconf.h.in
index 5c2177a..6e797df 100644
--- a/config/cmake/H5pubconf.h.in
+++ b/config/cmake/H5pubconf.h.in
@@ -602,6 +602,7 @@
#cmakedefine H5_SIZEOF_INT_LEAST8_T @H5_SIZEOF_INT_LEAST8_T@
#if !defined(__APPLE__)
+
/* The size of `size_t', as computed by sizeof. */
#cmakedefine H5_SIZEOF_SIZE_T @H5_SIZEOF_SIZE_T@
@@ -611,8 +612,17 @@
/* The size of `long', as computed by sizeof. */
#cmakedefine H5_SIZEOF_LONG @H5_SIZEOF_LONG@
+/* The size of `long double', as computed by sizeof. */
+#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@
+
#else
- # if defined(__LP64__) && __LP64__
+
+ /* On Apple, to support Universal Binaries (where multiple CPU
+ architectures exist in one library/executable), we can't assume
+ the machine doing the compiling has the same endianness or type
+ sizes as all the various architectures (PowerPC, Intel, ARM). */
+
+ # if defined(__LP64__) && __LP64__
#define H5_SIZEOF_LONG 8
#define H5_SIZEOF_SIZE_T 8
#define H5_SIZEOF_SSIZE_T 8
@@ -622,10 +632,15 @@
#define H5_SIZEOF_SSIZE_T 4
# endif
-#endif
+ # if defined(__i386__) || defined(__x86_64__)
+ #define H5_SIZEOF_LONG_DOUBLE 16
+ # elif defined(__aarch64__)
+ #define H5_SIZEOF_LONG_DOUBLE 8
+ # else
+ #cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@
+ # endif
-/* The size of `long double', as computed by sizeof. */
-#cmakedefine H5_SIZEOF_LONG_DOUBLE @H5_SIZEOF_LONG_DOUBLE@
+#endif
/* Define size of long long and/or __int64 bit integer type only if the type
exists. */