summaryrefslogtreecommitdiff
path: root/ccan/build_assert
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2022-03-30 16:36:31 +0900
committerGitHub <noreply@github.com>2022-03-30 20:36:31 +1300
commit42a0bed351979cb4a59c641fa5f03e49609561fd (patch)
tree615a891e8fa9fbf6f3747d070fc03302341974dc /ccan/build_assert
parent8d27d00af514153819e44eb8e5f4f8631830ae55 (diff)
Prefix ccan headers (#4568)
* Prefixed ccan headers * Remove unprefixed names in ccan/build_assert * Remove unprefixed names in ccan/check_type * Remove unprefixed names in ccan/container_of * Remove unprefixed names in ccan/list Co-authored-by: Samuel Williams <samuel.williams@oriontransfer.co.nz>
Notes
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'ccan/build_assert')
-rw-r--r--ccan/build_assert/build_assert.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/ccan/build_assert/build_assert.h b/ccan/build_assert/build_assert.h
index a04d1d4709..b846849241 100644
--- a/ccan/build_assert/build_assert.h
+++ b/ccan/build_assert/build_assert.h
@@ -3,7 +3,7 @@
#define CCAN_BUILD_ASSERT_H
/**
- * BUILD_ASSERT - assert a build-time dependency.
+ * CCAN_BUILD_ASSERT - assert a build-time dependency.
* @cond: the compile-time condition which must be true.
*
* Your compile will fail if the condition isn't true, or can't be evaluated
@@ -15,15 +15,15 @@
* static char *foo_to_char(struct foo *foo)
* {
* // This code needs string to be at start of foo.
- * BUILD_ASSERT(offsetof(struct foo, string) == 0);
+ * CCAN_BUILD_ASSERT(offsetof(struct foo, string) == 0);
* return (char *)foo;
* }
*/
-#define BUILD_ASSERT(cond) \
+#define CCAN_BUILD_ASSERT(cond) \
do { (void) sizeof(char [1 - 2*!(cond)]); } while(0)
/**
- * BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
+ * CCAN_BUILD_ASSERT_OR_ZERO - assert a build-time dependency, as an expression.
* @cond: the compile-time condition which must be true.
*
* Your compile will fail if the condition isn't true, or can't be evaluated
@@ -32,9 +32,9 @@
* Example:
* #define foo_to_char(foo) \
* ((char *)(foo) \
- * + BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
+ * + CCAN_BUILD_ASSERT_OR_ZERO(offsetof(struct foo, string) == 0))
*/
-#define BUILD_ASSERT_OR_ZERO(cond) \
+#define CCAN_BUILD_ASSERT_OR_ZERO(cond) \
(sizeof(char [1 - 2*!(cond)]) - 1)
#endif /* CCAN_BUILD_ASSERT_H */