develooper Front page | perl.perl5.porters | Postings from February 2015

Re: [perl #123727] [PATCH] INTERN/EXTERN C++ cleanup

Thread Previous
From:
Steve Hay
Date:
February 9, 2015 09:10
Subject:
Re: [perl #123727] [PATCH] INTERN/EXTERN C++ cleanup
Message ID:
CADED=K7b1Q5vCEac_iMC8Ji+0K+WdEXNfXTxvEyxX=wjM3cE+w@mail.gmail.com
On 4 February 2015 at 07:18, bulk88 <perlbug-followup@perl.org> wrote:
> # New Ticket Created by  bulk88
> # Please include the string:  [perl #123727]
> # in the subject line of all future correspondence about this issue.
> # <URL: https://rt.perl.org/Ticket/Display.html?id=123727 >
>
>
> This is a bug report for perl from bulk88@hotmail.com,
> generated with the help of perlbug 1.40 running under perl 5.21.4.
>
>
> -----------------------------------------------------------------
> [Please describe your issue here]
>
> This patch never got any comments in its its original thread at
> http://www.nntp.perl.org/group/perl.perl5.porters/2015/01/msg225087.html
> , so I am filing it as a ticket. It is not intended to be committed as
> is (no commit body for example).
>

A couple of thoughts, without having tested it yet:

I don't think the comment "Win32 GCC errors out with
"..\perl.h:4614:35: error: expected unqualified-id before string
constant" if dllexport is first, then EXTERN_C" in INTERN.h is
necessary. That's normal, isn't it? The extern "C" always has to be
first, e.g. VC++ also errors with: "'__declspec(dllexport)' :
storage-class or type specifier(s) unexpected here; ignored. 'linkage
specification' requires use of keyword 'extern' and must precede all
other specifiers".

I've stared at the line

#  if (defined(WIN32) && defined(__MINGW32__)) || defined(__SYMBIAN32__)

in INTERN.h before and wondered why something different is done for
MinGW compared to VC++ on Windows. Why do we have all the dllexport
stuff for MinGW but not for VC++? Couldn't the line change either to
"#if defined(WIN32) || defined(__SYMBIAN32__)" or to "#ifdef
__SYMBIAN32__"?

Otherwise it looks good to me, except for the "#ifdef DOINIT" part in
perl.h, which I didn't understand. I see that it's defining variables
after their declarations, but it's not obvious to me why this is
necessary now.

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About