From:             phoemix at harmless dot hu
Operating system: freebsd6, linux (but irrelevant)
PHP version:      5.2.0
PHP Bug Type:     Compile Failure
Bug description:  PHP's header files are unusable for C++ extensions

Description:
------------
(the php version is irrelevant, i just couldn't pick that for the "compile
failure" type. i had it on 4.x and on 5.x both"

create a new extensions, have a C++ source file, and include some php
headers. it will fail on two points.

1) C++ doesn't support "long long". lot's of architectures has stdint.h (i
think it's C99). that should be used instead of "long long"-ing manually.

2) C++ prohobits havint a trailing coma at the end of an enum's last
member.

i have created a patch for the FreeBSD ports system. the errors are in
snprintf.h and in php_stream_filter_api.h/.

--- patch follows ---
diff -ur php-5.2.0-orig/main/snprintf.h php-5.2.0/main/snprintf.h
--- php-5.2.0-orig/main/snprintf.h      Sun Jan  1 13:50:17 2006
+++ php-5.2.0/main/snprintf.h   Tue Nov 14 14:23:31 2006
@@ -120,8 +120,14 @@
 #else
 # define WIDE_INT              long
 #endif
+#ifdef __FreeBSD__
+#include <stdint.h>
+typedef int64_t wide_int;
+typedef uint64_t u_wide_int;
+#else
 typedef WIDE_INT wide_int;
 typedef unsigned WIDE_INT u_wide_int;
+#endif

 typedef int bool_int;

diff -ur php-5.2.0-orig/main/streams/php_stream_filter_api.h
php-5.2.0/main/streams/php_stream_filter_api.h
--- php-5.2.0-orig/main/streams/php_stream_filter_api.h Sun Jan  1
13:50:18 2006
+++ php-5.2.0/main/streams/php_stream_filter_api.h      Tue Nov 14
14:24:33 2006
@@ -62,7 +62,7 @@
 typedef enum {
        PSFS_ERR_FATAL, /* error in data stream */
        PSFS_FEED_ME,   /* filter needs more data; stop processing chain
until more is available */
-       PSFS_PASS_ON,   /* filter generated output buckets; pass them on
to next in chain */
+       PSFS_PASS_ON    /* filter generated output buckets; pass them on
to next in chain */
 } php_stream_filter_status_t;

 /* Buckets API. */


Reproduce code:
---------------
create a new extensions, have a C++ source file, and include some php
headers. it will fail on two points.

Expected result:
----------------
a clean compilation.

Actual result:
--------------
i don't have the error output yet, since my local version is fixed
manually.

-- 
Edit bug report at http://bugs.php.net/?id=39522&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39522&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39522&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39522&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39522&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39522&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39522&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39522&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39522&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39522&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39522&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39522&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39522&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39522&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39522&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39522&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39522&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39522&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39522&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39522&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39522&r=mysqlcfg

Reply via email to