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

2006-09-06  Andrew W. Nosenko  <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).
        * xmlIO.c:
        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;
   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'

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

Andrew W. Nosenko <andrew w nosenko gmail com>

Attachment: libxml2.xmlIO.awn.1.patch
Description: Text Data

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