Change 18583 by jhi@kosh on 2003/01/26 09:08:36
Plan 9 compiler can't return quads from the ?: (condop).
(There may be more spots like this, so a Configure test
maybe in order, but this works for now.) From Russ Cox.
Affected files ...
... //depot/perl/ext/PerlIO/via/via.xs#5 edit
... //depot/perl/plan9/plan9ish.h#10 edit
Differences ...
==== //depot/perl/ext/PerlIO/via/via.xs#5 (text) ====
Index: perl/ext/PerlIO/via/via.xs
--- perl/ext/PerlIO/via/via.xs#4~18327~ Tue Dec 17 18:08:12 2002
+++ perl/ext/PerlIO/via/via.xs Sun Jan 26 01:08:36 2003
@@ -346,7 +346,7 @@
return SvIV(result);
}
-IV
+Off_t
PerlIOVia_seek(pTHX_ PerlIO * f, Off_t offset, int whence)
{
PerlIOVia *s = PerlIOSelf(f, PerlIOVia);
@@ -356,7 +356,14 @@
SV *result =
PerlIOVia_method(aTHX_ f, MYMethod(SEEK), G_SCALAR, offsv, whsv,
Nullsv);
+#if Off_t_size == 8 && defined(CONDOP_SIZE) && CONDOP_SIZE < Off_t_size
+ if (result)
+ return (Off_t) SvIV(result);
+ else
+ return (Off_t) -1;
+#else
return (result) ? SvIV(result) : -1;
+#endif
}
Off_t
==== //depot/perl/plan9/plan9ish.h#10 (text) ====
Index: perl/plan9/plan9ish.h
--- perl/plan9/plan9ish.h#9~5628~ Thu Mar 9 09:39:58 2000
+++ perl/plan9/plan9ish.h Sun Jan 26 01:08:36 2003
@@ -131,4 +131,6 @@
/* For use by POSIX.xs */
extern int tcsendbreak(int, int);
+#define CONDOP_SIZE 4 /* The Plan 9 compiler cannot return quads from ?: */
+
#endif /* __PLAN9ISH_H__ */
End of Patch.