1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 07:06:34 +02:00

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>
This commit is contained in:
Eric Wong 2016-07-17 00:25:34 +00:00 committed by Junio C Hamano
parent 94e99012fc
commit ecba19531a

2
list.h
View File

@ -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) }