Re: [xml] libxml2.xmlIO.awn.1.patch



> 2006-09-06 Andrew W. Nosenko <andrew w nosenko gmail com <mailto:andrew w nosenko gmail com>>
>
> * xmlIO.c [HAVE_STAT && HAVE__STAT]:
> Fix the compilation breakage: macro that redefines of the 'stat'
> as '_stat' is removed (was introduced in the r1.172).
>
Removing this macro results in occurrence of warnings about
types incompatibility in _wstat() call on Windows.

Changes in this patch (for xmlIO.c rev. 1.172):
1. Replacement of 'stat' on '_stat' only on Windows
2. C style comments are used

I hope, patch must solve compilation problem.
I have no FreeBSD, but library was also compiled with glibc 2.0, both
HAVE_STAT and HAVE__STAT was defined.


--- xmlIO.orig.c        Fri Sep  1 12:27:58 2006
+++ xmlIO.c     Sat Sep  9 13:38:20 2006
@@ -52,7 +52,9 @@
 #  endif
 #else
 #  ifdef HAVE__STAT
+#    if defined(_WIN32) || defined (__DJGPP__) && !defined (__CYGWIN__)
 #      define stat _stat
+#    endif
 #  endif
 #endif
 #ifdef HAVE_STAT
@@ -598,7 +600,7 @@
        fd = _wfopen(wPath, mode ? L"wb" : L"rb");
        xmlFree(wPath);
     }
-    // maybe path in native encoding
+    /* maybe path in native encoding */
     if(fd == NULL)
        fd = fopen(path, mode ? "wb" : "rb");
 
@@ -626,7 +628,7 @@
        retval = _wstat(wPath,info);
        xmlFree(wPath);
     }
-    // maybe path in native encoding
+    /* maybe path in native encoding */
     if(retval < 0)
        retval = stat(path,info);
     return retval;


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