Web lists-archives.com

Re: Compile perl Win32::OLE module




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