summaryrefslogtreecommitdiffstats
path: root/src/H5public.h
diff options
context:
space:
mode:
authorJerome Soumagne <jsoumagne@hdfgroup.org>2015-08-21 18:52:30 (GMT)
committerJerome Soumagne <jsoumagne@hdfgroup.org>2015-08-21 18:52:30 (GMT)
commit7ce2d52cf69f6f6477e0f16e9d85d67cc54d5949 (patch)
treedf01935167a5d011693bb791e582b60f375669d7 /src/H5public.h
parent1b2b0bd5a30cbc4227457abd08f563a8fd8c8b68 (diff)
downloadhdf5-7ce2d52cf69f6f6477e0f16e9d85d67cc54d5949.zip
hdf5-7ce2d52cf69f6f6477e0f16e9d85d67cc54d5949.tar.gz
hdf5-7ce2d52cf69f6f6477e0f16e9d85d67cc54d5949.tar.bz2
[svn-r27545] Add first support for _Bool and make hbool_t a "real" _Bool if available
Fix tests accordingly
Diffstat (limited to 'src/H5public.h')
-rw-r--r--src/H5public.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/H5public.h b/src/H5public.h
index 1b3711b..858e67f 100644
--- a/src/H5public.h
+++ b/src/H5public.h
@@ -141,7 +141,20 @@ typedef int herr_t;
* printf("error determining whether data type is committed\n");
* }
*/
-typedef unsigned int hbool_t;
+#ifdef H5_HAVE_STDBOOL_H
+ #include <stdbool.h>
+#else /* H5_HAVE_STDBOOL_H */
+ #ifndef __cplusplus
+ #if defined(H5_SIZEOF_BOOL) && (H5_SIZEOF_BOOL != 0)
+ #define bool _Bool
+ #else
+ #define bool unsigned int
+ #endif
+ #define true 1
+ #define false 0
+ #endif /* __cplusplus */
+#endif /* H5_HAVE_STDBOOL_H */
+typedef bool hbool_t;
typedef int htri_t;
/* Define the ssize_t type if it not is defined */