Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^5: problem installing DBD::Pg

by syphilis (Archbishop)
on Jan 23, 2020 at 10:59 UTC ( [id://11111766]=note: print w/replies, xml ) Need Help??


in reply to Re^4: problem installing DBD::Pg
in thread problem installing DBD::Pg

So add something like #if _MSC_VER == 1200 ... #endif so its only added where it was historically needed

I have Visual Studio 6.0 and I have an ActiveState build of perl-5.16.0 that was built with Visual Studio 6.0.
I see exactly the same behaviour when I run my Inline::C script on that build of perl, using Visual Studio 6.0.

I can't see that the inclusion of that static declaration would ever have been anything other than a fatal build-time error.
And yet, DBD::Pg-3.8.0 (which includes that static declaration) ships with latest Strawberry Perl.
Did Strawberry Perl developers remove that declaration in order to build DBD::Pg ?
Could someone check http://strawberryperl.com/package/kmx/perl-modules-patched/ and see if there's any mention of patches to DBD::Pg. (I'm unable to access that page.)

Cheers,
Rob

Replies are listed 'Best First'.
Re^6: problem installing DBD::Pg
by Tux (Canon) on Jan 23, 2020 at 12:06 UTC
    strawberry-patched $ cat DBD-Pg-3.7.4_patched.diff diff -ru DBD-Pg-3.7.4/Pg.h DBD-Pg-3.7.4_patched/Pg.h --- DBD-Pg-3.7.4/Pg.h 2018-02-04 17:02:47.000000000 +0100 +++ DBD-Pg-3.7.4_patched/Pg.h 2018-04-07 17:59:19.010783900 +0200 @@ -14,9 +14,11 @@ static int errno; #include <string.h> #define strcasecmp(s1,s2) stricmp((s1), (s2)) +#ifndef __USE_MINGW_ANSI_STDIO #ifndef snprintf #define snprintf _snprintf #endif +#endif #else #include <strings.h> #endif

    Enjoy, Have FUN! H.Merijn
      Hmph ... beats me how they get away with leaving the static int errno; declaration in there.
      I must be missing something.

      Having only just now discovered that I can actually build DBD::Pg myself on Strawberry Perl 5.30.0, I've just checked and found that DBD-Pg-3.10.3 builds ok straight out of the box, even though the problematic declaration exists.
      It also builds ok if I remove the problematic declaration.

      I can see that, for my own peace of mind, I'm going to have to understand why it's not necessary to remove the declaration for this Strawberry Perl. (The Inline::C script that I provided earlier blows up on Strawberry Perl - just like on every other Windows perl that I've tried.)
      But it's late over here, so further investigation will have to wait until some time tomorrow.

      Thanks for checking, Tux.

      Cheers,
      Rob
        further investigation will have to wait until some time tomorrow

        Seems that, if you make the static int errno; declaration before the perl headers (xsub.h, extern.h, perl.h) are included, then there's no problem with it.
        And looking at the generated Pg.c, it seems that at the time of that declaration, the only header that has been included is wchar.h (plus whatever other headers it pulls in).
        However, I'm still a little puzzled as to why the OP's MS compiler saw fit to complain. (Maybe, with that particular compiler, the inclusion of wchar.h also pulled in errno.h.)

        Cheers,
        Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111766]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-20 08:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found