Return-Path: Delivered-To: apmail-httpd-apreq-dev-archive@www.apache.org Received: (qmail 88043 invoked from network); 9 Sep 2005 10:39:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Sep 2005 10:39:27 -0000 Received: (qmail 23765 invoked by uid 500); 9 Sep 2005 10:39:26 -0000 Delivered-To: apmail-httpd-apreq-dev-archive@httpd.apache.org Received: (qmail 23454 invoked by uid 500); 9 Sep 2005 10:39:25 -0000 Mailing-List: contact apreq-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Id: Delivered-To: mailing list apreq-dev@httpd.apache.org Received: (qmail 23428 invoked by uid 99); 9 Sep 2005 10:39:24 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Sep 2005 03:39:24 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [217.205.167.84] (HELO styx.radan.com) (217.205.167.84) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 09 Sep 2005 03:39:37 -0700 Received: from unknown(217.205.167.82) by styx.radan.com via csmap id d4beccd4_211e_11da_96dd_0002b3cb43e0_17714; Fri, 09 Sep 2005 11:45:26 +0100 (BST) Received: from [10.23.50.136] (mugwump.uk.radan.com [10.23.50.136]) by sockeye.uk.radan.com (8.9.1b+Sun/8.9.1) with ESMTP id LAA18222; Fri, 9 Sep 2005 11:35:08 +0100 (BST) Message-ID: <432165FB.2060604@uk.radan.com> Date: Fri, 09 Sep 2005 11:37:47 +0100 From: Steve Hay User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Steve Hay CC: Randy Kobes , apreq-dev@httpd.apache.org, dev@perl.apache.org Subject: Re: [PATCH] Win32 doesn't have link() References: <43203654.9040100@uk.radan.com> <43213DD4.8040706@uk.radan.com> In-Reply-To: <43213DD4.8040706@uk.radan.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit X-NAIMIME-Disclaimer: 1 X-NAIMIME-Modified: 1 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Steve Hay wrote: >Having looked a little closer, I now think that I was wrong in saying >that PerlLIO_link() is simply mapped to link(). I said that because the >Param DLL affected failed to link with a linker error regarding the >unresolved external "link". When I ran Param.c through the C >preprocessor I found that "PerlLIO_link" had become "link". > >However, when I build the attached Foo module (using the same Perl, of >course) I find no such problems, and the CPP shows PerlLIO_link() is >mapped to win32_link() already. > >I'm struggling to figure out why PerlLIO_link() comes out differently >within the libapreq build. Any ideas why this might happen? > OK, having looked much more closely I've now figured out what the problem is. I'm not sure what to do about it, though. First, a quick explanation of my (limited) understanding of how PerlLIO_link() is setup. In the case where PERL_IMPLICIT_SYS is defined (as per ActivePerl configurations), perl's iperlsys.h has: #define PerlLIO_link(oldname, newname) \ (*PL_LIO->pLink)(PL_LIO, (oldname), (newname)) which basically resolves to a call to this in perl's perlhost.h: int PerlLIOLink(struct IPerlLIO* piPerl, const char*oldname, const char *newname) { return win32_link(oldname, newname); } Note that the symbol "link" isn't involved in any of that, which is why perls with PERL_IMPLICIT_SYS work OK. However, in the case where PERL_IMPLICIT_SYS is not defined (as per my perl configuration), perl's iperlsys.h instead has: #define PerlLIO_link(oldname, newname) link((oldname), (newname)) Also, note that perl's win32.h does *not* set WIN32IO_IS_STDIO in this case, which means that win32io.h does this: #define link win32_link Thus, in my case, we have the chain: PerlLIO_link => link => win32_link. Now for the fun bit. The Param.xs file in libapreq that I sent a (inappropriate) patch for includes "apreq_xs_postperl.h" after pulling in the Perl headers. That post-perl header in turn includes mod_perl's "modperl_perl_unembed.h" [hence I'm Cc'ing the mp dev list], which contains this: /* these three clash with apr bucket structure member names */ #undef link #undef read #undef free The first of those breaks the chain described above, leaving me with just PerlLIO_link => link, which isn't defined in the Win32 CRT, hence my linker error. Phew. Now the question is: What do we do about it? I can't think of a good answer myself right now, but I'll be very happy to test anything that others come up with. (I'm away next week; back on the 19th.) I'll keep scratching my head for ideas too. - Steve ------------------------------------------------ Radan Computational Ltd. The information contained in this message and any files transmitted with it are confidential and intended for the addressee(s) only. If you have received this message in error or there are any problems, please notify the sender immediately. The unauthorized use, disclosure, copying or alteration of this message is strictly forbidden. Note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of Radan Computational Ltd. The recipient(s) of this message should check it and any attached files for viruses: Radan Computational will accept no liability for any damage caused by any virus transmitted by this email.