Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:10582 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 20744 invoked by uid 1010); 18 Jun 2004 08:09:22 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 20713 invoked by uid 1007); 18 Jun 2004 08:09:22 -0000 To: internals@lists.php.net Date: Fri, 18 Jun 2004 11:08:54 +0300 References: <40D16253.4000003@php.net> Organization: none Content-Type: text/plain; format=flowed; delsp=yes; charset=koi8-r MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: User-Agent: Opera M2/7.50 (Win32, build 3778) X-Posted-By: 217.23.116.150 Subject: Re: 64-bit bugsquash From: valyala@tut.by ("Alexander Valyalkin") 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/