Hello,

I'm trying to build the last libxml2 version (2.9.4) with an old Visual
Studio version (2005, 2008 and 2010) and I get the following errors:

===

..\relaxng.c(2218) : error C2275: 'xmlChar' : illegal use of this type
as an expression

[snip]

..\xmlschemas.c(3172) : error C2275: 'xmlChar' : illegal use of this
type as an expression

===

It could be easily fixed like illustrated in the attached patch.

If you could have a look...

Best Regards.
Index: relaxng.c
===================================================================
--- relaxng.c	(revision 151116)
+++ relaxng.c	(working copy)
@@ -2088,6 +2088,7 @@
                          const xmlChar * arg2)
 {
     char msg[1000];
+    xmlChar *result=NULL;
 
     if (arg1 == NULL)
         arg1 = BAD_CAST "";
@@ -2215,7 +2216,7 @@
         snprintf(msg, 1000, "Unknown error code %d\n", err);
     }
     msg[1000 - 1] = 0;
-    xmlChar *result = xmlCharStrdup(msg);
+    result = xmlCharStrdup(msg);
     return (xmlEscapeFormatString(&result));
 }
 
Index: xmlschemas.c
===================================================================
--- xmlschemas.c	(revision 151116)
+++ xmlschemas.c	(working copy)
@@ -3121,6 +3121,7 @@
 			const xmlChar *str2)
 {
     xmlChar *msg = NULL;
+    xmlChar *expectedEscaped = NULL;
 
     xmlSchemaFormatNodeForError(&msg, ACTXT_CAST ctxt, node);
     if (message == NULL) {
@@ -3169,7 +3170,7 @@
 	}
 	if (expected) {
 	    msg = xmlStrcat(msg, BAD_CAST " Expected is '");
-	    xmlChar *expectedEscaped = xmlCharStrdup(expected);
+	    expectedEscaped = xmlCharStrdup(expected);
 	    msg = xmlStrcat(msg, xmlEscapeFormatString(&expectedEscaped));
 	    FREE_AND_NULL(expectedEscaped);
 	    msg = xmlStrcat(msg, BAD_CAST "'.\n");

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
https://mail.gnome.org/mailman/listinfo/xml

Reply via email to