This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Plan 9 compiler can't return quads from the ?: (condop).
authorJarkko Hietaniemi <jhi@iki.fi>
Sun, 26 Jan 2003 09:08:36 +0000 (09:08 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Sun, 26 Jan 2003 09:08:36 +0000 (09:08 +0000)
(There may be more spots like this, so a Configure test
maybe in order, but this works for now.)  From Russ Cox.

p4raw-id: //depot/perl@18583

ext/PerlIO/via/via.xs
plan9/plan9ish.h

index 524d24a..1f0ff40 100644 (file)
@@ -346,7 +346,7 @@ PerlIOVia_binmode(pTHX_ PerlIO * f)
     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 @@ PerlIOVia_seek(pTHX_ PerlIO * f, Off_t offset, int whence)
     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
index 6fb5966..3df8bf5 100644 (file)
 /* 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__ */