]> git.mxchange.org Git - flightgear.git/commitdiff
fixes for compiling without syntax validation.
authorehofman <ehofman>
Mon, 11 May 2009 08:46:03 +0000 (08:46 +0000)
committerTim Moore <timoore@redhat.com>
Mon, 18 May 2009 10:24:17 +0000 (12:24 +0200)
utils/xmlgrep/xml.c
utils/xmlgrep/xml.h

index 16df5f977e696b00a861edfb4e17ae1f57b66eaf..b9016c08e77f041c9d7c2b4a70c4bcd0877d7cff 100644 (file)
@@ -58,9 +58,9 @@ typedef struct
 #include <assert.h>
 #include <ctype.h>
 
-#ifndef XML_NONVALIDATING
 #include "xml.h"
 
+#ifndef XML_NONVALIDATING
 static const char *__xml_error_str[XML_MAX_ERROR];
 
 struct _xml_error
@@ -224,7 +224,9 @@ xmlClose(void *id)
          close(rid->fd);
      }
 
+#ifndef XML_NONVALIDATING
      if (rid->info) free(rid->info);
+#endif
      free(rid);
      id = 0;
 }
@@ -1280,6 +1282,33 @@ xmlErrorGetString(const void *id, int clear)
 
     return ret;
 }
+
+#else
+
+int
+xmlErrorGetNo(const void *id, int clear)
+{
+    return XML_NO_ERROR;
+}
+
+size_t
+xmlErrorGetLineNo(const void *id, int clear)
+{
+    return 0;
+}
+
+size_t
+xmlErrorGetColumnNo(const void *id, int clear)
+{
+    return 0;
+}
+
+const char *
+xmlErrorGetString(const void *id, int clear)
+{
+   return "error detection was not enabled at compile time: no error.";
+}
+
 #endif
 
 /* -------------------------------------------------------------------------- */
index 26c55098fa147dc379d43364e4bfbaeb677cedc6..52843857e209402f6eba5a1af9b5eec3c87b4964 100644 (file)
@@ -325,7 +325,6 @@ double xmlNodeGetDouble(const void *, const char *);
 double xmlAttributeGetDouble(const void *, const char *);
 
 
-#ifndef XML_NONVALIDATING
 /**
  * Get the error number of the last error and clear it.
  *
@@ -361,7 +360,6 @@ size_t xmlErrorGetColumnNo(const void *, int);
  * @return a string that explains the last error.
  */
 const char *xmlErrorGetString(const void *, int);
-#endif
 
 #ifdef __cplusplus
 }