Req #30155 [Opn->Csd]: make the header files ISO C99 and ISO C++ compatible
Edit report at https://bugs.php.net/bug.php?id=30155&edit=1
ID: 30155
Updated by: levim@php.net
Reported by: phoemix at harmless dot hu
Summary: make the header files ISO C99 and ISO C++ compatible
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: *General Issues
-Operating System: *
+Operating System: Irrelevant
PHP Version: 5.0.1
-Assigned To:
+Assigned To: levim
Block user comment: N
Private report: N
New Comment:
I am fairly certain that you can now write an extension in C++ which seems to be the primary concern
of this ticket.
The 64 bit integer types is being worked on; see https://wiki.php.net/rfc/size_t_and_int64_next
Previous Comments:
------------------------------------------------------------------------
[2004-09-19 17:03:15] phoemix at harmless dot hu
Description:
------------
try to write an extension in C++ using the ISO C99 standard, gcc 3.3 or later is a good choice for
compiler.
Reproduce code:
---------------
standard skeleton extension code as a C++ code
Expected result:
----------------
build properly
Actual result:
--------------
1) use "const char **(*aliases)" instead of "const char *(*aliases)[]"
In file included from /usr/src/php-5.0.1/Zend/zend_globals.h:40,
from /usr/src/php-5.0.1/Zend/zend_list.h:26,
from /usr/src/php-5.0.1/Zend/zend_API.h:27,
from /usr/src/php-5.0.1/main/php.h:38,
from phpext/polylook.cc:6:
/usr/src/php-5.0.1/Zend/zend_multibyte.h:45: error: ISO C++ forbids zero-size array `aliases'
2) use system-declared 64bit integer types instead of hacking some own types. where you have
stdint.h use [u]int(8|16|32|64)_t instead of messing with (long )* int. these types are provided for
using them. include stdint.h, and use int64_t and uin64_t instead of long long [int]
/usr/src/php-5.0.1/main/snprintf.h:116: error: ISO C++ does not support `long long'
/usr/src/php-5.0.1/main/snprintf.h:117: error: ISO C++ does not support `long long'
3) just remove the trailing coma
/usr/src/php-5.0.1/main/streams/php_stream_filter_api.h:66: error: comma at end of enumerator list
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=30155&edit=1
Thread (2 messages)