summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2008-06-12 17:51:58 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2008-06-12 17:51:58 (GMT)
commit97e6dc5d876d4e772fd65727f6b9b2c4367cb080 (patch)
treebaada4b8cb51abceb2ca03354585ac91a7770655 /src/H5private.h
parent5ad6d8c34caa23832b2dc8779192b134a0543f8b (diff)
downloadhdf5-97e6dc5d876d4e772fd65727f6b9b2c4367cb080.zip
hdf5-97e6dc5d876d4e772fd65727f6b9b2c4367cb080.tar.gz
hdf5-97e6dc5d876d4e772fd65727f6b9b2c4367cb080.tar.bz2
[svn-r15208] Description:
Add a "HDcompile_assert" macro for assertions that can/should be checked at compile time, as opposed to run time. (And used it for a couple of simple cases, to begin) Tested on: FreeBSD/32 6.2 (duty) in debug mode FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe, in debug mode Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN, in production mode Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN, in production mode Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN, w/szip filter, in production mode Mac OS X/32 10.5.3 (amazon) in debug mode Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/H5private.h b/src/H5private.h
index 97c53fb..6686f88 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1881,6 +1881,9 @@ static herr_t H5_INTERFACE_INIT_FUNC(void);
#define H5_GLUE(x,y) x##y
#define H5_GLUE3(x,y,z) x##y##z
+/* Compile-time "assert" macro */
+#define HDcompile_assert(e) do { enum { compile_assert__ = 1 / (e) }; } while(0)
+
/* Private functions, not part of the publicly documented API */
H5_DLL herr_t H5_init_library(void);
H5_DLL void H5_term_library(void);