summaryrefslogtreecommitdiff
path: root/list.h
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-07-17 00:25:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-18 18:06:51 (GMT)
commitecba19531ac68586b4e06f6cc40e92447091bc28 (patch)
treed7338e7ccbeeef43ccbadb1bf8dade171aa06c90 /list.h
parent94e99012fc7a02c5504214294279fa49b4cc8ce3 (diff)
downloadgit-ecba19531ac68586b4e06f6cc40e92447091bc28.zip
git-ecba19531ac68586b4e06f6cc40e92447091bc28.tar.gz
git-ecba19531ac68586b4e06f6cc40e92447091bc28.tar.bz2
list: avoid incompatibility with *BSD sys/queue.h
The OS X build pulls in sys/queue.h, which pollutes the preprocessor namespace with a macro generically named LIST_HEAD, and clashes with the name we use here. ref: http://mid.gmane.org/FB76544F-16F7-45CA-9649-FD62EE44B0DE@gmail.com Reported-by: Lars Schneider <larsxschneider@gmail.com> Signed-off-by: Eric Wong <e@80x24.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'list.h')
-rw-r--r--list.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/list.h b/list.h
index f65edce..a226a87 100644
--- a/list.h
+++ b/list.h
@@ -36,6 +36,8 @@ struct list_head {
struct list_head *next, *prev;
};
+/* avoid conflicts with BSD-only sys/queue.h */
+#undef LIST_HEAD
/* Define a variable with the head and tail of the list. */
#define LIST_HEAD(name) \
struct list_head name = { &(name), &(name) }