#40343 [Opn]: compile with --with-tidy fails
| From: | nlopess@php.net | Date: | Mon, 05 Feb 2007 19:16:38 +0000 |
| Subject: | #40343 [Opn]: compile with --with-tidy fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-108438@lists.php.net to get a copy of this message | ||
ID: 40343
Updated by: nlopess@php.net
Reported By: php dot user at jeremy dot smallinfinity dot net
Status: Open
Bug Type: Compile Failure
Operating System: Mac OS X 10.4.8
PHP Version: 5.2.0
New Comment:
for reference:
http://sf.net/tracker/?func=detail&atid=390965&aid=1652657&group_id=27659
Previous Comments:
------------------------------------------------------------------------
[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