summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-02-26 03:56:19 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-02-26 03:56:19 +0000
commitd613ef02e4bf2ccbbac161910d879e49ce35ecd8 (patch)
tree0645273db99be98d62780677bee79cbceb8d8992
parentf1c0db8dbc906cad6c85874be33c7969497df1cd (diff)
downloadperl-d613ef02e4bf2ccbbac161910d879e49ce35ecd8.tar.gz
[win32] various cleanups so that B can be built as "just another extension"
- export symbols needed for building B - bset_obj_store() is needed by byterun(), so define it there instead of at B.xs, and export it - freadpv() is only used in B.xs, so move it there - byte*.h are now included by perl.h - regenerate embed*.h p4raw-id: //depot/win32/perl@589
-rw-r--r--bytecode.h2
-rw-r--r--bytecode.pl24
-rw-r--r--byterun.c16
-rw-r--r--byterun.h8
-rw-r--r--embed.h2
-rw-r--r--ext/B/B.xs16
-rw-r--r--ext/B/Makefile.PL11
-rw-r--r--global.sym2
-rw-r--r--perl.h2
9 files changed, 37 insertions, 46 deletions
diff --git a/bytecode.h b/bytecode.h
index bfa4025f14..7ca7ffd3ac 100644
--- a/bytecode.h
+++ b/bytecode.h
@@ -8,8 +8,6 @@ typedef OP *opindex;
typedef IV IV64;
EXT int iv_overflows INIT(0);
-void *bset_obj_store _((void *, I32));
-void freadpv _((U32, void *));
EXT SV *sv;
#ifndef USE_THREADS
diff --git a/bytecode.pl b/bytecode.pl
index e72d852c32..c545f4136d 100644
--- a/bytecode.pl
+++ b/bytecode.pl
@@ -65,8 +65,20 @@ print BYTERUN_C $c_header, <<'EOT';
#include "EXTERN.h"
#include "perl.h"
-#include "bytecode.h"
-#include "byterun.h"
+
+void *
+bset_obj_store(void *obj, I32 ix)
+{
+ if (ix > obj_list_fill) {
+ if (obj_list_fill == -1)
+ New(666, obj_list, ix + 1, void*);
+ else
+ Renew(obj_list, ix + 1, void*);
+ obj_list_fill = ix;
+ }
+ obj_list[ix] = obj;
+ return obj;
+}
#ifdef INDIRECT_BGET_MACROS
void byterun(struct bytestream bs)
@@ -153,18 +165,12 @@ struct bytestream {
int (*fread)(char *, size_t, size_t, void*);
void (*freadpv)(U32, void*);
};
-void freadpv _((U32, void *));
void byterun _((struct bytestream));
#else
void byterun _((FILE *));
#endif /* INDIRECT_BGET_MACROS */
-#ifndef PATCHLEVEL
-#include "patchlevel.h"
-#endif
-#if PATCHLEVEL < 4 || (PATCHLEVEL == 4 && SUBVERSION < 50)
-#define dTHR extern int errno
-#endif
+void *bset_obj_store _((void *, I32));
enum {
EOT
diff --git a/byterun.c b/byterun.c
index fe7d6d3a62..57c662009a 100644
--- a/byterun.c
+++ b/byterun.c
@@ -11,8 +11,20 @@
#include "EXTERN.h"
#include "perl.h"
-#include "bytecode.h"
-#include "byterun.h"
+
+void *
+bset_obj_store(void *obj, I32 ix)
+{
+ if (ix > obj_list_fill) {
+ if (obj_list_fill == -1)
+ New(666, obj_list, ix + 1, void*);
+ else
+ Renew(obj_list, ix + 1, void*);
+ obj_list_fill = ix;
+ }
+ obj_list[ix] = obj;
+ return obj;
+}
#ifdef INDIRECT_BGET_MACROS
void byterun(struct bytestream bs)
diff --git a/byterun.h b/byterun.h
index f7185c7b0a..edc043ddf1 100644
--- a/byterun.h
+++ b/byterun.h
@@ -15,18 +15,12 @@ struct bytestream {
int (*fread)(char *, size_t, size_t, void*);
void (*freadpv)(U32, void*);
};
-void freadpv _((U32, void *));
void byterun _((struct bytestream));
#else
void byterun _((FILE *));
#endif /* INDIRECT_BGET_MACROS */
-#ifndef PATCHLEVEL
-#include "patchlevel.h"
-#endif
-#if PATCHLEVEL < 4 || (PATCHLEVEL == 4 && SUBVERSION < 50)
-#define dTHR extern int errno
-#endif
+void *bset_obj_store _((void *, I32));
enum {
INSN_RET, /* 0 */
diff --git a/embed.h b/embed.h
index 22634a0656..4f0a832688 100644
--- a/embed.h
+++ b/embed.h
@@ -68,6 +68,7 @@
#define bool__amg Perl_bool__amg
#define boot_core_UNIVERSAL Perl_boot_core_UNIVERSAL
#define bor_amg Perl_bor_amg
+#define bset_obj_store Perl_bset_obj_store
#define bxor_amg Perl_bxor_amg
#define byterun Perl_byterun
#define call_list Perl_call_list
@@ -910,6 +911,7 @@
#define sle_amg Perl_sle_amg
#define slt_amg Perl_slt_amg
#define sne_amg Perl_sne_amg
+#define specialsv_list Perl_specialsv_list
#define sqrt_amg Perl_sqrt_amg
#define stack_grow Perl_stack_grow
#define start_subparse Perl_start_subparse
diff --git a/ext/B/B.xs b/ext/B/B.xs
index 0bb7acba02..3e519afe43 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -11,8 +11,6 @@
#include "perl.h"
#include "XSUB.h"
#include "INTERN.h"
-#include "bytecode.h"
-#include "byterun.h"
static char *svclassnames[] = {
"B::NULL",
@@ -288,20 +286,6 @@ cchar(SV *sv)
return sstr;
}
-void *
-bset_obj_store(void *obj, I32 ix)
-{
- if (ix > obj_list_fill) {
- if (obj_list_fill == -1)
- New(666, obj_list, ix + 1, void*);
- else
- Renew(obj_list, ix + 1, void*);
- obj_list_fill = ix;
- }
- obj_list[ix] = obj;
- return obj;
-}
-
#ifdef INDIRECT_BGET_MACROS
void freadpv(U32 len, void *data)
{
diff --git a/ext/B/Makefile.PL b/ext/B/Makefile.PL
index bc42a34d33..92f01e24c4 100644
--- a/ext/B/Makefile.PL
+++ b/ext/B/Makefile.PL
@@ -4,7 +4,6 @@ use Config;
my $e = $Config{'exe_ext'};
my $o = $Config{'obj_ext'};
my $exeout_flag = '-o ';
-my @extras = ();
if ($^O eq 'MSWin32') {
if ($Config{'cc'} =~ /^cl/i) {
$exeout_flag = '-Fe';
@@ -12,21 +11,13 @@ if ($^O eq 'MSWin32') {
elsif ($Config{'cc'} =~ /^bcc/i) {
$exeout_flag = '-e';
}
- # XXX this probably applies to everyone else
- @extras = (
- OBJECT => "B$o byterun$o",
- depend => {
- "B$o" => "B.c ../../bytecode.h ../../byterun.h",
- "byterun$o" => "../../byterun.c ../../bytecode.h ../../byterun.h",
- });
}
WriteMakefile(
NAME => "B",
VERSION => "a5",
- @extras,
clean => {
- FILES => "perl byteperl$e *$o B.c *~"
+ FILES => "perl$e byteperl$e *$o B.c *~"
}
);
diff --git a/global.sym b/global.sym
index f1d8c22962..f908d3c9e6 100644
--- a/global.sym
+++ b/global.sym
@@ -100,6 +100,7 @@ sin_amg
sle_amg
slt_amg
sne_amg
+specialsv_list
sqrt_amg
string_amg
subtr_amg
@@ -198,6 +199,7 @@ block_end
block_gimme
block_start
boot_core_UNIVERSAL
+bset_obj_store
byterun
call_list
cando
diff --git a/perl.h b/perl.h
index 9b521b9d3c..49032b55e1 100644
--- a/perl.h
+++ b/perl.h
@@ -1100,6 +1100,8 @@ union any {
#include "hv.h"
#include "mg.h"
#include "scope.h"
+#include "bytecode.h"
+#include "byterun.h"
/* work around some libPW problems */
#ifdef DOINIT