summaryrefslogtreecommitdiff
path: root/sv.h
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-07-11 19:27:48 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-07-11 19:27:48 +0000
commit4755096ec61711c5104ba0b6b9314f32ca0351fe (patch)
tree82996f8fa5485964bdfb76e935857ea9bf4165ea /sv.h
parentf05cb5f197f40c7c89d7ac1b0d1fd2e1ac165afe (diff)
downloadperl-4755096ec61711c5104ba0b6b9314f32ca0351fe.tar.gz
integrate cfgperl changes#6293..6324 into mainline
p4raw-link: @6324 on //depot/cfgperl: 81bf48a6dbba4b295dfa172a17ca70b654dbf225 p4raw-link: @6293 on //depot/cfgperl: 6e37ea6052902cde1aeb08a2129ffc7c8ea53736 p4raw-id: //depot/perl@6369 p4raw-branched: from //depot/cfgperl@6368 'branch in' lib/Win32.pod lib/lib_pm.PL p4raw-deleted: from //depot/cfgperl@6368 'delete in' pod/Win32.pod (@5937..) pod/buildtoc (@6091..) lib/lib.pm.PL (@6227..) pod/Makefile (@6232..) p4raw-integrated: from //depot/cfgperl@6368 'copy in' thread.h (@5656..) lib/warnings/register.pm (@5704..) ext/B/B/Stash.pm (@5972..) lib/CGI/Util.pm (@6034..) util.c (@6217..) gv.c (@6244..) pp.c (@6260..) doop.c (@6269..) pod/perlfunc.pod (@6277..) pp_ctl.c (@6293..) makedef.pl (@6301..) embed.h global.sym objXSUB.h perlapi.c proto.h (@6305..) win32/Makefile (@6307..) Makefile.SH (@6309..) t/op/method.t (@6312..) sv.h (@6315..) 'ignore' op.c (@6273..) 'merge in' embed.pl win32/win32.c (@6305..) p4raw-integrated: from //depot/cfgperl@6324 'merge in' toke.c (@6307..) p4raw-branched: from //depot/cfgperl@6323 'branch in' pod/buildtoc.PL (@6319..) p4raw-integrated: from //depot/cfgperl@6323 'copy in' pod/perl.pod (@6319..) pod/perltoc.pod (@6322..) 'merge in' MANIFEST (@6319..) p4raw-branched: from //depot/cfgperl@6319 'branch in' pod/Makefile.SH p4raw-integrated: from //depot/cfgperl@6315 'ignore' pp_hot.c (@6313..) p4raw-integrated: from //depot/cfgperl@6311 'copy in' ext/POSIX/POSIX.pod (@6296..) p4raw-integrated: from //depot/cfgperl@6307 'merge in' doio.c (@6223..)
Diffstat (limited to 'sv.h')
-rw-r--r--sv.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/sv.h b/sv.h
index 0e125543ef..b77a9d30cc 100644
--- a/sv.h
+++ b/sv.h
@@ -363,7 +363,19 @@ struct xpvio {
PerlIO * xio_ifp; /* ifp and ofp are normally the same */
PerlIO * xio_ofp; /* but sockets need separate streams */
- DIR * xio_dirp; /* for opendir, readdir, etc */
+ /* Cray addresses everything by word boundaries (64 bits) and
+ * code and data pointers cannot be mixed (which is exactly what
+ * Perl_filter_add() tries to do with the dirp), hence the following
+ * union trick (as suggested by Gurusamy Sarathy).
+ * For further information see Geir Johansen's problem report titled
+ [ID 20000612.002] Perl problem on Cray system
+ * The any pointer (known as IoANY()) will also be a good place
+ * to hang any IO disciplines to.
+ */
+ union {
+ DIR * xiou_dirp; /* for opendir, readdir, etc */
+ void * xiou_any; /* for alignment */
+ } xio_dirpu;
long xio_lines; /* $. */
long xio_page; /* $% */
long xio_page_len; /* $= */
@@ -378,6 +390,8 @@ struct xpvio {
char xio_type;
char xio_flags;
};
+#define xio_dirp xio_dirpu.xiou_dirp
+#define xio_any xio_dirpu.xiou_any
#define IOf_ARGV 1 /* this fp iterates over ARGV */
#define IOf_START 2 /* check for null ARGV and substitute '-' */
@@ -704,6 +718,7 @@ Set the length of the string which is in the SV. See C<SvCUR>.
#define IoIFP(sv) ((XPVIO*) SvANY(sv))->xio_ifp
#define IoOFP(sv) ((XPVIO*) SvANY(sv))->xio_ofp
#define IoDIRP(sv) ((XPVIO*) SvANY(sv))->xio_dirp
+#define IoANY(sv) ((XPVIO*) SvANY(sv))->xio_any
#define IoLINES(sv) ((XPVIO*) SvANY(sv))->xio_lines
#define IoPAGE(sv) ((XPVIO*) SvANY(sv))->xio_page
#define IoPAGE_LEN(sv) ((XPVIO*) SvANY(sv))->xio_page_len