diff --git a/File.xs b/File.xs index 83971d0..7a94b48 100644 --- a/File.xs +++ b/File.xs @@ -1,13 +1,15 @@ /* Win32API/File.xs */ - +#define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" /*#include "patchlevel.h"*/ /* Uncomment the next line unless set "WRITE_PERL=>1" in Makefile.PL: */ -#define NEED_newCONSTSUB -#include "ppport.h" +#ifdef USE_PPPORT_H +# define NEED_newCONSTSUB +# include "ppport.h" +#endif #ifdef WORD # undef WORD @@ -57,6 +59,7 @@ static void ErrPrintf( const char *sFmt, ... ) { + dTHX; va_list pAList; static char *sEnv= NULL; DWORD uErr= GetLastError(); diff --git a/Makefile.PL b/Makefile.PL index 039eee7..ce81908 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -15,6 +15,7 @@ WriteMakefile1( ( $Config{archname} =~ /-object\b/i ? ( 'CAPI' => 'TRUE' ) : () ), 'AUTHOR' => 'Tye McQueen ', 'ABSTRACT_FROM' => 'File.pm', + 'DEFINE' => ($ENV{PERL_CORE} ? '' : '-DUSE_PPPORT_H'), 'postamble' => { IMPORT_LIST => [qw(/._/ !/[a-z]/ :MEDIA_TYPE)], IFDEF => "!/[a-z\\d]/", CPLUSPLUS => 1,