Silence noise from Errno_pm.PL on Windows
authorSteve Hay <steve.m.hay@googlemail.com>
Sat, 7 Sep 2013 22:44:38 +0000 (23:44 +0100)
committerSteve Hay <steve.m.hay@googlemail.com>
Mon, 16 Sep 2013 14:37:37 +0000 (15:37 +0100)
A block of warnings like this appears when building Errno with VC++:

Number found where operator expected at (eval 633) line 1, near ")0xC0000093"
        (Missing operator before 0xC0000093?)

This is caused by #defines like these in the Windows header files:

WinBase.h:#define EXCEPTION_FLT_UNDERFLOW STATUS_FLOAT_UNDERFLOW
WinNT.h:#define STATUS_FLOAT_UNDERFLOW ((DWORD   )0xC0000093L)

and can be silenced by teaching Errno_pm.PL about the otherwise unexpected
whitespace immediately after "DWORD" in the cast.

ext/Errno/Errno_pm.PL

index 776a5e5..bb41e03 100644 (file)
@@ -245,7 +245,7 @@ sub write_errno_pm {
            my($name,$expr);
            next unless ($name, $expr) = /"(.*?)"\s*\[\s*\[\s*(.*?)\s*\]\s*\]/;
            next if $name eq $expr;
-           $expr =~ s/\(?\([a-z_]\w*\)([^\)]*)\)?/$1/i; # ((type)0xcafebabe) at alia
+           $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
            next if $expr =~ m/^[a-zA-Z]+$/; # skip some Win32 functions
            if($expr =~ m/^0[xX]/) {