From: Gurusamy Sarathy Date: Sun, 1 Mar 1998 06:52:26 +0000 (+0000) Subject: [asperl] integrate mainline changes X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fbbbcc485c1d03c76a91f998e1e4492c8ad56b38;p=p5sagit%2Fp5-mst-13.2.git [asperl] integrate mainline changes p4raw-id: //depot/asperl@607 --- fbbbcc485c1d03c76a91f998e1e4492c8ad56b38 diff --cc MANIFEST index 1acac3c,80bae3e..973e98f --- a/MANIFEST +++ b/MANIFEST @@@ -28,8 -30,8 +30,9 @@@ README.vms Notes about VMS por README.win32 Notes about Win32 port Todo The Wishlist Todo.5.005 What needs doing before 5.005 release +XSLock.h Include file for extensions built with PERL_OBJECT defined XSUB.h Include file for extension subroutines + atomic.h Atomic refcount handling for multi-threading av.c Array value code av.h Array value header bytecode.h Bytecode header for compiler diff --cc op.c index c0b1124,39d2a14..0213d54 --- a/op.c +++ b/op.c @@@ -155,17 -147,8 +155,8 @@@ pad_allocmy(char *name return off; } -static PADOFFSET +STATIC PADOFFSET - #ifndef CAN_PROTOTYPE - pad_findlex(name, newoff, seq, startcv, cx_ix) - char *name; - PADOFFSET newoff; - U32 seq; - CV* startcv; - I32 cx_ix; - #else pad_findlex(char *name, PADOFFSET newoff, U32 seq, CV* startcv, I32 cx_ix) - #endif { dTHR; CV *cv; diff --cc perl.c index f4a9526,6d222ce..581e905 --- a/perl.c +++ b/perl.c @@@ -1823,16 -1758,8 +1798,8 @@@ init_main_stash(void sv_setpvn(GvSV(gv_fetchpv("/", TRUE, SVt_PV)), "\n", 1); } - #ifdef CAN_PROTOTYPE -static void +STATIC void open_script(char *scriptname, bool dosearch, SV *sv) - #else - STATIC void - open_script(scriptname,dosearch,sv) - char *scriptname; - bool dosearch; - SV *sv; - #endif { dTHR; char *xfound = Nullch; diff --cc perl.h index 1858803,49032b5..60cd79c --- a/perl.h +++ b/perl.h @@@ -1136,56 -1100,9 +1128,58 @@@ union any #include "hv.h" #include "mg.h" #include "scope.h" + #include "bytecode.h" + #include "byterun.h" +/* Current curly descriptor */ +typedef struct curcur CURCUR; +struct curcur { + int parenfloor; /* how far back to strip paren data */ + int cur; /* how many instances of scan we've matched */ + int min; /* the minimal number of scans to match */ + int max; /* the maximal number of scans to match */ + int minmod; /* whether to work our way up or down */ + regnode * scan; /* the thing to match */ + regnode * next; /* what has to match after it */ + char * lastloc; /* where we started matching this scan */ + CURCUR * oldcc; /* current curly before we started this one */ +}; + +typedef struct _sublex_info SUBLEXINFO; +struct _sublex_info { + I32 super_state; /* lexer state to save */ + I32 sub_inwhat; /* "lex_inwhat" to use */ + OP *sub_op; /* "lex_op" to use */ +}; + +#ifdef PERL_OBJECT +struct magic_state { + SV* mgs_sv; + U32 mgs_flags; +}; +typedef struct magic_state MGS; + +typedef struct { + I32 len_min; + I32 len_delta; + I32 pos_min; + I32 pos_delta; + SV *last_found; + I32 last_end; /* min value, <0 unless valid. */ + I32 last_start_min; + I32 last_start_max; + SV **longest; /* Either &l_fixed, or &l_float. */ + SV *longest_fixed; + I32 offset_fixed; + SV *longest_float; + I32 offset_float_min; + I32 offset_float_max; + I32 flags; +} scan_data_t; + +typedef I32 CHECKPOINT; +#endif /* PERL_OBJECT */ + /* work around some libPW problems */ #ifdef DOINIT EXT char Error[1]; diff --cc pp.h index 3df8663,2209fee..3167591 --- a/pp.h +++ b/pp.h @@@ -14,15 -14,7 +14,11 @@@ #define ARGS #define dARGS #endif /* USE_THREADS */ - #ifdef CAN_PROTOTYPE +#ifdef PERL_OBJECT - #define PP(s) OP* CPerlObj::s _((ARGSproto)) ++#define PP(s) OP * CPerlObj::s(ARGSproto) +#else #define PP(s) OP * s(ARGSproto) +#endif - #else /* CAN_PROTOTYPE */ - #define PP(s) OP* s(ARGS) dARGS - #endif /* CAN_PROTOTYPE */ #define SP sp #define MARK mark diff --cc regcomp.c index fc6b131,55576d0..ae2b02e --- a/regcomp.c +++ b/regcomp.c @@@ -2024,13 -2044,8 +2024,8 @@@ nextchar(void /* - reg_node - emit a node */ -static regnode * /* Location. */ +STATIC regnode * /* Location. */ - #ifdef CAN_PROTOTYPE reg_node(U8 op) - #else - reg_node(op) - U8 op; - #endif { register regnode *ret; register regnode *ptr; @@@ -2057,14 -2072,8 +2052,8 @@@ /* - reganode - emit a node with an argument */ -static regnode * /* Location. */ +STATIC regnode * /* Location. */ - #ifdef CAN_PROTOTYPE reganode(U8 op, U32 arg) - #else - reganode(op, arg) - U8 op; - U32 arg; - #endif { register regnode *ret; register regnode *ptr; @@@ -2091,15 -2100,8 +2080,8 @@@ /* - regc - emit (if appropriate) a byte of code */ - #ifdef CAN_PROTOTYPE -static void +STATIC void regc(U8 b, char* s) - #else - static void - regc(b, s) - U8 b; - char *s; - #endif { if (!SIZE_ONLY) *s = b; @@@ -2110,15 -2112,8 +2092,8 @@@ * * Means relocating the operand. */ - #ifdef CAN_PROTOTYPE -static void +STATIC void reginsert(U8 op, regnode *opnd) - #else - static void - reginsert(op, opnd) - U8 op; - regnode *opnd; - #endif { register regnode *src; register regnode *dst; diff --cc toke.c index 348e254,e6a740b..a348695 --- a/toke.c +++ b/toke.c @@@ -467,16 -477,8 +467,8 @@@ uni(I32 f, char *s #define LOP(f,x) return lop(f,x,s) -static I32 +STATIC I32 - lop - #ifdef CAN_PROTOTYPE - (I32 f, expectation x, char *s) - #else - (f,x,s) - I32 f; - expectation x; - char *s; - #endif /* CAN_PROTOTYPE */ + lop(I32 f, expectation x, char *s) { dTHR; yylval.ival = f; diff --cc win32/Makefile index 5da4359,b4dfd30..9431745 --- a/win32/Makefile +++ b/win32/Makefile @@@ -130,20 -136,7 +144,20 @@@ LIBFILES = $(CRYPT_LIB) oldnames.lib ke oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib winmm.lib \ version.lib odbc32.lib odbccp32.lib -CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(LOCDEFS) $(PCHFLAGS) $(OPTIMIZE) +CFLAGS = -nologo -Gf -W3 $(INCLUDES) $(DEFINES) $(OBJECTDEF) $(LOCDEFS) $(PCHFLAGS) $(OPTIMIZE) + + +!IF "$(OBJECT)" == "-DPERL_OBJECT" +DMYMALLOC = undef +!ELSE +DMYMALLOC = define +!ENDIF + +!IF "$(OBJECTDEF)" == "-DPERL_OBJECT" +MINI_SRC = +!ELSE - MINI_SRC = ..\perlio.c ..\malloc.c ++MINI_SRC = ..\perlio.c +!ENDIF LINK_FLAGS = -nologo $(LINK_DBG) -machine:$(PROCESSOR_ARCHITECTURE) OBJOUT_FLAG = -Fo EXEOUT_FLAG = -Fe @@@ -214,16 -199,18 +228,22 @@@ NULL CRYPT_OBJ=$(CRYPT_SRC:.c=.obj) !ENDIF + !IF "$(PERL_MALLOC)" == "define" + MALLOC_SRC = ..\malloc.c + MALLOC_OBJ = ..\malloc$(o) + !ENDIF + +!IF "$(MINI_SRC)" != "" - MINI_OBJ=..\perlio$(o) ..\malloc$(o) ++MINI_OBJ=..\perlio$(o) +!ENDIF + # # filenames given to xsubpp must have forward slashes (since it puts # full pathnames in #line strings) -XSUBPP=..\$(MINIPERL) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes +XSUBPP=..\$(MINIPERLEXE) -I..\..\lib ..\$(EXTUTILSDIR)\xsubpp -C++ -prototypes CORE_C= ..\av.c \ + ..\byterun.c \ ..\deb.c \ ..\doio.c \ ..\doop.c \ @@@ -248,7 -236,7 +268,8 @@@ ..\toke.c \ ..\universal.c \ ..\util.c \ - $(MINI_SRC) \ + $(MALLOC_SRC) \ ++ $(MINI_SRC) \ $(CRYPT_SRC) CORE_OBJ= ..\av$(o) \ @@@ -276,7 -266,7 +298,8 @@@ ..\toke$(o) \ ..\universal$(o)\ ..\util$(o) \ - $(MINI_OBJ) \ + $(MALLOC_OBJ) \ ++ $(MINI_OBJ) \ $(CRYPT_OBJ) WIN32_C = perllib.c \ diff --cc win32/config_H.vc index c3b8dc7,b679932..87bc9c0 --- a/win32/config_H.vc +++ b/win32/config_H.vc @@@ -18,44 -21,10 +21,17 @@@ #ifndef _config_h_ #define _config_h_ +#ifdef PERL_OBJECT +#ifdef PERL_GLOBAL_STRUCT +#error PERL_GLOBAL_STRUCT cannot be defined with PERL_OBJECT +#endif +#define win32_perllib_path PerlEnv_lib_path +#endif + - - /* MEM_ALIGNBYTES: - * This symbol contains the number of bytes required to align a - * double. Usual values are 2, 4 and 8. - * On NeXT starting with 3.2, you can build "Fat" Multiple Architecture - * Binaries (MAB) for targets with varying alignment. This only matters - * for perl, where the config.h can be generated and installed on one - * system, and used by a different architecture to build an extension. - * The default is eight, for safety. - */ - #ifndef NeXT - #define MEM_ALIGNBYTES 8 /**/ - #else /* NeXT */ - #ifdef __m68k__ - #define MEM_ALIGNBYTES 2 - #else - #ifdef __i386__ - #define MEM_ALIGNBYTES 4 - #else /* __hppa__, __sparc__ and default for unknown architectures */ - #define MEM_ALIGNBYTES 8 - #endif /* __i386__ */ - #endif /* __m68k__ */ - #endif /* NeXT */ - - /* ARCHNAME: - * This symbol holds a string representing the architecture name. - * It may be used to construct an architecture-dependant pathname - * where library files may be held under a private library, for - * instance. + /* LOC_SED: + * This symbol holds the complete pathname to the sed program. */ - #define ARCHNAME "MSWin32-x86" /**/ + #define LOC_SED "" /**/ /* BIN: * This symbol holds the path of the bin directory where the package will diff --cc win32/win32.c index fe38c1e,9f678f2..54ce399 --- a/win32/win32.c +++ b/win32/win32.c @@@ -734,7 -703,7 +738,7 @@@ kill(int pid, int sig } return 0; } -- ++ /* * File system stuff */