]> granicus.if.org Git - libexpat/commitdiff
xmlparse.c: Move includes up to fix macro interference
authorSebastian Pipping <sebastian@pipping.org>
Sat, 1 Jul 2017 12:52:24 +0000 (14:52 +0200)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 1 Jul 2017 12:52:24 +0000 (14:52 +0200)
Guilty is our macro "buffer" resolving to "parser->m_buffer".
Issue #59 is related.

expat/lib/xmlparse.c

index d38c90db6b41493bfb197d50d51fd918ee805fcb..cbc56b461643d52f56ea4ccc7332b8c660e87c38 100644 (file)
 #include "expat.h"
 #include "siphash.h"
 
+#if defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM)
+# include <errno.h>
+# if defined(HAVE_GETRANDOM)
+#  include <sys/random.h>    /* getrandom */
+# else
+#  include <unistd.h>        /* syscall */
+#  include <sys/syscall.h>   /* SYS_getrandom */
+# endif
+#endif  /* defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM) */
+
+
 #ifdef XML_UNICODE
 #define XML_ENCODE_MAX XML_UTF16_ENCODE_MAX
 #define XmlConvert XmlUtf16Convert
@@ -696,14 +707,6 @@ static const XML_Char implicitContext[] = {
 
 
 #if defined(HAVE_GETRANDOM) || defined(HAVE_SYSCALL_GETRANDOM)
-# include <errno.h>
-
-# if defined(HAVE_GETRANDOM)
-#  include <sys/random.h>    /* getrandom */
-# else
-#  include <unistd.h>        /* syscall */
-#  include <sys/syscall.h>   /* SYS_getrandom */
-# endif
 
 /* Obtain entropy on Linux 3.17+ */
 static int