From: Gurusamy Sarathy Date: Thu, 9 Jul 1998 05:37:48 +0000 (+0000) Subject: get it building again on win32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=15e52e56ffc1b4b0632038d47561373c5ca610c4;p=p5sagit%2Fp5-mst-13.2.git get it building again on win32 p4raw-id: //depot/perl@1394 --- diff --git a/bytecode.h b/bytecode.h index dd08c95..2041520 100644 --- a/bytecode.h +++ b/bytecode.h @@ -143,7 +143,7 @@ EXT I32 obj_list_fill INIT(-1); #define BSET_pv_free(pv) Safefree(pv.xpv_pv) #define BSET_pregcomp(o, arg) \ ((PMOP*)o)->op_pmregexp = arg ? \ - pregcomp(arg, arg + pv.xpv_cur, ((PMOP*)o)) : 0 + CALLREGCOMP(arg, arg + pv.xpv_cur, ((PMOP*)o)) : 0 #define BSET_newsv(sv, arg) sv = NEWSV(666,0); SvUPGRADE(sv, arg) #define BSET_newop(o, arg) o = (OP*)safemalloc(optype_size[arg]) #define BSET_newopn(o, arg) STMT_START { \ diff --git a/embed.h b/embed.h index 01813c9..2543d0b 100644 --- a/embed.h +++ b/embed.h @@ -615,7 +615,6 @@ #define pp_i_negate Perl_pp_i_negate #define pp_i_subtract Perl_pp_i_subtract #define pp_index Perl_pp_index -#define pp_indread Perl_pp_indread #define pp_int Perl_pp_int #define pp_interp Perl_pp_interp #define pp_ioctl Perl_pp_ioctl diff --git a/ext/re/Makefile.PL b/ext/re/Makefile.PL index c6a55a6..afeaef5 100644 --- a/ext/re/Makefile.PL +++ b/ext/re/Makefile.PL @@ -11,11 +11,11 @@ WriteMakefile( sub MY::postamble { return <<'EOF'; re_comp.c: ../../regcomp.c - -$(RM) $@ + -$(RM_F) $@ $(CP) ../../regcomp.c $@ re_exec.c: ../../regexec.c - -$(RM) $@ + -$(RM_F) $@ $(CP) ../../regexec.c $@ EOF diff --git a/global.sym b/global.sym index 35934ac..cdd10ba 100644 --- a/global.sym +++ b/global.sym @@ -682,7 +682,6 @@ pp_i_ne pp_i_negate pp_i_subtract pp_index -pp_indread pp_int pp_interp pp_ioctl diff --git a/intrpvar.h b/intrpvar.h index c81a99a..1ff9ac8 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -240,9 +240,10 @@ PERLVARI(Iregindent, int, 0) /* from regexec.c */ PERLVAR(Iregcc, CURCUR *) /* from regexec.c */ -PERLVARI(Iregcompp, regcomp_t, &pregcomp) /* Pointer to RE compiler */ -PERLVARI(Iregexecp, regexec_t, ®exec_flags) /* Pointer to RE executer */ - +PERLVARI(Iregcompp, regcomp_t, FUNC_NAME_TO_PTR(pregcomp)) + /* Pointer to RE compiler */ +PERLVARI(Iregexecp, regexec_t, FUNC_NAME_TO_PTR(regexec_flags)) + /* Pointer to RE executer */ PERLVARI(Iin_clean_objs,bool, FALSE) /* from sv.c */ PERLVARI(Iin_clean_all, bool, FALSE) /* from sv.c */ diff --git a/op.c b/op.c index caa8fe1..fe6d8e8 100644 --- a/op.c +++ b/op.c @@ -2140,7 +2140,7 @@ pmruntime(OP *o, OP *expr, OP *repl) p = SvPV(pat, plen); pm->op_pmflags |= PMf_SKIPWHITE; } - pm->op_pmregexp = (*regcompp)(p, p + plen, pm); + pm->op_pmregexp = CALLREGCOMP(p, p + plen, pm); if (strEQ("\\s+", pm->op_pmregexp->precomp)) pm->op_pmflags |= PMf_WHITE; op_free(expr); diff --git a/opcode.pl b/opcode.pl index 8fa6e29..fe6e202 100755 --- a/opcode.pl +++ b/opcode.pl @@ -211,6 +211,7 @@ close OC or die "Error closing opcode.h: $!"; open PP, '>pp_proto.h' or die "Error creating pp_proto.h: $!"; for (@ops) { + next if /^i_(pre|post)(inc|dec)$/; print PP "PPDEF(pp_$_)\n"; } diff --git a/perl.h b/perl.h index 69776ab..cc56c75 100644 --- a/perl.h +++ b/perl.h @@ -112,6 +112,8 @@ class CPerlObj; #define _PERL_OBJECT_THIS ,this #define PERL_OBJECT_THIS_ this, #define CALLRUNOPS (this->*runops) +#define CALLREGCOMP (this->*regcompp) +#define CALLREGEXEC (this->*regexecp) #else /* !PERL_OBJECT */ @@ -126,6 +128,8 @@ class CPerlObj; #define _PERL_OBJECT_THIS #define PERL_OBJECT_THIS_ #define CALLRUNOPS runops +#define CALLREGCOMP (*regcompp) +#define CALLREGEXEC (*regexecp) #endif /* PERL_OBJECT */ @@ -1833,11 +1837,24 @@ typedef enum { #define RsRECORD(sv) (SvROK(sv) && (SvIV(SvRV(sv)) > 0)) /* Enable variables which are pointers to functions */ +#ifdef PERL_OBJECT +typedef regexp*(CPerlObj::*regcomp_t) _((char* exp, char* xend, PMOP* pm)); +typedef I32 (CPerlObj::*regexec_t) _((regexp* prog, char* stringarg, + char* strend, char* strbeg, + I32 minend, SV* screamer, void* data, + U32 flags)); +#else typedef regexp*(*regcomp_t) _((char* exp, char* xend, PMOP* pm)); typedef I32 (*regexec_t) _((regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, void* data, U32 flags)); +EXT regexp* pregcomp _((char* exp, char* xend, PMOP* pm)); +EXT I32 regexec_flags _((regexp* prog, char* stringarg, char* strend, + char* strbeg, I32 minend, SV* screamer, + void* data, U32 flags)); +#endif + /* Set up PERLVAR macros for populating structs */ #define PERLVAR(var,type) type var; #define PERLVARI(var,type,init) type var; diff --git a/pp.c b/pp.c index c388b61..64958c4 100644 --- a/pp.c +++ b/pp.c @@ -4338,7 +4338,7 @@ PP(pp_split) else { maxiters += (strend - s) * rx->nparens; while (s < strend && --limit && - (*regexecp)(rx, s, strend, orig, 1, Nullsv, NULL, 0)) + CALLREGEXEC(rx, s, strend, orig, 1, Nullsv, NULL, 0)) { TAINT_IF(RX_MATCH_TAINTED(rx)); if (rx->subbase diff --git a/pp_ctl.c b/pp_ctl.c index 464e20d..3002412 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -101,7 +101,7 @@ PP(pp_regcomp) } pm->op_pmflags = pm->op_pmpermflags; /* reset case sensitivity */ - pm->op_pmregexp = (*regcompp)(t, t + len, pm); + pm->op_pmregexp = CALLREGCOMP(t, t + len, pm); } } @@ -148,7 +148,7 @@ PP(pp_substcont) sv_catsv(dstr, POPs); /* Are we done */ - if (cx->sb_once || !(*regexecp)(rx, s, cx->sb_strend, orig, + if (cx->sb_once || !CALLREGEXEC(rx, s, cx->sb_strend, orig, s == m, Nullsv, NULL, cx->sb_safebase ? 0 : REXEC_COPY_STR)) { diff --git a/pp_hot.c b/pp_hot.c index c64393e..fa6c5a5 100644 --- a/pp_hot.c +++ b/pp_hot.c @@ -905,7 +905,7 @@ play_it_again: rx->float_substr = Nullsv; } } - if ((*regexecp)(rx, s, strend, truebase, minmatch, + if (CALLREGEXEC(rx, s, strend, truebase, minmatch, screamer, NULL, safebase)) { curpm = pm; @@ -1624,7 +1624,7 @@ PP(pp_subst) /* can do inplace substitution? */ if (c && clen <= rx->minlen && (once || !(safebase & REXEC_COPY_STR)) && !(rx->reganch & ROPT_LOOKBEHIND_SEEN)) { - if (!(*regexecp)(rx, s, strend, orig, 0, screamer, NULL, safebase)) { + if (!CALLREGEXEC(rx, s, strend, orig, 0, screamer, NULL, safebase)) { SPAGAIN; PUSHs(&sv_no); LEAVE_SCOPE(oldsave); @@ -1701,7 +1701,7 @@ PP(pp_subst) d += clen; } s = rx->endp[0]; - } while ((*regexecp)(rx, s, strend, orig, s == m, + } while (CALLREGEXEC(rx, s, strend, orig, s == m, Nullsv, NULL, 0)); /* don't match same null twice */ if (s != d) { i = strend - s; @@ -1724,7 +1724,7 @@ PP(pp_subst) RETURN; } - if ((*regexecp)(rx, s, strend, orig, 0, screamer, NULL, safebase)) { + if (CALLREGEXEC(rx, s, strend, orig, 0, screamer, NULL, safebase)) { if (force_on_match) { force_on_match = 0; s = SvPV_force(TARG, len); @@ -1758,7 +1758,7 @@ PP(pp_subst) sv_catpvn(dstr, c, clen); if (once) break; - } while ((*regexecp)(rx, s, strend, orig, s == m, Nullsv, NULL, safebase)); + } while (CALLREGEXEC(rx, s, strend, orig, s == m, Nullsv, NULL, safebase)); sv_catpvn(dstr, s, strend - s); (void)SvOOK_off(TARG); diff --git a/pp_proto.h b/pp_proto.h index 458adc7..ec98f02 100644 --- a/pp_proto.h +++ b/pp_proto.h @@ -43,13 +43,9 @@ PPDEF(pp_undef) PPDEF(pp_study) PPDEF(pp_pos) PPDEF(pp_preinc) -PPDEF(pp_i_preinc) PPDEF(pp_predec) -PPDEF(pp_i_predec) PPDEF(pp_postinc) -PPDEF(pp_i_postinc) PPDEF(pp_postdec) -PPDEF(pp_i_postdec) PPDEF(pp_pow) PPDEF(pp_multiply) PPDEF(pp_i_multiply) diff --git a/pp_sys.c b/pp_sys.c index f3c5dd4..10d02ce 100644 --- a/pp_sys.c +++ b/pp_sys.c @@ -264,11 +264,13 @@ PP(pp_glob) return result; } +#if 0 /* XXX never used! */ PP(pp_indread) { last_in_gv = gv_fetchpv(SvPVx(GvSV((GV*)(*stack_sp--)), na), TRUE,SVt_PVIO); return do_readline(); } +#endif PP(pp_rcatline) { diff --git a/proto.h b/proto.h index 34d84cf..8599e02 100644 --- a/proto.h +++ b/proto.h @@ -430,12 +430,10 @@ VIRTUAL void pop_scope _((void)); VIRTUAL OP* prepend_elem _((I32 optype, OP* head, OP* tail)); VIRTUAL void push_return _((OP* o)); VIRTUAL void push_scope _((void)); -VIRTUAL regexp* pregcomp _((char* exp, char* xend, PMOP* pm)); VIRTUAL OP* ref _((OP* o, I32 type)); VIRTUAL OP* refkids _((OP* o, I32 type)); VIRTUAL void regdump _((regexp* r)); VIRTUAL I32 pregexec _((regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, U32 nosave)); -VIRTUAL I32 regexec_flags _((regexp* prog, char* stringarg, char* strend, char* strbeg, I32 minend, SV* screamer, void* data, U32 flags)); VIRTUAL void pregfree _((struct regexp* r)); VIRTUAL regnode* regnext _((regnode* p)); VIRTUAL void regprop _((SV* sv, regnode* o)); @@ -711,6 +709,12 @@ int div128 _((SV *pnum, bool *done)); int runops_standard _((void)); int runops_debug _((void)); + +regexp* pregcomp _((char* exp, char* xend, PMOP* pm)); +I32 regexec_flags _((regexp* prog, char* stringarg, char* strend, + char* strbeg, I32 minend, SV* screamer, + void* data, U32 flags)); + void check_uni _((void)); void force_next _((I32 type)); char *force_version _((char *start)); diff --git a/win32/Makefile b/win32/Makefile index a33a2ba..99bd631 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -448,7 +448,7 @@ PERLEXE_OBJ = $(PERLEXE_OBJ) $(WIN32_OBJ) $(DLL_OBJ) PERL95_OBJ = $(PERL95_OBJ) DynaLoadmt$(o) !ENDIF -DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B +DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re STATIC_EXT = DynaLoader NONXS_EXT = Errno @@ -462,6 +462,7 @@ POSIX = $(EXTDIR)\POSIX\POSIX ATTRS = $(EXTDIR)\attrs\attrs THREAD = $(EXTDIR)\Thread\Thread B = $(EXTDIR)\B\B +RE = $(EXTDIR)\RE\RE ERRNO = $(EXTDIR)\Errno\Errno SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll @@ -473,6 +474,7 @@ POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll THREAD_DLL = $(AUTODIR)\Thread\Thread.dll B_DLL = $(AUTODIR)\B\B.dll +RE_DLL = $(AUTODIR)\re\re.dll ERRNO_PM = $(LIBDIR)\Errno.pm @@ -485,6 +487,7 @@ EXTENSION_C = \ $(POSIX).c \ $(ATTRS).c \ $(THREAD).c \ + $(RE).c \ $(B).c EXTENSION_DLL = \ @@ -503,7 +506,8 @@ EXTENSION_PM = \ !IF "$(OBJECT)" == "" EXTENSION_DLL = \ $(EXTENSION_DLL)\ - $(THREAD_DLL) + $(THREAD_DLL) \ + $(RE_DLL) !ENDIF POD2HTML = $(PODDIR)\pod2html @@ -580,6 +584,7 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL) $(XCOPY) ..\*.h $(COREDIR)\*.* $(XCOPY) *.h $(COREDIR)\*.* + $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.* $(RCOPY) include $(COREDIR)\*.* $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \ || $(MAKE) $(MAKEFLAGS) $(CONFIGPM) @@ -709,6 +714,12 @@ $(CAPILIB) : PerlCAPI.cpp PerlCAPI$(o) $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs +$(RE_DLL): $(PERLEXE) $(RE).xs + cd $(EXTDIR)\$(*B) + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + $(MAKE) + cd ..\..\win32 + $(B_DLL): $(PERLEXE) $(B).xs cd $(EXTDIR)\$(*B) ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl @@ -794,7 +805,7 @@ distclean: clean -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm - -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm + -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B diff --git a/win32/makedef.pl b/win32/makedef.pl index 6592e46..7d29c9c 100644 --- a/win32/makedef.pl +++ b/win32/makedef.pl @@ -79,15 +79,12 @@ skip_symbols [qw( Perl_statusvalue_vms Perl_archpat_auto Perl_block_type -Perl_bostr Perl_additem Perl_cast_ulong Perl_check_uni Perl_checkcomma Perl_chsize Perl_ck_aelem -Perl_colors -Perl_colorset Perl_cryptseen Perl_cx_dump Perl_DBcv @@ -110,7 +107,6 @@ Perl_dump_packsubs Perl_dump_pm Perl_dump_sub Perl_expectterm -Perl_extralen Perl_fetch_gv Perl_fetch_io Perl_force_ident @@ -148,41 +144,6 @@ Perl_pp_nswitch Perl_q Perl_rcsid Perl_reall_srchlen -Perl_reg_eval_set -Perl_reg_flags -Perl_reg_start_tmp -Perl_reg_start_tmpl -Perl_regbol -Perl_regcc -Perl_regcode -Perl_regdata -Perl_regdummy -Perl_regdump -Perl_regfold -Perl_regendp -Perl_regeol -Perl_regflags -Perl_regindent -Perl_reginput -Perl_reglastparen -Perl_regmyendp -Perl_regmyp_size -Perl_regmystartp -Perl_regnarrate -Perl_regnaughty -Perl_regnpar -Perl_regcomp_parse -Perl_regprecomp -Perl_regprev -Perl_regprogram -Perl_regprop -Perl_regsawback -Perl_regseen -Perl_regsize -Perl_regstartp -Perl_regtill -Perl_regxend -Perl_regcomp_rx Perl_same_dirent Perl_saw_return Perl_scan_const @@ -196,7 +157,6 @@ Perl_scan_str Perl_scan_subst Perl_scan_trans Perl_scan_word -Perl_seen_zerolen Perl_setenv_getix Perl_skipspace Perl_sort_mutex diff --git a/win32/makefile.mk b/win32/makefile.mk index 39c5d71..c552aa4 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -560,7 +560,7 @@ PERLEXE_OBJ += $(WIN32_OBJ) $(DLL_OBJ) PERL95_OBJ += DynaLoadmt$(o) .ENDIF -DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B +DYNAMIC_EXT = Socket IO Fcntl Opcode SDBM_File POSIX attrs Thread B re STATIC_EXT = DynaLoader NONXS_EXT = Errno @@ -574,6 +574,7 @@ POSIX = $(EXTDIR)\POSIX\POSIX ATTRS = $(EXTDIR)\attrs\attrs THREAD = $(EXTDIR)\Thread\Thread B = $(EXTDIR)\B\B +RE = $(EXTDIR)\re\re ERRNO = $(EXTDIR)\Errno\Errno SOCKET_DLL = $(AUTODIR)\Socket\Socket.dll @@ -585,6 +586,7 @@ POSIX_DLL = $(AUTODIR)\POSIX\POSIX.dll ATTRS_DLL = $(AUTODIR)\attrs\attrs.dll THREAD_DLL = $(AUTODIR)\Thread\Thread.dll B_DLL = $(AUTODIR)\B\B.dll +RE_DLL = $(AUTODIR)\re\re.dll ERRNO_PM = $(LIBDIR)\Errno.pm @@ -597,6 +599,7 @@ EXTENSION_C = \ $(POSIX).c \ $(ATTRS).c \ $(THREAD).c \ + $(RE).c \ $(B).c EXTENSION_DLL = \ @@ -612,9 +615,11 @@ EXTENSION_DLL = \ EXTENSION_PM = \ $(ERRNO_PM) +# re.dll doesn't build with PERL_OBJECT yet .IF "$(OBJECT)" == "" EXTENSION_DLL += \ - $(THREAD_DLL) + $(THREAD_DLL) \ + $(RE_DLL) .ENDIF POD2HTML = $(PODDIR)\pod2html @@ -699,6 +704,7 @@ $(CONFIGPM) : $(MINIPERL) ..\config.sh config_h.PL ..\minimod.pl if exist lib\* $(RCOPY) lib\*.* ..\lib\$(NULL) $(XCOPY) ..\*.h $(COREDIR)\*.* $(XCOPY) *.h $(COREDIR)\*.* + $(XCOPY) ..\ext\re\re.pm $(LIBDIR)\*.* $(RCOPY) include $(COREDIR)\*.* $(MINIPERL) -I..\lib config_h.PL "INST_VER=$(INST_VER)" \ || $(MAKE) $(MAKEMACROS) $(CONFIGPM) @@ -884,6 +890,11 @@ $(CAPILIB) : PerlCAPI.cpp PerlCAPI$(o) $(EXTDIR)\DynaLoader\dl_win32.xs: dl_win32.xs copy dl_win32.xs $(EXTDIR)\DynaLoader\dl_win32.xs +$(RE_DLL): $(PERLEXE) $(RE).xs + cd $(EXTDIR)\$(*B) && \ + ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl + cd $(EXTDIR)\$(*B) && $(MAKE) + $(B_DLL): $(PERLEXE) $(B).xs cd $(EXTDIR)\$(*B) && \ ..\..\miniperl -I..\..\lib Makefile.PL INSTALLDIRS=perl @@ -956,7 +967,7 @@ distclean: clean -del /f $(LIBDIR)\Fcntl.pm $(LIBDIR)\IO.pm $(LIBDIR)\Opcode.pm -del /f $(LIBDIR)\ops.pm $(LIBDIR)\Safe.pm $(LIBDIR)\Thread.pm -del /f $(LIBDIR)\SDBM_File.pm $(LIBDIR)\Socket.pm $(LIBDIR)\POSIX.pm - -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm + -del /f $(LIBDIR)\B.pm $(LIBDIR)\O.pm $(LIBDIR)\re.pm -rmdir /s /q $(LIBDIR)\IO || rmdir /s $(LIBDIR)\IO -rmdir /s /q $(LIBDIR)\Thread || rmdir /s $(LIBDIR)\Thread -rmdir /s /q $(LIBDIR)\B || rmdir /s $(LIBDIR)\B