[win32] add AS patch#25 (allow B build with -DPERL_OBJECT)
Gurusamy Sarathy [Thu, 4 Jun 1998 22:45:18 +0000 (22:45 +0000)]
p4raw-id: //depot/win32/perl@1074

ObjXSub.h
byterun.h
embed.h
embedvar.h
ext/B/B.xs
intrpvar.h
objpp.h
proto.h
util.c
win32/Makefile
win32/makefile.mk

index 4acd827..93a0445 100644 (file)
--- a/ObjXSub.h
+++ b/ObjXSub.h
 #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
 #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
index 9abbc22..d5ff00b 100644 (file)
--- 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 (file)
--- a/embed.h
+++ b/embed.h
 #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
index 6cb5972..918d330 100644 (file)
 #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)
 #define Isortcop               sortcop
 #define Isortcxix              sortcxix
 #define Isortstash             sortstash
+#define Ispecialsv_list        specialsv_list
 #define Isplitstr              splitstr
 #define Istatcache             statcache
 #define Istatgv                        statgv
 #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
index 3e519af..b111e67 100644 (file)
 #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;
index 7f5b1a5..062d016 100644 (file)
@@ -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 (file)
--- a/objpp.h
+++ b/objpp.h
 #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 (file)
--- 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 (file)
--- 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
index 1af0410..646080b 100644 (file)
@@ -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
index bb4fb40..2f1b407 100644 (file)
@@ -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)