From: php dot user at jeremy dot smallinfinity dot net Operating system: Mac OS X 10.4.8 PHP version: 5.2.0 PHP Bug Type: Compile Failure Bug description: compile with --with-tidy fails
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 bug report at http://bugs.php.net/?id=40343&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=40343&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=40343&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=40343&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=40343&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=40343&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=40343&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=40343&r=needscript Try newer version: http://bugs.php.net/fix.php?id=40343&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=40343&r=support Expected behavior: http://bugs.php.net/fix.php?id=40343&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=40343&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=40343&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=40343&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40343&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=40343&r=dst IIS Stability: http://bugs.php.net/fix.php?id=40343&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=40343&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=40343&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=40343&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=40343&r=mysqlcfg