Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:76826 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53118 invoked from network); 23 Aug 2014 02:10:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 23 Aug 2014 02:10:21 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.216 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.216 imap10-3.ox.privateemail.com Received: from [192.64.116.216] ([192.64.116.216:51864] helo=imap10-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 99/71-39740-C08F7F35 for ; Fri, 22 Aug 2014 22:10:21 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id B6E1B2400DA; Fri, 22 Aug 2014 22:10:16 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap10.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap10.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id wRQm1jeBGEaa; Fri, 22 Aug 2014 22:10:16 -0400 (EDT) Received: from [192.168.0.2] (05439dda.skybroadband.com [5.67.157.218]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 5112D2400D7; Fri, 22 Aug 2014 22:10:13 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: <53F7F6ED.1050609@lerdorf.com> Date: Sat, 23 Aug 2014 03:10:07 +0100 Cc: Pierre Joye , PHP internals , Nikita Popov Content-Transfer-Encoding: quoted-printable Message-ID: References: <53F7F6ED.1050609@lerdorf.com> To: Rasmus Lerdorf X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] Better type names for int64 RFC From: ajf@ajf.me (Andrea Faulds) On 23 Aug 2014, at 03:05, Rasmus Lerdorf wrote: > The end result here is likely that in order to write a portable > extension, extension authors will simply do: >=20 > #ifndef IS_LONG > # define IS_LONG IS_INT > # define Z_STRLEN Z_STRSIZE > # define RETURN_LONG RETURN_INT > # define RETVAL_LONG RETVAL_INT > # define Z_LVAL Z_IVAL > ... > #endif >=20 > and not change a single macro anywhere in the actual code. That=92s a very good point. It=92s easy to forget that many people write = cross-version compatible extensions. > That's certainly what I would do. And if the current naming survives = we > should provide a macro_compat.h file with the complete set. Perhaps we could backport the new types, too, and make them just aliases = on older PHP versions? For example, zend_int would be a long in 5.5 and 5.6, but a = 64-bit-on-64-bit type on 7. > Overall I don't think trying to make the macro names match the > underlying types exactly is worth the hassle here. Our audience for = this > is extension authors. In most cases the author doesn't necessarily = care > about the subtle differences between calling it IS_LONG and IS_INT and = I > don't think it actually makes it any more clear to a C developer. = "int" > is not a well-defined cross-platform type anymore than a "long" is. So > we are swapping one set of vague names for another set of vague names. > I'd much rather see a nice clear README.TYPES or perhaps it is simply > part of the existing README.PARAMETER_PARSING_API which defines = exactly > what these various macros mean. +1 to that. -- Andrea Faulds http://ajf.me/