Put back the cygwin32 Configure fix of 3582 undone by 3597.
[p5sagit/p5-mst-13.2.git] / opcode.pl
index c763675..50a767b 100755 (executable)
--- a/opcode.pl
+++ b/opcode.pl
@@ -29,10 +29,10 @@ while (<DATA>) {
 
 $i = 0;
 print <<"END";
-#define pp_i_preinc pp_preinc
-#define pp_i_predec pp_predec
-#define pp_i_postinc pp_postinc
-#define pp_i_postdec pp_postdec
+#define Perl_pp_i_preinc Perl_pp_preinc
+#define Perl_pp_i_predec Perl_pp_predec
+#define Perl_pp_i_postinc Perl_pp_postinc
+#define Perl_pp_i_postdec Perl_pp_postdec
 
 typedef enum {
 END
@@ -46,6 +46,9 @@ print "\n#define MAXO ", scalar @ops, "\n\n";
 # Emit op names and descriptions.
 
 print <<END;
+
+START_EXTERN_C
+
 #ifndef DOINIT
 EXT char *PL_op_name[];
 #else
@@ -77,45 +80,36 @@ print <<END;
 };
 #endif
 
-#ifndef PERL_OBJECT
-START_EXTERN_C
-
-#undef PERL_CKDEF
-#undef PERL_PPDEF
-#define PERL_CKDEF(s) OP *s _((OP *o));
-#define PERL_PPDEF(s) OP *s _((ARGSproto));
-
-#include "pp_proto.h"
+END_EXTERN_C
 
 END
 
 # Emit function declarations.
 
 #for (sort keys %ckname) {
-#    print "OP *\t", &tab(3,$_),"_((OP* o));\n";
+#    print "OP *\t", &tab(3,$_),"(pTHX_ OP* o);\n";
 #}
 #
 #print "\n";
 #
 #for (@ops) {
-#    print "OP *\t", &tab(3, "pp_$_"), "_((ARGSproto));\n";
+#    print "OP *\t", &tab(3, "pp_$_"), "(pTHX);\n";
 #}
 
 # Emit ppcode switch array.
 
 print <<END;
 
-END_EXTERN_C
-#endif /* PERL_OBJECT */
+START_EXTERN_C
 
 #ifndef DOINIT
-EXT OP * (CPERLscope(*PL_ppaddr)[])(ARGSproto);
+EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX);
 #else
-EXT OP * (CPERLscope(*PL_ppaddr)[])(ARGSproto) = {
+EXT OP * (CPERLscope(*PL_ppaddr)[])(pTHX) = {
 END
 
 for (@ops) {
-    print "\tpp_$_,\n";
+    print "\tPerl_pp_$_,\n";
 }
 
 print <<END;
@@ -128,13 +122,13 @@ END
 
 print <<END;
 #ifndef DOINIT
-EXT OP * (CPERLscope(*PL_check)[]) _((OP *op));
+EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op);
 #else
-EXT OP * (CPERLscope(*PL_check)[]) _((OP *op)) = {
+EXT OP * (CPERLscope(*PL_check)[]) (pTHX_ OP *op) = {
 END
 
 for (@ops) {
-    print "\t", &tab(3, "$check{$_},"), "/* $_ */\n";
+    print "\t", &tab(3, "Perl_$check{$_},"), "/* $_ */\n";
 }
 
 print <<END;
@@ -208,6 +202,8 @@ for (@ops) {
 print <<END;
 };
 #endif
+
+END_EXTERN_C
 END
 
 close OC or die "Error closing opcode.h: $!";
@@ -218,16 +214,17 @@ open PP, '>pp_proto.h' or die "Error creating pp_proto.h: $!";
 open PPSYM, '>pp.sym' or die "Error creating pp.sym: $!";
 
 for (sort keys %ckname) {
-    print PP "PERL_CKDEF($_)\n";
-#OP *\t", &tab(3,$_),"_((OP* o));\n";
+    print PP "PERL_CKDEF(Perl_$_)\n";
+    print PPSYM "Perl_$_\n";
+#OP *\t", &tab(3,$_),"(OP* o);\n";
 }
 
 print PP "\n\n";
 
 for (@ops) {
     next if /^i_(pre|post)(inc|dec)$/;
-    print PP "PERL_PPDEF(pp_$_)\n";
-    print PPSYM "pp_$_\n";
+    print PP "PERL_PPDEF(Perl_pp_$_)\n";
+    print PPSYM "Perl_pp_$_\n";
 }
 
 close PP or die "Error closing pp_proto.h: $!";
@@ -274,7 +271,7 @@ rv2cv               subroutine deref        ck_rvconst      d1
 anoncode       anonymous subroutine    ck_anoncode     $       
 prototype      subroutine prototype    ck_null         s%      S
 refgen         reference constructor   ck_spair        m1      L
-srefgen                scalar ref constructor  ck_null         fs1     S
+srefgen                single ref constructor  ck_null         fs1     S
 ref            reference-type operator ck_fun          stu%    S?
 bless          bless                   ck_fun          s@      S S?