summaryrefslogtreecommitdiff
path: root/ccan/check_type/check_type.h
diff options
context:
space:
mode:
Diffstat (limited to 'ccan/check_type/check_type.h')
-rw-r--r--ccan/check_type/check_type.h26
1 files changed, 13 insertions, 13 deletions
diff --git a/ccan/check_type/check_type.h b/ccan/check_type/check_type.h
index 1f77a535e4..e795ad71d0 100644
--- a/ccan/check_type/check_type.h
+++ b/ccan/check_type/check_type.h
@@ -3,7 +3,7 @@
#define CCAN_CHECK_TYPE_H
/**
- * check_type - issue a warning or build failure if type is not correct.
+ * ccan_check_type - issue a warning or build failure if type is not correct.
* @expr: the expression whose type we should check (not evaluated).
* @type: the exact type we expect the expression to be.
*
@@ -11,7 +11,7 @@
* argument is of the expected type. No type promotion of the expression is
* done: an unsigned int is not the same as an int!
*
- * check_type() always evaluates to 0.
+ * ccan_check_type() always evaluates to 0.
*
* If your compiler does not support typeof, then the best we can do is fail
* to compile if the sizes of the types are unequal (a less complete check).
@@ -19,11 +19,11 @@
* Example:
* // They should always pass a 64-bit value to _set_some_value!
* #define set_some_value(expr) \
- * _set_some_value((check_type((expr), uint64_t), (expr)))
+ * _set_some_value((ccan_check_type((expr), uint64_t), (expr)))
*/
/**
- * check_types_match - issue a warning or build failure if types are not same.
+ * ccan_check_types_match - issue a warning or build failure if types are not same.
* @expr1: the first expression (not evaluated).
* @expr2: the second expression (not evaluated).
*
@@ -31,7 +31,7 @@
* arguments are of identical types. No type promotion of the expressions is
* done: an unsigned int is not the same as an int!
*
- * check_types_match() always evaluates to 0.
+ * ccan_check_types_match() always evaluates to 0.
*
* If your compiler does not support typeof, then the best we can do is fail
* to compile if the sizes of the types are unequal (a less complete check).
@@ -39,25 +39,25 @@
* Example:
* // Do subtraction to get to enclosing type, but make sure that
* // pointer is of correct type for that member.
- * #define container_of(mbr_ptr, encl_type, mbr) \
- * (check_types_match((mbr_ptr), &((encl_type *)0)->mbr), \
+ * #define ccan_container_of(mbr_ptr, encl_type, mbr) \
+ * (ccan_check_types_match((mbr_ptr), &((encl_type *)0)->mbr), \
* ((encl_type *) \
* ((char *)(mbr_ptr) - offsetof(enclosing_type, mbr))))
*/
#if HAVE_TYPEOF
-#define check_type(expr, type) \
+#define ccan_check_type(expr, type) \
((typeof(expr) *)0 != (type *)0)
-#define check_types_match(expr1, expr2) \
+#define ccan_check_types_match(expr1, expr2) \
((typeof(expr1) *)0 != (typeof(expr2) *)0)
#else
#include "ccan/build_assert/build_assert.h"
/* Without typeof, we can only test the sizes. */
-#define check_type(expr, type) \
- BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type))
+#define ccan_check_type(expr, type) \
+ CCAN_BUILD_ASSERT_OR_ZERO(sizeof(expr) == sizeof(type))
-#define check_types_match(expr1, expr2) \
- BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2))
+#define ccan_check_types_match(expr1, expr2) \
+ CCAN_BUILD_ASSERT_OR_ZERO(sizeof(expr1) == sizeof(expr2))
#endif /* HAVE_TYPEOF */
#endif /* CCAN_CHECK_TYPE_H */