summaryrefslogtreecommitdiff
path: root/git-compat-util.h
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2014-07-04 23:43:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-07-07 21:01:14 (GMT)
commit8cd7ebc89e025f1d5bc4b247497e4cfd7fd8ec0f (patch)
treef7228ecbd72012c678bc3bda669624a4421927a1 /git-compat-util.h
parent0be314c20742cd62cd6e8fcfbcc4535fb2a99675 (diff)
downloadgit-8cd7ebc89e025f1d5bc4b247497e4cfd7fd8ec0f.zip
git-8cd7ebc89e025f1d5bc4b247497e4cfd7fd8ec0f.tar.gz
git-8cd7ebc89e025f1d5bc4b247497e4cfd7fd8ec0f.tar.bz2
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>
Diffstat (limited to 'git-compat-util.h')
-rw-r--r--git-compat-util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/git-compat-util.h b/git-compat-util.h
index 96f5554..01e8695 100644
--- a/git-compat-util.h
+++ b/git-compat-util.h
@@ -291,10 +291,12 @@ extern char *gitbasename(char *);
#else
#define NORETURN
#define NORETURN_PTR
+#ifndef __GNUC__
#ifndef __attribute__
#define __attribute__(x)
#endif
#endif
+#endif
/* The sentinel attribute is valid from gcc version 4.0 */
#if defined(__GNUC__) && (__GNUC__ >= 4)