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

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

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