aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan Stancek <jstancek@redhat.com>2019-01-08 12:07:05 +0100
committerJan Stancek <jstancek@redhat.com>2019-01-08 12:13:08 +0100
commit0cd0d9ef09f0afb4e7419997a5974f373f32fcec (patch)
tree65783042718b1019c4ac4b1b0527b4b295a0f3f9 /include
parent41fae34ec57fe13740c3103689bd1e2c27964a50 (diff)
lib: rename BUILD_BUG_ON macro
It can collide with existing macros of same name: gcc -g -O2 -g -O2 -fno-strict-aliasing -pipe -Wall -W -Wold-style-definition -Illtp -o quotactl03 In file included from ../../../../include/tst_test.h:29:0, from quotactl03.c:53: ../../../../include/tst_common.h:68:0: warning: "BUILD_BUG_ON" redefined #define BUILD_BUG_ON(condition) \ In file included from /usr/include/xfs/xqm.h:21:0, from quotactl03.c:50: /usr/include/xfs/xfs.h:68:0: note: this is the location of the previous definiti #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)])) Suggested-by: Cyril Hrubis <chrubis@suse.cz> Signed-off-by: Jan Stancek <jstancek@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/tst_common.h2
-rw-r--r--include/tst_test.h3
2 files changed, 3 insertions, 2 deletions
diff --git a/include/tst_common.h b/include/tst_common.h
index 358f2a76e..c21505450 100644
--- a/include/tst_common.h
+++ b/include/tst_common.h
@@ -65,7 +65,7 @@
ERET; \
})
-#define BUILD_BUG_ON(condition) \
+#define TST_BRK_SUPPORTS_ONLY_TCONF_TBROK(condition) \
do { ((void)sizeof(char[1 - 2 * !!(condition)])); } while (0)
#endif /* TST_COMMON_H__ */
diff --git a/include/tst_test.h b/include/tst_test.h
index cd936eb79..cbd586c17 100644
--- a/include/tst_test.h
+++ b/include/tst_test.h
@@ -71,7 +71,8 @@ void tst_brk_(const char *file, const int lineno, int ttype,
#define tst_brk(ttype, arg_fmt, ...) \
({ \
- BUILD_BUG_ON(!((ttype) & (TBROK | TCONF | TFAIL))); \
+ TST_BRK_SUPPORTS_ONLY_TCONF_TBROK(!((ttype) & \
+ (TBROK | TCONF | TFAIL))); \
tst_brk_(__FILE__, __LINE__, (ttype), (arg_fmt), ##__VA_ARGS__);\
})