]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfsprogs: prevent LIST_ macros conflicts
authorJan Tulak <jtulak@redhat.com>
Tue, 18 Aug 2015 07:53:17 +0000 (17:53 +1000)
committerDave Chinner <david@fromorbit.com>
Tue, 18 Aug 2015 07:53:17 +0000 (17:53 +1000)
BSD 4.4 added some LIST_ macros into system header files, which
causes "macro redefined" warnings. To ensure we use our own macros,
undefine the system ones at first.

The conflicting macros are LIST_HEAD and LIST_HEAD_INIT

Signed-off-by: Jan Tulak <jtulak@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
include/list.h

index 3f087a47c917821172fffbb872a8864d36fcf821..f92faed893dcea25bc1a4e5c7f12a3617dabfe45 100644 (file)
 #ifndef __LIST_H__
 #define __LIST_H__
 
+/*
+ * This undef is here because BSD 4.4 added some LIST_ macros into system
+ * header file sys/queue.h. This header is included in many other system
+ * headers and thus causes "macro redefined" warnings.
+ *
+ * As OS X is kind of a derivate of BSD, this affects OS X too.
+ *
+ * To use our own LIST_ macros (copied from kernel code), we have to
+ * at first undefine the conflicting system macros.
+ *
+ */
+#undef LIST_HEAD
+#undef LIST_HEAD_INIT
+
 /*
  * Simple, generic doubly-linked list implementation.
  */