public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Achim Gratz <Stromeko@nexgo.de>
To: cygwin@cygwin.com
Subject: Re: Compile perl Win32::OLE module
Date: Sat, 30 Mar 2019 08:11:00 -0000	[thread overview]
Message-ID: <87d0m893yl.fsf@Rainer.invalid> (raw)
In-Reply-To: <76301648869dbc361e8503e8ada2de43@plebeian.com> (Chris Wagner's	message of "Fri, 29 Mar 2019 18:21:28 -0400")

Chris Wagner writes:
> --- OLE.xs.bak  2019-03-29 16:29:52.225925700 -0400
> +++ OLE.xs      2019-03-29 16:35:28.756575400 -0400
> @@ -480,7 +480,7 @@
>
>      /* Check against local computer name (from registry) */
>      if (GetComputerNameA(szComputerName, &dwSize)
> -        && stricmp(pszName, szComputerName) == 0)
> +        /* for a hostname up to 1024 characters */
> +        && strncmp(pszName, szComputerName, 1024) == 0)
>      {
>          return TRUE;
>      }

The canonical replacement for stricmp is strcasecmp on POSIX systems.

While that lets the XS module compile provided you ignore some of the
many warnings that are usually treated as errors (which in turn requires
that you modify the generated Makefile since the default options
MakeMaker uses come from the immutable %Config::Config hash), it is
unlikely to work at 64bit.  The two errors that make it fail are easily
fixed, though, but you still might have to remove the stack protector.
I no longer have the necessary program versions to test it, but last I
did it was limping along on Win7 in combination with a 32bit Cygwin
install.  The module is effectively dead upstream, so there's not much
point in trying to use it.


perl-Win32-OLE.cygport:
--8<---------------cut here---------------start------------->8---
NAME="perl-Win32-OLE"
VERSION="0.1712"
RELEASE="1"
CPAN_AUTHOR="JDB"
DESCRIPTION="Perl distribution Win32-OLE, providing Perl modules:
OLE OLE::Tie OLE::Variant Win32::OLE Win32::OLE::Const Win32::OLE::Enum
Win32::OLE::NLS Win32::OLE::Tie Win32::OLE::TypeInfo Win32::OLE::Variant.

OLE Automation extensions."

DIFF_EXCLUDES="MYMETA.*"

NO_PERL_DEPS=1
inherit perl
--8<---------------cut here---------------end--------------->8---

perl-Win32-OLE.src.patch:
--8<---------------cut here---------------start------------->8---
--- origsrc/Win32-OLE-0.1712/Makefile.PL	2013-12-11 23:25:13.000000000 +0100
+++ src/Win32-OLE-0.1712/Makefile.PL	2019-03-30 08:56:28.164392300 +0100
@@ -29,7 +33,7 @@ WriteMakefile(%param);
 sub MY::xs_c {
     '
 .xs.cpp:
-	$(PERL) -I$(PERL_ARCHLIB) -I$(PERL_LIB) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >xstmp.c && $(MV) xstmp.c $*.cpp
+	$(PERL) $(XSUBPP) $(XSPROTOARG) $(XSUBPPARGS) $*.xs >xstmp.c && $(MV) xstmp.c $*.cpp
 ';
 }
 
--- origsrc/Win32-OLE-0.1712/OLE.xs	2014-05-15 00:34:17.000000000 +0200
+++ src/Win32-OLE-0.1712/OLE.xs	2019-03-30 09:05:23.035589100 +0100
@@ -480,7 +480,7 @@ IsLocalMachine(pTHX_ SV *host)
 
     /* Check against local computer name (from registry) */
     if (GetComputerNameA(szComputerName, &dwSize)
-        && stricmp(pszName, szComputerName) == 0)
+        && strcasecmp(pszName, szComputerName) == 0)
     {
         return TRUE;
     }
@@ -922,12 +922,12 @@ ReportOleError(pTHX_ HV *stash, HRESULT
 	if (warnlvl < 3) {
 	    cv = perl_get_cv("Carp::carp", FALSE);
 	    if (!cv)
-		warn(SvPVX(sv));
+	      warn("%s", SvPVX(sv));
 	}
 	else {
 	    cv = perl_get_cv("Carp::croak", FALSE);
 	    if (!cv)
-		croak(SvPVX(sv));
+	      croak("%s", SvPVX(sv));
 	}
     }
 
--8<---------------cut here---------------end--------------->8---


Regards,
Achim.
-- 
+<[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]>+

Factory and User Sound Singles for Waldorf rackAttack:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

      parent reply	other threads:[~2019-03-30  8:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-29 19:56 Massimo Balestra
2019-03-29 22:21 ` Chris Wagner
2019-03-30  1:43   ` Massimo Balestra
2019-03-30  1:51     ` Chris Wagner
2019-03-30  8:11   ` Achim Gratz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0m893yl.fsf@Rainer.invalid \
    --to=stromeko@nexgo.de \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).