Change 31970 by [EMAIL PROTECTED] on 2007/09/25 18:00:32

        make PERL_SYS_INIT/INIT3/TERM into functions

Affected files ...

... //depot/perl/dosish.h#52 edit
... //depot/perl/embed.fnc#523 edit
... //depot/perl/epoc/epocish.h#18 edit
... //depot/perl/global.sym#344 edit
... //depot/perl/mpeix/mpeixish.h#16 edit
... //depot/perl/os2/os2ish.h#54 edit
... //depot/perl/perl.c#823 edit
... //depot/perl/perl.h#794 edit
... //depot/perl/plan9/plan9ish.h#18 edit
... //depot/perl/proto.h#859 edit
... //depot/perl/symbian/symbianish.h#7 edit
... //depot/perl/unixish.h#45 edit
... //depot/perl/vms/vmsish.h#87 edit

Differences ...

==== //depot/perl/dosish.h#52 (text) ====
Index: perl/dosish.h
--- perl/dosish.h#51~29074~     2006-10-21 14:31:20.000000000 -0700
+++ perl/dosish.h       2007-09-25 11:00:32.000000000 -0700
@@ -16,7 +16,7 @@
 #ifdef DJGPP
 #  define BIT_BUCKET "nul"
 #  define OP_BINARY O_BINARY
-#  define PERL_SYS_INIT(c,v)                                           \
+#  define PERL_SYS_INIT_BODY(c,v)                                      \
         MALLOC_CHECK_TAINT2(*c,*v) Perl_DJGPP_init(c,v); PERLIO_INIT
 #  define init_os_extras Perl_init_os_extras
 #  define HAS_UTIME
@@ -29,25 +29,25 @@
 #  define PERL_FS_VER_FMT      "%d_%d_%d"
 #else  /* DJGPP */
 #  ifdef WIN32
-#    define PERL_SYS_INIT(c,v)                                         \
+#    define PERL_SYS_INIT_BODY(c,v)                                    \
        MALLOC_CHECK_TAINT2(*c,*v) Perl_win32_init(c,v); PERLIO_INIT
-#    define PERL_SYS_TERM()    Perl_win32_term()
+#    define PERL_SYS_TERM_BODY()   Perl_win32_term()
 #    define BIT_BUCKET "nul"
 #  else
 #       ifdef NETWARE
-#      define PERL_SYS_INIT(c,v)                                       \
+#      define PERL_SYS_INIT_BODY(c,v)                                  \
        MALLOC_CHECK_TAINT2(*c,*v) Perl_nw5_init(c,v); PERLIO_INIT
 #      define BIT_BUCKET "nwnul"
 #    else
-#      define PERL_SYS_INIT(c,v)               \
+#      define PERL_SYS_INIT_BODY(c,v)          \
        MALLOC_CHECK_TAINT2(*c,*v); PERLIO_INIT
 #      define BIT_BUCKET "\\dev\\nul" /* "wanna be like, umm, Newlined, or 
somethin?" */
 #    endif /* NETWARE */
 #  endif
 #endif /* DJGPP */
 
-#ifndef PERL_SYS_TERM
-#  define PERL_SYS_TERM() HINTS_REFCNT_TERM; OP_REFCNT_TERM; PERLIO_TERM; 
MALLOC_TERM
+#ifndef PERL_SYS_TERM_BODY
+#  define PERL_SYS_TERM_BODY() HINTS_REFCNT_TERM; OP_REFCNT_TERM; PERLIO_TERM; 
MALLOC_TERM
 #endif
 #define dXSUB_SYS
 

==== //depot/perl/embed.fnc#523 (text) ====
Index: perl/embed.fnc
--- perl/embed.fnc#522~31947~   2007-09-23 17:42:07.000000000 -0700
+++ perl/embed.fnc      2007-09-25 11:00:32.000000000 -0700
@@ -1890,6 +1890,10 @@
 pd     |void   |mro_isa_changed_in|NN HV* stash
 Apd    |void   |mro_method_changed_in  |NN HV* stash
 p      |void   |boot_core_mro
+Apon   |void   |sys_init       |NN int* argc|NN char*** argv
+Apon   |void   |sys_init3      |NN int* argc|NN char*** argv|NN char*** env
+Apo    |void   |sys_term
+
 
 END_EXTERN_C
 /*

==== //depot/perl/epoc/epocish.h#18 (text) ====
Index: perl/epoc/epocish.h
--- perl/epoc/epocish.h#17~29077~       2006-10-21 16:01:45.000000000 -0700
+++ perl/epoc/epocish.h 2007-09-25 11:00:32.000000000 -0700
@@ -107,14 +107,14 @@
 
 
 /* epocemx setenv bug workaround */
-#ifndef PERL_SYS_INIT
-#    define PERL_SYS_INIT(c,v)                                            \
+#ifndef PERL_SYS_INIT_BODY
+#    define PERL_SYS_INIT_BODY(c,v)                                       \
        MALLOC_CHECK_TAINT2(*c,*v) putenv(".dummy=foo"); putenv(".dummy"); \
        PERLIO_INIT; MALLOC_INIT
 #endif
 
-#ifndef PERL_SYS_TERM
-#define PERL_SYS_TERM()        PERLIO_TERM; MALLOC_TERM
+#ifndef PERL_SYS_TERM_BODY
+#define PERL_SYS_TERM_BODY()   PERLIO_TERM; MALLOC_TERM
 #endif
 
 #define BIT_BUCKET "/dev/null"

==== //depot/perl/global.sym#344 (text+w) ====
Index: perl/global.sym
--- perl/global.sym#343~31931~  2007-09-20 09:44:24.000000000 -0700
+++ perl/global.sym     2007-09-25 11:00:32.000000000 -0700
@@ -763,4 +763,7 @@
 Perl_get_re_arg
 Perl_mro_get_linear_isa
 Perl_mro_method_changed_in
+Perl_sys_init
+Perl_sys_init3
+Perl_sys_term
 # ex: set ro:

==== //depot/perl/mpeix/mpeixish.h#16 (text) ====
Index: perl/mpeix/mpeixish.h
--- perl/mpeix/mpeixish.h#15~29077~     2006-10-21 16:01:45.000000000 -0700
+++ perl/mpeix/mpeixish.h       2007-09-25 11:00:32.000000000 -0700
@@ -110,12 +110,12 @@
 #define Fflush(fp)         fflush(fp)
 #define Mkdir(path,mode)   mkdir((path),(mode))
 
-#ifndef PERL_SYS_INIT
-#  define PERL_SYS_INIT(c,v)   PERL_FPU_INIT; PERLIO_INIT; MALLOC_INIT
+#ifndef PERL_SYS_INIT_BODY
+#  define PERL_SYS_INIT_BODY(c,v) PERL_FPU_INIT; PERLIO_INIT; MALLOC_INIT
 #endif
 
-#ifndef PERL_SYS_TERM
-#define PERL_SYS_TERM()                PERLIO_TERM; MALLOC_TERM
+#ifndef PERL_SYS_TERM_BODY
+#define PERL_SYS_TERM_BODY()           PERLIO_TERM; MALLOC_TERM
 #endif
 
 #define BIT_BUCKET "/dev/null"

==== //depot/perl/os2/os2ish.h#54 (text) ====
Index: perl/os2/os2ish.h
--- perl/os2/os2ish.h#53~29580~ 2006-12-18 05:34:00.000000000 -0800
+++ perl/os2/os2ish.h   2007-09-25 11:00:32.000000000 -0700
@@ -223,7 +223,7 @@
 /* These ones should be in the same block as PERL_SYS_TERM() */
 #ifdef PERL_CORE
 
-#  define PERL_SYS_INIT3(argcp, argvp, envp)   \
+#  define PERL_SYS_INIT3_BODY(argcp, argvp, envp)      \
   { void *xreg[2];                             \
     MALLOC_CHECK_TAINT(*argcp, *argvp, *envp)  \
     _response(argcp, argvp);                   \
@@ -231,7 +231,7 @@
     Perl_OS2_init3(*envp, xreg, 0);            \
     PERLIO_INIT
 
-#  define PERL_SYS_INIT(argcp, argvp)  {       \
+#  define PERL_SYS_INIT_BODY(argcp, argvp)  {  \
   { void *xreg[2];                             \
     _response(argcp, argvp);                   \
     _wildcard(argcp, argvp);                   \
@@ -240,11 +240,11 @@
 
 #else  /* Compiling embedded Perl or Perl extension */
 
-#  define PERL_SYS_INIT3(argcp, argvp, envp)   \
+#  define PERL_SYS_INIT3_BODY(argcp, argvp, envp)      \
   { void *xreg[2];                             \
     Perl_OS2_init3(*envp, xreg, 0);            \
     PERLIO_INIT
-#  define PERL_SYS_INIT(argcp, argvp)  {       \
+#  define PERL_SYS_INIT_BODY(argcp, argvp)     {       \
   { void *xreg[2];                             \
     Perl_OS2_init3(NULL, xreg, 0);             \
     PERLIO_INIT
@@ -262,8 +262,8 @@
 #define PERL_SYS_TERM1(xreg)                                           \
      Perl_OS2_term(xreg, 0, FORCE_EMX_DEINIT_RUN_ATEXIT)
 
-/* This one should come in pair with PERL_SYS_INIT() and in the same block */
-#define PERL_SYS_TERM()                                                        
\
+/* This one should come in pair with PERL_SYS_INIT_BODY() and in the same 
block */
+#define PERL_SYS_TERM_BODY()                                                   
\
      PERL_SYS_TERM1(xreg);                                             \
   }
 
@@ -271,7 +271,7 @@
 #  define PERL_CALLCONV _System
 #endif
 
-/* #define PERL_SYS_TERM() STMT_START {        \
+/* #define PERL_SYS_TERM_BODY() STMT_START {   \
     if (Perl_HAB_set) WinTerminate(Perl_hab);  } STMT_END */
 
 #define dXSUB_SYS OS2_XS_init()

==== //depot/perl/perl.c#823 (text) ====
Index: perl/perl.c
--- perl/perl.c#822~31873~      2007-09-15 15:34:16.000000000 -0700
+++ perl/perl.c 2007-09-25 11:00:32.000000000 -0700
@@ -181,6 +181,33 @@
     }
 }
 
+
+/* these implement the PERL_SYS_INIT, PERL_SYS_INIT3, PERL_SYS_TERM macros */
+
+void
+Perl_sys_init(int* argc, char*** argv)
+{
+    PERL_UNUSED_ARG(argc); /* may not be used depending on _BODY macro */
+    PERL_UNUSED_ARG(argv);
+    PERL_SYS_INIT_BODY(argc, argv);
+}
+
+void
+Perl_sys_init3(int* argc, char*** argv, char*** env)
+{
+    PERL_UNUSED_ARG(argc); /* may not be used depending on _BODY macro */
+    PERL_UNUSED_ARG(argv);
+    PERL_UNUSED_ARG(env);
+    PERL_SYS_INIT3_BODY(argc, argv, env);
+}
+
+void
+Perl_sys_term(pTHX)
+{
+    PERL_SYS_TERM_BODY();
+}
+
+
 #ifdef PERL_IMPLICIT_SYS
 PerlInterpreter *
 perl_alloc_using(struct IPerlMem* ipM, struct IPerlMem* ipMS,

==== //depot/perl/perl.h#794 (text) ====
Index: perl/perl.h
--- perl/perl.h#793~31946~      2007-09-23 16:44:59.000000000 -0700
+++ perl/perl.h 2007-09-25 11:00:32.000000000 -0700
@@ -2648,10 +2648,14 @@
 #  define PERL_FPU_POST_EXEC  }
 #endif
 
-#ifndef PERL_SYS_INIT3
-#  define PERL_SYS_INIT3(argvp,argcp,envp) PERL_SYS_INIT(argvp,argcp)
+#ifndef PERL_SYS_INIT3_BODY
+#  define PERL_SYS_INIT3_BODY(argvp,argcp,envp) PERL_SYS_INIT_BODY(argvp,argcp)
 #endif
 
+#define PERL_SYS_INIT(argc, argv)      Perl_sys_init(argc, argv)
+#define PERL_SYS_INIT3(argc, argv, env)        Perl_sys_init3(argc, argv, env)
+#define PERL_SYS_TERM()                        Perl_sys_term(aTHX)
+
 #ifndef PERL_WRITE_MSG_TO_CONSOLE
 #  define PERL_WRITE_MSG_TO_CONSOLE(io, msg, len) PerlIO_write(io, msg, len)
 #endif

==== //depot/perl/plan9/plan9ish.h#18 (text) ====
Index: perl/plan9/plan9ish.h
--- perl/plan9/plan9ish.h#17~29077~     2006-10-21 16:01:45.000000000 -0700
+++ perl/plan9/plan9ish.h       2007-09-25 11:00:32.000000000 -0700
@@ -104,10 +104,10 @@
 #define ABORT() kill(PerlProc_getpid(),SIGABRT);
 
 #define BIT_BUCKET "/dev/null"
-#define PERL_SYS_INIT(c,v)                                 \
+#define PERL_SYS_INIT_BODY(c,v)                                    \
        MALLOC_CHECK_TAINT2(*c,*v) PERLIO_INIT; MALLOC_INIT
 #define dXSUB_SYS
-#define PERL_SYS_TERM()        PERLIO_TERM; MALLOC_TERM
+#define PERL_SYS_TERM_BODY()   PERLIO_TERM; MALLOC_TERM
 
 /*
  * fwrite1() should be a routine with the same calling sequence as fwrite(),

==== //depot/perl/proto.h#859 (text+w) ====
Index: perl/proto.h
--- perl/proto.h#858~31947~     2007-09-23 17:42:07.000000000 -0700
+++ perl/proto.h        2007-09-25 11:00:32.000000000 -0700
@@ -4701,6 +4701,17 @@
                        __attribute__nonnull__(pTHX_1);
 
 PERL_CALLCONV void     Perl_boot_core_mro(pTHX);
+PERL_CALLCONV void     Perl_sys_init(int* argc, char*** argv)
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(2);
+
+PERL_CALLCONV void     Perl_sys_init3(int* argc, char*** argv, char*** env)
+                       __attribute__nonnull__(1)
+                       __attribute__nonnull__(2)
+                       __attribute__nonnull__(3);
+
+PERL_CALLCONV void     Perl_sys_term(pTHX);
+
 
 END_EXTERN_C
 /*

==== //depot/perl/symbian/symbianish.h#7 (text) ====
Index: perl/symbian/symbianish.h
--- perl/symbian/symbianish.h#6~29990~  2007-01-26 00:39:07.000000000 -0800
+++ perl/symbian/symbianish.h   2007-09-25 11:00:32.000000000 -0700
@@ -119,8 +119,9 @@
 #define Fflush(fp)         fflush(fp)
 #define Mkdir(path,mode)   mkdir((path),(mode))
 
-#ifndef PERL_SYS_TERM
-#define PERL_SYS_TERM()                HINTS_REFCNT_TERM; OP_REFCNT_TERM; 
PERLIO_TERM; MALLOC_TERM; CloseSTDLIB();
+#ifndef PERL_SYS_TERM_BODY
+#define PERL_SYS_TERM_BODY()   HINTS_REFCNT_TERM; OP_REFCNT_TERM; \
+                               PERLIO_TERM; MALLOC_TERM; CloseSTDLIB();
 #endif
 
 #define BIT_BUCKET "NUL:"
@@ -170,7 +171,7 @@
 #define times(b)  symbian_times(b)
 #define usleep(u) symbian_usleep(u)
 
-#define PERL_SYS_INIT(c, v) symbian_sys_init(c, v)
+#define PERL_SYS_INIT_BODY(c, v) symbian_sys_init(c, v)
 
 #ifdef __SERIES60_1X__
 #  error "Unfortunately Perl does not work in S60 1.2 (see FAQ-0929)"

==== //depot/perl/unixish.h#45 (text) ====
Index: perl/unixish.h
--- perl/unixish.h#44~29827~    2007-01-15 06:16:53.000000000 -0800
+++ perl/unixish.h      2007-09-25 11:00:32.000000000 -0700
@@ -126,13 +126,13 @@
 #define Fflush(fp)         fflush(fp)
 #define Mkdir(path,mode)   mkdir((path),(mode))
 
-#ifndef PERL_SYS_INIT
-#  define PERL_SYS_INIT(c,v)                                           \
+#ifndef PERL_SYS_INIT_BODY
+#  define PERL_SYS_INIT_BODY(c,v)                                      \
        MALLOC_CHECK_TAINT2(*c,*v) PERL_FPU_INIT; PERLIO_INIT; MALLOC_INIT
 #endif
 
-#ifndef PERL_SYS_TERM
-#  define PERL_SYS_TERM() \
+#ifndef PERL_SYS_TERM_BODY
+#  define PERL_SYS_TERM_BODY() \
     if (!PL_veto_cleanup) { \
        HINTS_REFCNT_TERM; OP_REFCNT_TERM; PERLIO_TERM; MALLOC_TERM; \
     }

==== //depot/perl/vms/vmsish.h#87 (text) ====
Index: perl/vms/vmsish.h
--- perl/vms/vmsish.h#86~31850~ 2007-09-12 01:03:00.000000000 -0700
+++ perl/vms/vmsish.h   2007-09-25 11:00:32.000000000 -0700
@@ -402,8 +402,8 @@
 #else
 #define BIT_BUCKET "/dev/null"
 #endif
-#define PERL_SYS_INIT(c,v)     MALLOC_CHECK_TAINT2(*c,*v) 
vms_image_init((c),(v)); PERLIO_INIT; MALLOC_INIT
-#define PERL_SYS_TERM()                HINTS_REFCNT_TERM; OP_REFCNT_TERM; 
PERLIO_TERM; MALLOC_TERM
+#define PERL_SYS_INIT_BODY(c,v)        MALLOC_CHECK_TAINT2(*c,*v) 
vms_image_init((c),(v)); PERLIO_INIT; MALLOC_INIT
+#define PERL_SYS_TERM_BODY()           HINTS_REFCNT_TERM; OP_REFCNT_TERM; 
PERLIO_TERM; MALLOC_TERM
 #define dXSUB_SYS
 #define HAS_KILL
 #define HAS_WAIT
End of Patch.

Reply via email to