summaryrefslogtreecommitdiffstats
path: root/src/H5private.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5private.h')
-rw-r--r--src/H5private.h18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/H5private.h b/src/H5private.h
index d1bbc24..f7a4171 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -279,15 +279,10 @@
* big deal if we don't.
*/
#ifdef __cplusplus
-# define UNUSED /*void*/
-# define NORETURN /*void*/
+# define __attribute__(X) /*void*/
#else /* __cplusplus */
-#ifdef H5_HAVE_ATTRIBUTE
-# define UNUSED __attribute__((unused))
-# define NORETURN __attribute__((noreturn))
-#else
-# define UNUSED /*void*/
-# define NORETURN /*void*/
+#ifndef H5_HAVE_ATTRIBUTE
+# define __attribute__(X) /*void*/
#endif
#endif /* __cplusplus */
@@ -1523,11 +1518,14 @@ extern char *strdup(const char *s);
/* Include the generated overflow header file */
#include "H5overflow.h"
-#define H5_ASSIGN_OVERFLOW(dst, src, srctype, dsttype) \
+/* Assign a variable to one of a different size (think safer dst = (dsttype)src").
+ * The code generated by the macro checks for overflows.
+ */
+#define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \
H5_GLUE4(ASSIGN_,srctype,_TO_,dsttype)(dst,dsttype,src,srctype)\
#else /* NDEBUG */
-#define H5_ASSIGN_OVERFLOW(dst, src, srctype, dsttype) \
+#define H5_CHECKED_ASSIGN(dst, dsttype, src, srctype) \
(dst) = (dsttype)(src);
#endif /* NDEBUG */