2006-09-06  Andrew W. Nosenko  <[EMAIL PROTECTED]>

        * 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).
        * xmlIO.c:
        (xmlWrapOpenUtf8):
        (xmlWrapStatUtf8):
        don't use c++ style comment -- make 'gcc -pedantic' happy.

Some words about removed '#define stat _stat':

1. this define is just wrong because replaces declarations like
   struct stat stat_buff;
by
   struct _stat stat_buff;
and we have either compilation error (if no 'struct _stat' exists) or
unpredictable behavior because of no guarantee that these two
structures are compatible.  Yes, It can be avoided by rewriting this
"plain" macro as "function-like" macro, but see following item #2.

2. existence of the non-standard function _stat() is not a reason for
replacing by it the standard function stat() that exists also (please,
pay attention that this is '#else' part of the '#ifndef HAVE_STAT'
condition).

Therefore I preferred to remove this '#define stat _stat' instead of
rewriting it from "plain" macro to "function-like" macro.

--
Andrew W. Nosenko <[EMAIL PROTECTED]>
2006-09-06  Andrew W. Nosenko  <[EMAIL PROTECTED]>

	* 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).
	* xmlIO.c:
	(xmlWrapOpenUtf8):
	(xmlWrapStatUtf8): 
	don't use c++ style comment -- make 'gcc -pedantic' happy.

Index: xmlIO.c
===================================================================
RCS file: /cvs/gnome/libxml2/xmlIO.c,v
retrieving revision 1.172
diff -u -p -r1.172 xmlIO.c
--- xmlIO.c	1 Sep 2006 09:56:07 -0000	1.172
+++ xmlIO.c	6 Sep 2006 13:04:32 -0000
@@ -50,10 +50,6 @@
 #    endif
 #    define HAVE_STAT
 #  endif
-#else
-#  ifdef HAVE__STAT
-#      define stat _stat
-#  endif
 #endif
 #ifdef HAVE_STAT
 #  ifndef S_ISDIR
@@ -598,7 +594,7 @@ xmlWrapOpenUtf8(const char *path,int mod
        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 +622,7 @@ xmlWrapStatUtf8(const char *path,struct 
        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;
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xml@gnome.org
http://mail.gnome.org/mailman/listinfo/xml

Reply via email to