From: Zbigniew Jędrzejewski-Szmek Date: Fri, 23 Jan 2015 14:06:00 +0000 (-0500) Subject: build-sys: fix build on compilers without static_assert X-Git-Tag: v219~313 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=6825a04de61f0bceab0ccddb34d825c3951caef1;ds=sidebyside build-sys: fix build on compilers without static_assert 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 --- diff --git a/src/shared/macro.h b/src/shared/macro.h index 96d96f962..ae2971fad 100644 --- a/src/shared/macro.h +++ b/src/shared/macro.h @@ -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