Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86498 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62070 invoked from network); 5 Jun 2015 14:46:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 5 Jun 2015 14:46:53 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 74.125.82.43 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.43 mail-wg0-f43.google.com Received: from [74.125.82.43] ([74.125.82.43:34541] helo=mail-wg0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7F/E0-54427-C56B1755 for ; Fri, 05 Jun 2015 10:46:52 -0400 Received: by wgv5 with SMTP id 5so58715949wgv.1 for ; Fri, 05 Jun 2015 07:46:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=qlImr42N3YjKiZEZCyJ+BrAEq0ZY2jfwCrWVG8xcNhA=; b=qdbmfmFMbU7QKlG/f9+dEooo8O4qrwKGP5qyvbdLfUqgHGdut+6+yNpZx1/NyG6DQr hf33PD5chQ5qcTxugodkbCP+TXQoGsYdCaW/QIRdMSvNafXIZ1H7LouzaW8wYqvA0cOZ 6V6gzjU1GYaPtL54BosA1GIABPfMGGYnWc71nNPyP9j06jXQZboWJ/ix4xAA13at/gkE yyHRcX6SnHgNe5nBk6R4E10V5SPsfPGJSSrof77wTVR0klatDdee37VrLFTtYostnceV i/BQO82X3bv66kR81HttDVnHw6t7TTgBUN9dYXVg0flmuF1gKHLWIY6BRjnl5lqGbB70 3fMg== X-Received: by 10.181.13.172 with SMTP id ez12mr18410387wid.91.1433515609554; Fri, 05 Jun 2015 07:46:49 -0700 (PDT) Received: from [192.168.0.159] ([62.189.198.114]) by mx.google.com with ESMTPSA id hn7sm10913156wjc.16.2015.06.05.07.46.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Jun 2015 07:46:48 -0700 (PDT) Message-ID: <5571B60A.3090609@gmail.com> Date: Fri, 05 Jun 2015 15:45:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: internals@lists.php.net References: In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] offsetof and XtOffsetOf From: rowan.collins@gmail.com (Rowan Collins) Levi Morrison wrote on 05/06/2015 14:58: > On Thu, Jun 4, 2015 at 11:58 PM, Joe Watkins wrote: >> Explained here: http://lxr.php.net/xref/PHP_TRUNK/main/php.h#415 >> >> >> On Fri, Jun 5, 2015 at 5:06 AM, Levi Morrison wrote: >>> The macro offsetof is required by the C89 standard to be defined in >>> stddef.h and remains in newer standards. The macro XtOffsetOf is >>> non-standard that is as far as I can tell a part of the X Toolkit >>> Intrinsics or Xlib. >>> >>> Does anyone know the reasons why we are using the non-standard macro >>> instead of the standard one? > Thanks, Joe. However, that code just explains why are macros are that > way. It doesn't justify the use of XtOffsetOf over offsetof, just how > the ifdefs were obtained. > If I read it right, it's just a polyfill - if offsetof is defined, XtOffsetOf is just made an alias of it on line 444. Presumably, contra the standard, there are some implementations that don't (or didn't) define it. Regards, -- Rowan Collins [IMSoP]