summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2007-08-09 09:46:36 +0000
committerjoe <joe@61a7d7f5-40b7-0310-9c16-bb0ea8cb1845>2007-08-09 09:46:36 +0000
commitaa44aa13368eac43690c8a91d7b872e494c7c4e3 (patch)
treed9ad7b94b3ed7b41d2f11ad6421a5f1719c2e034
parent04c298330cbb8c7cd93f08aaa5c5456fef4f7bf4 (diff)
downloadneon-aa44aa13368eac43690c8a91d7b872e494c7c4e3.tar.gz
Fix compiler warnings with expat 2.x API:
* macros/neon.m4 (NEON_FORMAT): Fix use of headers passed to AC_CHECK_SIZEOF. * macros/neon-xml-parser.m4 (NE_XML_EXPAT): Check how to print the XML_Size type, if defined. * src/ne_xml.c (ne_xml_parse): Use correct format string for return value of XML_GetCurrentLineNumber. git-svn-id: http://svn.webdav.org/repos/projects/neon/trunk@1218 61a7d7f5-40b7-0310-9c16-bb0ea8cb1845
-rw-r--r--macros/neon-xml-parser.m46
-rw-r--r--macros/neon.m43
-rw-r--r--src/ne_xml.c2
3 files changed, 8 insertions, 3 deletions
diff --git a/macros/neon-xml-parser.m4 b/macros/neon-xml-parser.m4
index b3d2e9e..be5b3db 100644
--- a/macros/neon-xml-parser.m4
+++ b/macros/neon-xml-parser.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 1998-2005 Joe Orton <joe@manyfish.co.uk> -*- autoconf -*-
+# Copyright (C) 1998-2005, 2007 Joe Orton <joe@manyfish.co.uk> -*- autoconf -*-
#
# This file is free software; you may copy and/or distribute it with
# or without modifications, as long as this notice is preserved.
@@ -35,6 +35,10 @@ AC_CHECK_HEADER(expat.h,
neon_xml_parser_message="expat"
NEON_LIBS="$NEON_LIBS -lexpat"
neon_xml_parser=expat
+ AC_CHECK_TYPE(XML_Size,
+ [NEON_FORMAT(XML_Size, [#include <expat.h>])],
+ [AC_DEFINE_UNQUOTED([NE_FMT_XML_SIZE], ["d"])],
+ [#include <expat.h>])
], [$1])], [$1])
])
diff --git a/macros/neon.m4 b/macros/neon.m4
index 5e00f19..74ec207 100644
--- a/macros/neon.m4
+++ b/macros/neon.m4
@@ -514,7 +514,8 @@ AC_DEFUN([NEON_FORMAT], [
AC_REQUIRE([NEON_FORMAT_PREP])
-AC_CHECK_SIZEOF($1, [$2])
+AC_CHECK_SIZEOF($1,, [AC_INCLUDES_DEFAULT
+$2])
dnl Work out which specifier character to use
m4_ifdef([ne_spec], [m4_undefine([ne_spec])])
diff --git a/src/ne_xml.c b/src/ne_xml.c
index f6cdd56..7c95a2e 100644
--- a/src/ne_xml.c
+++ b/src/ne_xml.c
@@ -547,7 +547,7 @@ int ne_xml_parse(ne_xml_parser *p, const char *block, size_t len)
NE_DEBUG(NE_DBG_XMLPARSE, "XML: XML_Parse returned %d\n", ret);
if (ret == 0 && p->failure == 0) {
ne_snprintf(p->error, ERR_SIZE,
- "XML parse error at line %d: %s",
+ "XML parse error at line %" NE_FMT_XML_SIZE ": %s",
XML_GetCurrentLineNumber(p->parser),
XML_ErrorString(XML_GetErrorCode(p->parser)));
p->failure = 1;