ID:               40343
 User updated by:  php dot user at jeremy dot smallinfinity dot net
 Reported By:      php dot user at jeremy dot smallinfinity dot net
 Status:           Closed
 Bug Type:         Compile Failure
 Operating System: Mac OS X 10.4.8
 PHP Version:      5.2.0
 New Comment:

Yes; it works perfectly!  Thank you.

[Indeed, ext/tidy/tests/004, 6, 8, 10 and 12.phpt now pass instead of
failing with incorrect column numbers as they did when I commented out
the "typedef" in platform.h.] :)

Thanks again!

-- Jeremy


Previous Comments:
------------------------------------------------------------------------

[2007-02-06 12:06:12] [EMAIL PROTECTED]

patch applied to tidy sources. Please checkout tidy from cvs
(http://sf.net/cvs/?group_id=27659) and it should work.

------------------------------------------------------------------------

[2007-02-05 19:16:38] [EMAIL PROTECTED]

for reference:
http://sf.net/tracker/?func=detail&atid=390965&aid=1652657&group_id=27659

------------------------------------------------------------------------

[2007-02-03 16:04:11] php dot user at jeremy dot smallinfinity dot net

Description:
------------
RE Bug #36164 which describes the problem perfectly and to which I
would have added this comment had I been permitted to:

If I'm not mistaken, the problem is a name clash between
main/php_compat.h and /usr/include/tidy/tidy.h and I don't see why it
is the tidy developers who are responsible for this.

Specifically, ext/tidy/tidy.c first includes main/php_config.php (via
main/php.h -> main/php_compat.h),
which provides the definition

#define ulong unsigned long 

Then ext/tidy/tidy.c includes /usr/include/tidy/platform.h via
/usr/include/tidy/tidy.h.  But platform.h has the lines

#if defined(HPUX_OS) || defined(CYGWIN_OS) || defined(MAC_OS) ||
defined(BSD_BASED_OS) || defined(_WIN32)
typedef unsigned long ulong;
#endif

At least for the specified OS's, which includes Mac OS, this
combination of the #define in the php.h header with the typedef in the
tidy.h header results in the nonsensical "typedef unsigned long
unsigned long" which results in the reported (Bug #36164) compilation
error.

IMHO, and with all due respect to tony2001, the tidy developers would
be well within their rights to assert that they are not responsible for
a name clash with PHP, even if the simplest work around is to
incorporate a "!defined(ulong) && (...)" in the above excerpt from
tidy.h.  Indeed, if PHP is using tidy, and is creating the name clash,
is not PHP responsible for this?

Would it be possible to simply rearrange the #include's in tidy.c, so
that tidy.h precedes php.h, and also surround the "#define ulong..." in
php_config.h with an

#if !defined(__PLATFORM_H__) || !(defined(HPUX_OS) ||
defined(CYGWIN_OS) || defined(MAC_OS) || defined(BSD_BASED_OS) ||
defined(_WIN32))

as (I think) this would prevent the name clash?  Or perhaps there is an
even better solution?



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=40343&edit=1

Reply via email to