chiark / gitweb /
build-sys: fix build on compilers without static_assert
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Jan 2015 14:06:00 +0000 (09:06 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 23 Jan 2015 14:30:44 +0000 (09:30 -0500)
Build would fail when assert was used on the same line in
different files #included together.

https://bugs.freedesktop.org/show_bug.cgi?id=87339

src/shared/macro.h

index 96d96f962116d0fdcce5c264a57e1c874c0d5fbe..ae2971fad141f54959bc89d0e50675f5faa2497a 100644 (file)
@@ -238,7 +238,7 @@ static inline unsigned long ALIGN_POWER2(unsigned long u) {
 #else
 #define assert_cc(expr)                                                 \
         DISABLE_WARNING_DECLARATION_AFTER_STATEMENT;                    \
-        struct CONCATENATE(_assert_struct_, __LINE__) {                 \
+        struct CONCATENATE(_assert_struct_, __COUNTER__) {              \
                 char x[(expr) ? 0 : -1];                                \
         };                                                              \
         REENABLE_WARNING