From: Gurusamy Sarathy Date: Sat, 20 Jun 1998 21:48:32 +0000 (+0000) Subject: manual integration of all outstanding ansi branch stuff into mainline X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eda5ff319dcb749e45b560057fa141edfd70ae33;p=p5sagit%2Fp5-mst-13.2.git manual integration of all outstanding ansi branch stuff into mainline p4raw-id: //depot/perl@1162 --- diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index fd27b11..a4fd52e 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -275,8 +275,10 @@ unsigned long strtoul _((const char *, char **, int)); extern char *tzname[]; # endif #else +#if !defined(__GNUC__) && !defined(tzname) char *tzname[] = { "" , "" }; #endif +#endif /* XXX struct tm on some systems (SunOS4/BSD) contains extra (non POSIX) * fields for which we don't have Configure support yet: diff --git a/lib/ExtUtils/MM_Win32.pm b/lib/ExtUtils/MM_Win32.pm index 299855b..fd4b28d 100644 --- a/lib/ExtUtils/MM_Win32.pm +++ b/lib/ExtUtils/MM_Win32.pm @@ -458,7 +458,7 @@ sub perl_archive return '$(PERL_INC)\perlcore$(LIB_EXT)'; } } - return '$(PERL_INC)\perl$(LIB_EXT)'; + return '$(PERL_INC)\\'.$Config{'libperl'}; } sub export_list diff --git a/t/op/ipcsem.t b/t/op/ipcsem.t index a1450ff..55e8104 100755 --- a/t/op/ipcsem.t +++ b/t/op/ipcsem.t @@ -108,11 +108,6 @@ BEGIN { use strict; -# This test doesn't seem to work properly yet so skip it for _65 -print "1..0\n"; -exit; - - print "1..10\n"; my $sem = semget($IPC_PRIVATE, 10, $S_IRWXU | $S_IRWXG | $S_IRWXO | $IPC_CREAT); diff --git a/win32/config.gc b/win32/config.gc index b98a55e..1dfc04b 100644 --- a/win32/config.gc +++ b/win32/config.gc @@ -14,9 +14,9 @@ Revision='$Revision' SUBVERSION='~SUBVERSION~' Source='' State='' -_a='.lib' +_a='.a' _exe='.exe' -_o='.obj' +_o='.o' afs='false' alignbytes='8' aphostname='' @@ -383,8 +383,8 @@ ld='gcc' lddlflags='-mdll ~LINK_FLAGS~' ldflags='~LINK_FLAGS~' less='less' -lib_ext='.lib' -libc='msvcrt.lib' +lib_ext='.a' +libc='libcrtdll.a' libperl='libperl.a' libpth='' libs='' diff --git a/win32/dl_win32.xs b/win32/dl_win32.xs index d721731..a5183c3 100644 --- a/win32/dl_win32.xs +++ b/win32/dl_win32.xs @@ -26,6 +26,7 @@ calls. #include "EXTERN.h" #include "perl.h" +#include "win32.h" #ifdef PERL_OBJECT #define NO_XSLOCKS @@ -33,6 +34,19 @@ calls. #include "XSUB.h" +static SV *error_sv; + +static char * +OS_Error_String(void) +{ + DWORD err = GetLastError(); + STRLEN len; + if (!error_sv) + error_sv = newSVpv("",0); + win32_str_os_error(error_sv,err); + return SvPV(error_sv,len); +} + #include "dlutils.c" /* SaveError() etc */ static void @@ -96,7 +110,7 @@ dl_load_file(filename,flags=0) DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," libref=%x\n", RETVAL)); ST(0) = sv_newmortal() ; if (RETVAL == NULL) - SaveError(PERL_OBJECT_THIS_ "%d",GetLastError()) ; + SaveError(PERL_OBJECT_THIS_ "load_file:%s",OS_Error_String()) ; else sv_setiv( ST(0), (IV)RETVAL); @@ -112,7 +126,7 @@ dl_find_symbol(libhandle, symbolname) DLDEBUG(2,PerlIO_printf(PerlIO_stderr()," symbolref = %x\n", RETVAL)); ST(0) = sv_newmortal() ; if (RETVAL == NULL) - SaveError(PERL_OBJECT_THIS_ "%d",GetLastError()) ; + SaveError(PERL_OBJECT_THIS_ "find_symbol:%s",OS_Error_String()) ; else sv_setiv( ST(0), (IV)RETVAL); diff --git a/win32/makefile.mk b/win32/makefile.mk index 090e864..d41d588 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -162,12 +162,13 @@ LIBOUT_FLAG = .ELIF "$(CCTYPE)" == "GCC" -CC = gcc -pipe -LINK32 = gcc -pipe +CC = gcc +LINK32 = gcc LIB32 = ar rc IMPLIB = dlltool o = .o +a = .a # # Options @@ -262,6 +263,7 @@ CFLAGS_O = $(CFLAGS) $(OBJECT) ############# NO USER-SERVICEABLE PARTS BEYOND THIS POINT ############## o *= .obj +a *= .lib LKPRE = INPUT ( LKPOST = ) @@ -270,7 +272,7 @@ LKPOST = ) # Rules # -.SUFFIXES : .c $(o) .dll .lib .exe .a +.SUFFIXES : .c $(o) .dll $(a) .exe .c$(o): $(CC) -c $(null,$(<:d) $(NULL) -I$(<:d)) $(CFLAGS_O) $(OBJOUT_FLAG)$@ $< @@ -284,7 +286,7 @@ $(o).dll: $(IMPLIB) $(*B).lib $@ .ELIF "$(CCTYPE)" == "GCC" $(LINK32) -o $@ $(LINK_FLAGS) $< $(LIBFILES) - $(IMPLIB) -def $(*B).def $(*B).lib $@ + $(IMPLIB) -def $(*B).def $(*B).a $@ .ELSE $(LINK32) -dll -subsystem:windows -implib:$(*B).lib -def:$(*B).def \ -out:$@ $(LINK_FLAGS) $(LIBFILES) $< $(LIBPERL) @@ -303,16 +305,6 @@ EXTUTILSDIR = $(LIBDIR)\extutils # # various targets -.IF "$(OBJECT)" == "-DPERL_OBJECT" -PERLIMPLIB = ..\perlcore.lib -PERLDLL = ..\perlcore.dll -CAPILIB = $(COREDIR)\PerlCAPI.lib -.ELSE -PERLIMPLIB = ..\perl.lib -PERLDLL = ..\perl.dll -CAPILIB = -.ENDIF - MINIPERL = ..\miniperl.exe MINIDIR = .\mini PERLEXE = ..\perl.exe @@ -356,6 +348,7 @@ CFGH_TMPL = config_H.bc CFGSH_TMPL = config.gc CFGH_TMPL = config_H.gc +PERLIMPLIB *= ..\libperl$(a) .ELSE @@ -365,6 +358,16 @@ PERL95EXE = ..\perl95.exe .ENDIF +.IF "$(OBJECT)" == "-DPERL_OBJECT" +PERLIMPLIB *= ..\perlcore$(a) +PERLDLL = ..\perlcore.dll +CAPILIB = $(COREDIR)\PerlCAPI$(a) +.ELSE +PERLIMPLIB *= ..\perl$(a) +PERLDLL = ..\perl.dll +CAPILIB = +.ENDIF + XCOPY = xcopy /f /r /i /d RCOPY = xcopy /f /r /i /e /d NOOP = @echo @@ -490,7 +493,7 @@ CORE_H = $(CORE_NOCFG_H) .\config.h MICROCORE_OBJ = $(MICROCORE_SRC:db:+$(o)) CORE_OBJ = $(MICROCORE_OBJ) $(EXTRACORE_SRC:db:+$(o)) WIN32_OBJ = $(WIN32_SRC:db:+$(o)) -MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) perlio$(o)} +MINICORE_OBJ = $(MINIDIR)\{$(MICROCORE_OBJ:f) miniperlmain$(o) $(EXTRACORE_SRC:db:+$(o))} MINIWIN32_OBJ = $(MINIDIR)\{$(WIN32_OBJ:f)} MINI_OBJ = $(MINICORE_OBJ) $(MINIWIN32_OBJ) PERL95_OBJ = $(PERL95_SRC:db:+$(o)) @@ -574,10 +577,12 @@ CFG_VARS = \ "d_mymalloc=$(PERL_MALLOC)" \ "libs=$(LIBFILES:f)" \ "incpath=$(CCINCDIR)" \ - "libperl=$(PERLIMPLIB)" \ + "libperl=$(PERLIMPLIB:f)" \ "libpth=$(strip $(CCLIBDIR) $(LIBFILES:d))" \ "libc=$(LIBC)" \ "make=dmake" \ + "_o=$(o)" "obj_ext=$(o)" \ + "_a=$(a)" "lib_ext=$(a)" \ "static_ext=$(STATIC_EXT)" \ "dynamic_ext=$(DYNAMIC_EXT)" \ "usethreads=$(USE_THREADS)" \ @@ -877,7 +882,7 @@ utils: $(PERLEXE) $(X2P) distclean: clean -del /f $(MINIPERL) $(PERLEXE) $(PERL95EXE) $(PERLDLL) $(GLOBEXE) \ - $(PERLIMPLIB) ..\miniperl.lib $(MINIMOD) + $(PERLIMPLIB) ..\miniperl$(a) $(MINIMOD) -del /f *.def *.map -del /f $(EXTENSION_DLL) -del /f $(EXTENSION_C) $(DYNALOADER).c @@ -900,7 +905,7 @@ distclean: clean -del /f perl95.c .ENDIF -del /f bin\*.bat - -cd $(EXTDIR) && del /s *.lib *.def *.map *.bs Makefile *$(o) pm_to_blib + -cd $(EXTDIR) && del /s *$(a) *.def *.map *.bs Makefile *$(o) pm_to_blib -rmdir /s /q $(AUTODIR) || rmdir /s $(AUTODIR) -rmdir /s /q $(COREDIR) || rmdir /s $(COREDIR) @@ -967,7 +972,7 @@ clean : -@erase $(WIN32_OBJ) -@erase $(DLL_OBJ) -@erase $(X2P_OBJ) - -@erase ..\*$(o) ..\*.lib ..\*.exp *$(o) *.lib *.exp + -@erase ..\*$(o) ..\*$(a) ..\*.exp *$(o) *$(a) *.exp -@erase ..\t\*.exe ..\t\*.dll ..\t\*.bat -@erase ..\x2p\*.exe ..\x2p\*.bat -@erase *.ilk diff --git a/win32/win32.h b/win32/win32.h index a6a2f9d..eaced28 100644 --- a/win32/win32.h +++ b/win32/win32.h @@ -31,9 +31,6 @@ typedef long long __int64; #define __declspec(x) #define PERL_GLOBAL_STRUCT #define MULTIPLICITY -#ifndef TLS_OUT_OF_INDEXES -#define TLS_OUT_OF_INDEXES (DWORD)0xFFFFFFFF -#endif #endif /* Define DllExport akin to perl's EXT, @@ -60,6 +57,10 @@ typedef long long __int64; #define CONTEXT PERL_CONTEXT /* Avoid conflict of CONTEXT defs. */ #endif /*WIN32_LEAN_AND_MEAN */ +#ifndef TLS_OUT_OF_INDEXES +#define TLS_OUT_OF_INDEXES (DWORD)0xFFFFFFFF +#endif + #include #include #include