Skip to content

Commit 9426adc

Browse files
Ilya ZakharevichGurusamy Sarathy
Ilya Zakharevich
authored and
Gurusamy Sarathy
committed
applied suggested patch; removed $VERSION = $VERSION hack
(change#4043 fixed the need for that) Message-Id: <[email protected]> Subject: [PATCH 5.005_62] XSLoader.pm p4raw-link: @4043 on //depot/cfgperl: 09bef84 p4raw-id: //depot/perl@4623
1 parent 34baa6c commit 9426adc

File tree

26 files changed

+75
-73
lines changed

26 files changed

+75
-73
lines changed

MANIFEST

+1
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ ext/Devel/Peek/Peek.xs Data debugging tool, externals
231231
ext/DynaLoader/DynaLoader_pm.PL Dynamic Loader perl module
232232
ext/DynaLoader/Makefile.PL Dynamic Loader makefile writer
233233
ext/DynaLoader/README Dynamic Loader notes and intro
234+
ext/DynaLoader/XSLoader_pm.PL Simple XS Loader perl module
234235
ext/DynaLoader/dl_aix.xs AIX implementation
235236
ext/DynaLoader/dl_beos.xs BeOS implementation
236237
ext/DynaLoader/dl_cygwin.xs Cygwin implementation

ext/B/B.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
# License or the Artistic License, as specified in the README file.
77
#
88
package B;
9-
require DynaLoader;
9+
use XSLoader ();
1010
require Exporter;
11-
@ISA = qw(Exporter DynaLoader);
11+
@ISA = qw(Exporter);
1212
@EXPORT_OK = qw(minus_c ppname
1313
class peekop cast_I32 cstring cchar hash threadsv_names
1414
main_root main_start main_cv svref_2object opnumber amagic_generation
@@ -259,7 +259,7 @@ sub walksymtable {
259259
}
260260
}
261261

262-
bootstrap B;
262+
XSLoader::load 'B';
263263

264264
1;
265265

ext/ByteLoader/ByteLoader.pm

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
package ByteLoader;
22

3-
require DynaLoader;
4-
5-
@ISA = qw(DynaLoader);
3+
use XSLoader ();
64

75
$VERSION = 0.03;
86

9-
bootstrap ByteLoader $VERSION;
7+
XSLoader::load 'ByteLoader', $VERSION;
108

119
# Preloaded methods go here.
1210

ext/DB_File/DB_File.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ $DB_RECNO = new DB_File::RECNOINFO ;
155155
require Tie::Hash;
156156
require Exporter;
157157
use AutoLoader;
158-
require DynaLoader;
159-
@ISA = qw(Tie::Hash Exporter DynaLoader);
158+
use XSLoader ();
159+
@ISA = qw(Tie::Hash Exporter);
160160
@EXPORT = qw(
161161
$DB_BTREE $DB_HASH $DB_RECNO
162162
@@ -231,7 +231,7 @@ eval {
231231
# };
232232
#}
233233

234-
bootstrap DB_File $VERSION;
234+
XSLoader::load 'DB_File', $VERSION;
235235

236236
# Preloaded methods go here. Autoload methods go after __END__, and are
237237
# processed by the autosplit program.

ext/Data/Dumper/Dumper.pm

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,22 @@
99

1010
package Data::Dumper;
1111

12-
$VERSION = $VERSION = '2.101';
12+
$VERSION = '2.101';
1313

1414
#$| = 1;
1515

1616
require 5.004_02;
1717
require Exporter;
18-
require DynaLoader;
18+
use XSLoader ();
1919
require overload;
2020

2121
use Carp;
2222

23-
@ISA = qw(Exporter DynaLoader);
23+
@ISA = qw(Exporter);
2424
@EXPORT = qw(Dumper);
2525
@EXPORT_OK = qw(DumperX);
2626

27-
bootstrap Data::Dumper;
27+
XSLoader::load 'Data::Dumper';
2828

2929
# module vars and their defaults
3030
$Indent = 2 unless defined $Indent;

ext/Devel/DProf/DProf.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,11 @@ sub DB {
182182
# print "nonXS DBDB\n";
183183
}
184184

185-
require DynaLoader;
186-
@Devel::DProf::ISA = 'DynaLoader';
185+
use XSLoader ();
186+
187187
$Devel::DProf::VERSION = '19990108'; # this version not authorized by
188188
# Dean Roehrich. See "Changes" file.
189189

190-
bootstrap Devel::DProf $Devel::DProf::VERSION;
190+
XSLoader::load 'Devel::DProf', $Devel::DProf::VERSION;
191191

192192
1;

ext/Devel/Peek/Peek.pm

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33

44
package Devel::Peek;
55

6-
$VERSION = $VERSION = 0.95;
6+
$VERSION = 0.95;
77

88
require Exporter;
9-
require DynaLoader;
9+
use XSLoader ();
1010

11-
@ISA = qw(Exporter DynaLoader);
11+
@ISA = qw(Exporter);
1212
@EXPORT = qw(Dump mstat DeadCode DumpArray DumpWithOP DumpProg);
1313
@EXPORT_OK = qw(SvREFCNT SvREFCNT_inc SvREFCNT_dec);
1414
%EXPORT_TAGS = ('ALL' => [@EXPORT, @EXPORT_OK]);
1515

16-
bootstrap Devel::Peek;
16+
XSLoader::load 'Devel::Peek';
1717

1818
sub DumpWithOP ($;$) {
1919
local($Devel::Peek::dump_ops)=1;

ext/DynaLoader/DynaLoader_pm.PL

+9-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ package DynaLoader;
2828
#
2929
# [email protected], August 1994
3030

31-
$VERSION = $VERSION = "1.03"; # avoid typo warning
31+
$VERSION = "1.03"; # avoid typo warning
3232

3333
require AutoLoader;
3434
*AUTOLOAD = \&AutoLoader::AUTOLOAD;
@@ -129,6 +129,14 @@ if ($dl_debug) {
129129

130130
sub croak { require Carp; Carp::croak(@_) }
131131

132+
sub bootstrap_inherit {
133+
my $module = $_[0];
134+
local *isa = *{"$module\::ISA"};
135+
local @isa = (@isa, 'DynaLoader');
136+
# Cannot goto due to delocalization. Will report errors on a wrong line?
137+
bootstrap(@_);
138+
}
139+
132140
# The bootstrap function cannot be autoloaded (without complications)
133141
# so we define it here:
134142

ext/DynaLoader/Makefile.PL

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ WriteMakefile(
88
SKIP => [qw(dynamic dynamic_lib dynamic_bs)],
99
XSPROTOARG => '-noprototypes', # XXX remove later?
1010
VERSION_FROM => 'DynaLoader_pm.PL',
11-
PL_FILES => {'DynaLoader_pm.PL'=>'DynaLoader.pm'},
12-
PM => {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm'},
11+
PL_FILES => {'DynaLoader_pm.PL'=>'DynaLoader.pm',
12+
'XSLoader_pm.PL'=>'XSLoader.pm'},
13+
PM => {'DynaLoader.pm' => '$(INST_LIBDIR)/DynaLoader.pm',
14+
'XSLoader.pm' => '$(INST_LIBDIR)/XSLoader.pm'},
1315
clean => {FILES => 'DynaLoader.c DynaLoader.xs DynaLoader.pm'},
1416
);
1517

ext/DynaLoader/dlutils.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ dl_generic_private_init(pTHXo) /* called by dl_*.xs dl_private_init() */
3030
{
3131
char *perl_dl_nonlazy;
3232
#ifdef DEBUGGING
33-
dl_debug = SvIV(get_sv("DynaLoader::dl_debug", 0x04) );
33+
SV *sv = get_sv("DynaLoader::dl_debug", 0);
34+
dl_debug = sv ? SvIV(sv) : 0;
3435
#endif
3536
if ( (perl_dl_nonlazy = getenv("PERL_DL_NONLAZY")) != NULL )
3637
dl_nonlazy = atoi(perl_dl_nonlazy);

ext/Fcntl/Fcntl.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ what constants are implemented in your system.
4545
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $AUTOLOAD);
4646

4747
require Exporter;
48-
require DynaLoader;
49-
@ISA = qw(Exporter DynaLoader);
48+
use XSLoader ();
49+
@ISA = qw(Exporter);
5050
$VERSION = "1.03";
5151
# Items to export into callers namespace by default
5252
# (move infrequently used names to @EXPORT_OK below)
@@ -161,6 +161,6 @@ sub AUTOLOAD {
161161
goto &$AUTOLOAD;
162162
}
163163

164-
bootstrap Fcntl $VERSION;
164+
XSLoader::load 'Fcntl', $VERSION;
165165

166166
1;

ext/File/Glob/Glob.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ use vars qw($VERSION @ISA @EXPORT_OK @EXPORT_FAIL
66
%EXPORT_TAGS $AUTOLOAD $DEFAULT_FLAGS);
77

88
require Exporter;
9-
require DynaLoader;
9+
use XSLoader ();
1010
require AutoLoader;
1111

12-
@ISA = qw(Exporter DynaLoader AutoLoader);
12+
@ISA = qw(Exporter AutoLoader);
1313

1414
@EXPORT_OK = qw(
1515
csh_glob
@@ -91,7 +91,7 @@ sub AUTOLOAD {
9191
goto &$AUTOLOAD;
9292
}
9393

94-
bootstrap File::Glob $VERSION;
94+
XSLoader::load 'File::Glob', $VERSION;
9595

9696
# Preloaded methods go here.
9797

ext/GDBM_File/GDBM_File.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ require Carp;
4646
require Tie::Hash;
4747
require Exporter;
4848
use AutoLoader;
49-
require DynaLoader;
50-
@ISA = qw(Tie::Hash Exporter DynaLoader);
49+
use XSLoader ();
50+
@ISA = qw(Tie::Hash Exporter);
5151
@EXPORT = qw(
5252
GDBM_CACHESIZE
5353
GDBM_FAST
@@ -78,7 +78,7 @@ sub AUTOLOAD {
7878
goto &$AUTOLOAD;
7979
}
8080

81-
bootstrap GDBM_File $VERSION;
81+
XSLoader::load 'GDBM_File', $VERSION;
8282

8383
# Preloaded methods go here. Autoload methods go after __END__, and are
8484
# processed by the autosplit program.

ext/IO/IO.pm

+2-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,11 @@
22

33
package IO;
44

5-
require DynaLoader;
6-
require Exporter;
5+
use XSLoader ();
76
use Carp;
87

9-
use vars qw(@ISA $VERSION @EXPORT);
10-
11-
@ISA = qw(DynaLoader);
128
$VERSION = "1.20";
13-
bootstrap IO $VERSION;
9+
XSLoader::load 'IO', $VERSION;
1410

1511
sub import {
1612
shift;

ext/NDBM_File/NDBM_File.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ BEGIN {
88
use vars qw($VERSION @ISA);
99

1010
require Tie::Hash;
11-
require DynaLoader;
11+
use DynaLoader ();
1212

13-
@ISA = qw(Tie::Hash DynaLoader);
13+
@ISA = qw(Tie::Hash);
1414

1515
$VERSION = "1.03";
1616

17-
bootstrap NDBM_File $VERSION;
17+
XSLoader::load 'NDBM_File', $VERSION;
1818

1919
1;
2020

ext/ODBM_File/ODBM_File.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ use strict;
44
use vars qw($VERSION @ISA);
55

66
require Tie::Hash;
7-
require DynaLoader;
7+
use DynaLoader ();
88

9-
@ISA = qw(Tie::Hash DynaLoader);
9+
@ISA = qw(Tie::Hash);
1010

1111
$VERSION = "1.02";
1212

13-
bootstrap ODBM_File $VERSION;
13+
XSLoader::load 'ODBM_File', $VERSION;
1414

1515
1;
1616

ext/Opcode/Opcode.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ $XS_VERSION = "1.03";
1010
use strict;
1111
use Carp;
1212
use Exporter ();
13-
use DynaLoader ();
14-
@ISA = qw(Exporter DynaLoader);
13+
use XSLoader ();
14+
@ISA = qw(Exporter);
1515

1616
BEGIN {
1717
@EXPORT_OK = qw(
@@ -28,7 +28,7 @@ sub opset_to_hex ($);
2828
sub opdump (;$);
2929
use subs @EXPORT_OK;
3030

31-
bootstrap Opcode $XS_VERSION;
31+
XSLoader::load 'Opcode', $XS_VERSION;
3232

3333
_init_optags();
3434

ext/POSIX/POSIX.pm

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ require Config;
99
use Symbol;
1010

1111
require Exporter;
12-
require DynaLoader;
13-
@ISA = qw(Exporter DynaLoader);
12+
use XSLoader ();
13+
@ISA = qw(Exporter);
1414

15-
$VERSION = $VERSION = "1.03" ;
15+
$VERSION = "1.03" ;
1616

1717
%EXPORT_TAGS = (
1818

@@ -195,7 +195,7 @@ sub import {
195195
}
196196

197197

198-
bootstrap POSIX $VERSION;
198+
XSLoader::load 'POSIX', $VERSION;
199199

200200
my $EINVAL = constant("EINVAL", 0);
201201
my $EAGAIN = constant("EAGAIN", 0);

ext/SDBM_File/SDBM_File.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ use strict;
44
use vars qw($VERSION @ISA);
55

66
require Tie::Hash;
7-
require DynaLoader;
7+
use XSLoader ();
88

9-
@ISA = qw(Tie::Hash DynaLoader);
9+
@ISA = qw(Tie::Hash);
1010

1111
$VERSION = "1.02" ;
1212

13-
bootstrap SDBM_File $VERSION;
13+
XSLoader::load 'SDBM_File', $VERSION;
1414

1515
1;
1616

ext/Socket/Socket.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,8 @@ have AF_UNIX in the right place.
162162
use Carp;
163163

164164
require Exporter;
165-
require DynaLoader;
166-
@ISA = qw(Exporter DynaLoader);
165+
use XSLoader ();
166+
@ISA = qw(Exporter);
167167
@EXPORT = qw(
168168
inet_aton inet_ntoa pack_sockaddr_in unpack_sockaddr_in
169169
pack_sockaddr_un unpack_sockaddr_un
@@ -333,6 +333,6 @@ sub AUTOLOAD {
333333
goto &$AUTOLOAD;
334334
}
335335

336-
bootstrap Socket $VERSION;
336+
XSLoader::load 'Socket', $VERSION;
337337

338338
1;

ext/Thread/Thread.pm

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package Thread;
22
require Exporter;
3-
require DynaLoader;
3+
use XSLoader ();
44
use vars qw($VERSION @ISA @EXPORT);
55

66
$VERSION = "1.0";
77

8-
@ISA = qw(Exporter DynaLoader);
8+
@ISA = qw(Exporter);
99
@EXPORT_OK = qw(yield cond_signal cond_broadcast cond_wait async);
1010

1111
=head1 NAME
@@ -204,6 +204,6 @@ sub eval {
204204
return eval { shift->join; };
205205
}
206206

207-
bootstrap Thread;
207+
XSLoader::load 'Thread';
208208

209209
1;

0 commit comments

Comments
 (0)