Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PATCH] Errno.pm is missing a ton of values on Windows when built with MinGW-w64-4.8.0 #13789

Closed
p5pRT opened this issue Apr 30, 2014 · 5 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 30, 2014

Migrated from rt.perl.org#121773 (status was 'resolved')

Searchable as RT121773$

@p5pRT
Copy link
Author

p5pRT commented Apr 30, 2014

From @steve-m-hay

When building blead with MinGW-w64-4.8.0 I see hundreds of lines like this come out from the Errno build​:

Bareword found where operator expected at (eval 22) line 1, near "13834l"
  (Missing operator before l?)

This doesn't happen with MinGW-w64-4.7.4 or earlier, or MinGW, or VC++.

The change in behaviour is due to changes in the MinGW-w64 headers. E.g. 4.7.4 has​:

#define ERROR_IPSEC_IKE_PROCESS_ERR_ID 13834L

but now 4.8.0 has​:

#define ERROR_IPSEC_IKE_PROCESS_ERR_ID __MSABI_LONG(13834)
#define __MSABI_LONG(x) x ## l

The lowercase "l" rather than uppercase "L" trips up Errno_pm.PL. The attached patch fixes this, and I think it should be a 5.20 blocker -- as the attached Errnos.tar.gz shows, the difference between the 4.7.4-generated Errno.pm and the original (i.e. current) 4.8.0-generated Errno.pm is HUGE. The fixed 4.8.0-generated Errno.pm is much more like it.

@p5pRT
Copy link
Author

p5pRT commented Apr 30, 2014

From @steve-m-hay

Errno.patch
diff --git a/ext/Errno/Errno_pm.PL b/ext/Errno/Errno_pm.PL
index db8ada7..55ad01a 100644
--- a/ext/Errno/Errno_pm.PL
+++ b/ext/Errno/Errno_pm.PL
@@ -2,7 +2,7 @@ use ExtUtils::MakeMaker;
 use Config;
 use strict;
 
-our $VERSION = "1.20_02";
+our $VERSION = "1.20_03";
 
 my %err = ();
 
@@ -250,7 +250,7 @@ sub write_errno_pm {
 	    next unless ($name, $expr) = /"(.*?)"\s*\[\s*\[\s*(.*?)\s*\]\s*\]/;
 	    next if $name eq $expr;
 	    $expr =~ s/\(?\(\s*[a-z_]\w*\s*\)([^\)]*)\)?/$1/i; # ((type)0xcafebabe) at alia
-	    $expr =~ s/((?:0x)?[0-9a-fA-F]+)[LU]+\b/$1/g; # 2147483647L et alia
+	    $expr =~ s/((?:0x)?[0-9a-fA-F]+)[luLU]+\b/$1/g; # 2147483647L et alia
 	    next if $expr =~ m/^[a-zA-Z]+$/; # skip some Win32 functions
 	    if($expr =~ m/^0[xX]/) {
 		$err{$name} = hex $expr;

@p5pRT
Copy link
Author

p5pRT commented Apr 30, 2014

From @steve-m-hay

Errnos.tar.gz

@p5pRT
Copy link
Author

p5pRT commented May 3, 2014

From @steve-m-hay

Applied in commit f974e9b.

@p5pRT
Copy link
Author

p5pRT commented May 3, 2014

@steve-m-hay - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant