Don't define away __attribute__ on gcc

Profile feedback sets -DNO_NORETURN, which causes the compat header file to go into a default #else block. That #else block defines away __attribute__(). Doing so causes all kinds of problems with the Linux and gcc system headers: in particular it makes the xmmintrin.h headers error out, breaking the build. Don't define away __attribute__ when __GNUC__ is set. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Andi Kleen committed Jul 4, 2014 at 16:43 UTC 8cd7ebc89e025f1d5bc4b247497e4cfd7fd8ec0f
1 file changed +2
git-compat-util.h
+2
@@ -291,10 +291,12 @@ extern char *gitbasename(char *);
291 #else
292 #define NORETURN
293 #define NORETURN_PTR
294 +#ifndef __GNUC__
295 #ifndef __attribute__
296 #define __attribute__(x)
297 #endif
298 #endif
299 +#endif
300
301 /* The sentinel attribute is valid from gcc version 4.0 */
302 #if defined(__GNUC__) && (__GNUC__ >= 4)