Skip to content

Commit 8cd7ebc

Browse files
Andi Kleengitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 0be314c commit 8cd7ebc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

git-compat-util.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,12 @@ extern char *gitbasename(char *);
291291
#else
292292
#define NORETURN
293293
#define NORETURN_PTR
294+
#ifndef __GNUC__
294295
#ifndef __attribute__
295296
#define __attribute__(x)
296297
#endif
297298
#endif
299+
#endif
298300

299301
/* The sentinel attribute is valid from gcc version 4.0 */
300302
#if defined(__GNUC__) && (__GNUC__ >= 4)

0 commit comments

Comments
 (0)