On Sat, 19 May 2007, Jerry D. Hedden wrote:
> Jan Dubois wrote:
> > It would be trivial to make $^E work on
"cygwin" the same
> > way it works on "MSWin32". I think this
is more useful
> > than having $^E being an alias for $!.
>
> Jerry D. Hedden wrote:
> > The attached patch uses Jan's code and updates
perlvar.pod
> > accordingly.
>
> Steve Hay wrote:
> > So does the test now pass for you with this
patch?
>
> Actually, that patch was no good. It wouldn't
compile.
> As is, it produced:
>
> mg.c: In function `Perl_magic_get':
> mg.c:755: error: syntax error before "dwErr"
> mg.c:756: error: `dwErr' undeclared (first use in this
function)
> mg.c:756: error: (Each undeclared identifier is
reported only once
> mg.c:756: error: for each function it appears in.)
> mg.c:758: warning: implicit declaration of function
`PerlProc_GetOSError'
> mg.c:762: warning: implicit declaration of function
`SetLastError'
> make: *** [mg.o] Error 1
[...]
> The whole test should just be skipped under Cygwin.
I'm fine with the test being skipped under Cygwin, as the
functionality
is being tested sufficiently by the MSWin32 builds.
A separate question is if Cygwin should have the $^E
functionality of
the MSWin32 builds. I still think it can be made to work,
even though
the PerlProc_GetOSError() call means we would have to copy
win32_str_os_error() from win32/win32.c to mg.c for the
Cygwin case
(or preferably to Cygwin/Cygwin.c).
On the other hand $^E is just syntactic sugar; you can
access all the
functionality via Win32::GetLastError(),
Win32::SetLastError() and
Win32::FormatMessage().
So if Yitzchak or Reini think Cygwin should support the $^E
interface to
[GS]etLastError(), then I'll try to come up with a patch
that will
actually compile.
Cheers,
-Jan
|