develooper Front page | perl.perl5.porters | Postings from July 2001

Patch needed for UTS

Thread Next
July 3, 2001 09:32
Patch needed for UTS
Message ID:
I still need UV_MAX to be redefined for UTS.  The following is one
way of doing it.  It exchanged one old patch that also for UTS (which
redefines a macro that is no longer used) with a new patch, effective
with the current code level (11108).

This was originally proposed to fix UTS problems with the test op/pack.t,
and Nick Clark has implemented another, and presumably better, fix for
that, but this also fixes all my test failures in op/numeric.t.

If you have a more elegant fix, let me know, but UV_MAX must NOT be
defined as (unsigned long){whatever} for UTS, because then comparisons
with double will not work correctly (there is no problem with (unsigned)
typecasts, only with (unsigned long)).

Thanks,   Hal Morris UTS Global LLC.

--- perl.h.orig	Tue Jul  3 10:22:14 2001
+++ perl.h	Tue Jul  3 10:22:07 2001
@@ -1131,23 +1131,9 @@
 #  endif
-  I've tracked down a weird bug in Perl5.6.1 to the UTS compiler's
-  mishandling of MY_UV_MAX in util.c.  It is defined as
-    #ifndef MY_UV_MAX
-    #  define MY_UV_MAX ((UV)IV_MAX * (UV)2 + (UV)1)
-    #endif
-  The compiler handles {double floating point value} >= MY_UV_MAX as if
-  MY_UV_MAX were the signed integer -1.  In fact it will do the same
-  thing with (UV)(0xffffffff), in place of MY_UV_MAX, though 0xffffffff
-  *without* the typecast to UV works fine.
- (Hal Morris) 2001-05-02
-  */
-#ifdef UTS
-#  define MY_UV_MAX 0xffffffff 
+#if defined(uts) || defined(UTS)
+#	undef UV_MAX
+#	define UV_MAX (4294967295u)
 #define IV_DIG (BIT_DIGITS(IVSIZE * 8))

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About