Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: problem installing DBD::Pg

by Anonymous Monk
on Jan 23, 2020 at 08:59 UTC ( [id://11111755]=note: print w/replies, xml ) Need Help??


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

There's only the one instance of "errno" in the entire DBD::Pg source, so I'm guessing there's no harm in removing that one and only instance at line 14 of Pg.h. Or am I missing something ?

https://github.com/bucardo/dbdpg/blame/master/Pg.h says it was added in 2002

oldest rt.cpan.org report is from 2004,

first mention around 2000 with Visual Studio 6.0 as prerequisite

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

Replies are listed 'Best First'.
Re^5: problem installing DBD::Pg
by syphilis (Archbishop) on Jan 23, 2020 at 10:59 UTC
    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
      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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-26 03:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found