From 51aa15f38ed061e162eb5fdd50db6c15d839cf32 Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Thu, 4 Jun 1998 22:45:18 +0000 Subject: [PATCH] [win32] add AS patch#25 (allow B build with -DPERL_OBJECT) p4raw-id: //depot/win32/perl@1074 --- ObjXSub.h | 6 +++++- byterun.h | 1 - embed.h | 1 + embedvar.h | 3 +++ ext/B/B.xs | 22 +++++++++++++++++++--- intrpvar.h | 10 ++++++---- objpp.h | 2 ++ proto.h | 1 + util.c | 7 +++++++ win32/Makefile | 6 +++--- win32/makefile.mk | 7 ++++--- 11 files changed, 51 insertions(+), 15 deletions(-) diff --git a/ObjXSub.h b/ObjXSub.h index 4acd827..93a0445 100644 --- a/ObjXSub.h +++ b/ObjXSub.h @@ -551,6 +551,8 @@ #define sortcxix pPerl->Perl_sortcxix #undef sortstash #define sortstash pPerl->Perl_sortstash +#undef specialsv_list +#define specialsv_list pPerl->Perl_specialsv_list #undef splitstr #define splitstr pPerl->Perl_splitstr #undef stack_base @@ -949,7 +951,9 @@ #undef get_no_modify #define get_no_modify pPerl->Perl_get_no_modify #undef get_opargs -#define get_opargs pPerl->Perl_get_opargs +#define get_opargs pPerl->Perl_get_opargs +#undef get_specialsv_list +#define get_specialsv_list pPerl->Perl_get_specialsv_list #undef gp_free #define gp_free pPerl->Perl_gp_free #undef gp_ref diff --git a/byterun.h b/byterun.h index 9abbc22..d5ff00b 100644 --- a/byterun.h +++ b/byterun.h @@ -179,7 +179,6 @@ EXT int optype_size[] #endif /* DOINIT */ ; -EXT SV * specialsv_list[4]; #define INIT_SPECIALSV_LIST STMT_START { \ specialsv_list[0] = Nullsv; \ specialsv_list[1] = &sv_undef; \ diff --git a/embed.h b/embed.h index 43b85d4..71dc683 100644 --- a/embed.h +++ b/embed.h @@ -211,6 +211,7 @@ #define get_op_descs Perl_get_op_descs #define get_op_names Perl_get_op_names #define get_opargs Perl_get_opargs +#define get_specialsv_list Perl_get_specialsv_list #define gp_free Perl_gp_free #define gp_ref Perl_gp_ref #define gt_amg Perl_gt_amg diff --git a/embedvar.h b/embedvar.h index 6cb5972..918d330 100644 --- a/embedvar.h +++ b/embedvar.h @@ -220,6 +220,7 @@ #define sortcop (curinterp->Isortcop) #define sortcxix (curinterp->Isortcxix) #define sortstash (curinterp->Isortstash) +#define specialsv_list (curinterp->Ispecialsv_list) #define splitstr (curinterp->Isplitstr) #define statcache (curinterp->Istatcache) #define statgv (curinterp->Istatgv) @@ -383,6 +384,7 @@ #define Isortcop sortcop #define Isortcxix sortcxix #define Isortstash sortstash +#define Ispecialsv_list specialsv_list #define Isplitstr splitstr #define Istatcache statcache #define Istatgv statgv @@ -608,6 +610,7 @@ #define sortcop Perl_sortcop #define sortcxix Perl_sortcxix #define sortstash Perl_sortstash +#define specialsv_list Perl_specialsv_list #define splitstr Perl_splitstr #define statcache Perl_statcache #define statgv Perl_statgv diff --git a/ext/B/B.xs b/ext/B/B.xs index 3e519af..b111e67 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -12,6 +12,22 @@ #include "XSUB.h" #include "INTERN.h" +#ifdef PERL_OBJECT +#undef op_name +#undef opargs +#undef op_desc +#define op_name (pPerl->Perl_get_op_names()) +#define opargs (pPerl->Perl_get_opargs()) +#define op_desc (pPerl->Perl_get_op_descs()) +#endif + +#ifdef PerlIO +typedef PerlIO * InputStream; +#else +typedef FILE * InputStream; +#endif + + static char *svclassnames[] = { "B::NULL", "B::IV", @@ -295,7 +311,7 @@ void freadpv(U32 len, void *data) pv.xpv_cur = len - 1; } -void byteload_fh(FILE *fp) +void byteload_fh(InputStream fp) { struct bytestream bs; bs.data = fp; @@ -343,7 +359,7 @@ void byteload_string(char *str) byterun(bs); } #else -void byteload_fh(FILE *fp) +void byteload_fh(InputStream fp) { byterun(fp); } @@ -468,7 +484,7 @@ walkoptree_debug(...) int byteload_fh(fp) - FILE * fp + InputStream fp CODE: byteload_fh(fp); RETVAL = 1; diff --git a/intrpvar.h b/intrpvar.h index 7f5b1a5..062d016 100644 --- a/intrpvar.h +++ b/intrpvar.h @@ -183,10 +183,10 @@ PERLVAR(Iregseen, U32) /* from regcomp.c */ PERLVAR(Iseen_zerolen, I32) /* from regcomp.c */ PERLVAR(Iregcomp_rx, regexp *) /* from regcomp.c */ PERLVAR(Iextralen, I32) /* from regcomp.c */ -#ifdef DEBUGGING +/* #ifdef DEBUGGING -- keep the structure the same with/without DEBUGGING defined */ PERLVAR(Icolorset, int) /* from regcomp.c */ PERLVAR(Icolors[4], char *) /* from regcomp.c */ -#endif +/* #endif */ PERLVAR(Ireginput, char *) /* String-input pointer. */ PERLVAR(Iregbol, char *) /* Beginning of input, for ^ check. */ @@ -204,11 +204,11 @@ PERLVAR(Ibostr, char *) /* from regexec.c */ PERLVAR(Ireg_flags, U32) /* from regexec.c */ PERLVAR(Ireg_eval_set, I32) /* from regexec.c */ -#ifdef DEBUGGING +/* #ifdef DEBUGGING -- keep the structure the same with/without DEBUGGING defined */ PERLVAR(Iregnarrate, I32) /* from regexec.c */ PERLVAR(Iregprogram, regnode *) /* from regexec.c */ PERLVARI(Iregindent, int, 0) /* from regexec.c */ -#endif +/* #endif */ PERLVAR(Iregcc, CURCUR *) /* from regexec.c */ PERLVARI(Iin_clean_objs,bool, FALSE) /* from sv.c */ @@ -232,3 +232,5 @@ PERLVARI(piDir, IPerlDir*, NULL) PERLVARI(piSock, IPerlSock*, NULL) PERLVARI(piProc, IPerlProc*, NULL) #endif + +PERLVAR(Ispecialsv_list[4], SV *) /* from byterun.h */ diff --git a/objpp.h b/objpp.h index 44e105e..757a65b 100644 --- a/objpp.h +++ b/objpp.h @@ -385,6 +385,8 @@ #define get_no_modify CPerlObj::Perl_get_no_modify #undef get_opargs #define get_opargs CPerlObj::Perl_get_opargs +#undef get_specialsv_list +#define get_specialsv_list CPerlObj::Perl_get_specialsv_list #undef getlogin #define getlogin CPerlObj::getlogin #undef gp_free diff --git a/proto.h b/proto.h index 49cd6b4..093bc1e 100644 --- a/proto.h +++ b/proto.h @@ -1228,6 +1228,7 @@ void restore_expect _((void *e)); void restore_lex_expect _((void *e)); void yydestruct _((void *ptr)); VIRTUAL int fprintf _((PerlIO *pf, const char *pat, ...)); +VIRTUAL SV** get_specialsv_list _((void)); #ifdef WIN32 VIRTUAL int& ErrorNo _((void)); diff --git a/util.c b/util.c index 5aebe10..7479e47 100644 --- a/util.c +++ b/util.c @@ -2848,3 +2848,10 @@ get_opargs(void) { return opargs; } + + +SV ** +get_specialsv_list(void) +{ + return specialsv_list; +} \ No newline at end of file diff --git a/win32/Makefile b/win32/Makefile index 1af0410..646080b 100644 --- a/win32/Makefile +++ b/win32/Makefile @@ -418,13 +418,13 @@ EXTENSION_DLL = \ $(SDBM_FILE_DLL)\ $(IO_DLL) \ $(POSIX_DLL) \ - $(ATTRS_DLL) + $(ATTRS_DLL) \ + $(B_DLL) !IF "$(OBJECT)" == "" EXTENSION_DLL = \ $(EXTENSION_DLL)\ - $(THREAD_DLL) \ - $(B_DLL) + $(THREAD_DLL) !ENDIF POD2HTML = $(PODDIR)\pod2html diff --git a/win32/makefile.mk b/win32/makefile.mk index bb4fb40..2f1b407 100644 --- a/win32/makefile.mk +++ b/win32/makefile.mk @@ -528,12 +528,12 @@ EXTENSION_DLL = \ $(SDBM_FILE_DLL)\ $(IO_DLL) \ $(POSIX_DLL) \ - $(ATTRS_DLL) + $(ATTRS_DLL) \ + $(B_DLL) .IF "$(OBJECT)" == "" EXTENSION_DLL += \ - $(THREAD_DLL) \ - $(B_DLL) + $(THREAD_DLL) .ENDIF POD2HTML = $(PODDIR)\pod2html @@ -940,6 +940,7 @@ clean : -@erase $(MINIPERL) -@erase perlglob$(o) -@erase perlmain$(o) + -@erase PerlCAPI.cpp -@erase config.w32 -@erase /f config.h -@erase $(GLOBEXE) -- 1.8.3.1