#include "EXTERN.h"
#include "perl.h"
+#include "win32.h"
#ifdef PERL_OBJECT
#define NO_XSLOCKS
#include "XSUB.h"
+static SV *error_sv;
+
+static char *
+OS_Error_String(CPERLarg)
+{
+ DWORD err = GetLastError();
+ STRLEN len;
+ if (!error_sv)
+ error_sv = newSVpvn("",0);
+ win32_str_os_error(error_sv,err);
+ return SvPV(error_sv,len);
+}
+
#include "dlutils.c" /* SaveError() etc */
static void
dl_private_init(CPERLarg)
{
- (void)dl_generic_private_init(THIS);
+ (void)dl_generic_private_init(PERL_OBJECT_THIS);
}
/*
MODULE = DynaLoader PACKAGE = DynaLoader
BOOT:
- (void)dl_private_init(THIS);
+ (void)dl_private_init(PERL_OBJECT_THIS);
void *
dl_load_file(filename,flags=0)
DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
- SaveError(THIS_ "%d",GetLastError()) ;
+ SaveError(PERL_OBJECT_THIS_ "load_file:%s",
+ OS_Error_String(PERL_OBJECT_THIS)) ;
else
sv_setiv( ST(0), (IV)RETVAL);
DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref = %x\n", RETVAL));
ST(0) = sv_newmortal() ;
if (RETVAL == NULL)
- SaveError(THIS_ "%d",GetLastError()) ;
+ SaveError(PERL_OBJECT_THIS_ "find_symbol:%s",
+ OS_Error_String(PERL_OBJECT_THIS)) ;
else
sv_setiv( ST(0), (IV)RETVAL);