[libxml2] Define LFS macros before including system headers



commit 433b318668bf2e0f3d56af6a87cb617107d2f290
Author: Nick Wellnhofer <wellnhofer aevum de>
Date:   Wed Apr 27 12:39:12 2022 +0200

    Define LFS macros before including system headers
    
    xmlstring.h includes stdarg.h, so it must be included after defining
    macros like _FILE_OFFSET_BITS.

 libxml.h | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/libxml.h b/libxml.h
index 910ca49b..66f164d5 100644
--- a/libxml.h
+++ b/libxml.h
@@ -9,8 +9,10 @@
 #ifndef __XML_LIBXML_H__
 #define __XML_LIBXML_H__
 
-#include <libxml/xmlstring.h>
-
+/*
+ * These macros must be defined before including system headers.
+ * Do not add any #include directives above this block.
+ */
 #ifndef NO_LARGEFILE_SOURCE
 #ifndef _LARGEFILE_SOURCE
 #define _LARGEFILE_SOURCE
@@ -27,6 +29,7 @@
  */
 #include "config.h"
 #include <libxml/xmlversion.h>
+#include <libxml/xmlstring.h>
 
 #ifndef SYSCONFDIR
   #define SYSCONFDIR "/etc"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]