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>

Eric Wong committed Jul 17, 2016 at 00:25 UTC ecba19531ac68586b4e06f6cc40e92447091bc28
1 file changed +2
list.h
+2
@@ -36,6 +36,8 @@ struct list_head {
36 struct list_head *next, *prev;
37 };
38
39 +/* avoid conflicts with BSD-only sys/queue.h */
40 +#undef LIST_HEAD
41 /* Define a variable with the head and tail of the list. */
42 #define LIST_HEAD(name) \
43 struct list_head name = { &(name), &(name) }