There is a header file with PHP type's definition: /Zend/zend_types.h

It consists following types:
-------------------------------
typedef unsigned char zend_bool;
typedef unsigned char zend_uchar;
typedef unsigned int zend_uint;
typedef unsigned long zend_ulong;
typedef unsigned short zend_ushort;
-------------------------------

I propose to add several new types with EXACT bit length into this file:
-------------------------------
typedef __int8 zend_int8;
typedef __int16 zend_int16;
typedef __int32 zend_int32;
typedef __int64 zend_int64;
typedef unsigned __int8 zend_uint8;
typedef unsigned __int16 zend_uint16;
typedef unsigned __int32 zend_uint32;
typedef unsigned __int64 zend_uint64;
-------------------------------

If compiler does not support some __int* types, (for example, __int64),
we can deal it before zend_* types definition.
For example:
-------------------------------------
#ifdef COMPILERS_WITHOUT_INT64_TYPE
typedef long long __int64;
#endif
-------------------------------------

Then in other places of PHP sources:
 - if we need EXACT 8bit integers, we must use zend_int8 type
 - if we need EXACT 16bit integers, we must use zend_int16 type.
 etc...

It solves such problems as "int is 64bit on FOO compiler"
or "long is 32bit on BAR compiler".

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to