in reply to Re^5: supporting quads on 32 bit Perl
in thread supporting quads on 32 bit Perl

Are you the author?

Replies are listed 'Best First'.
Re^7: supporting quads on 32 bit Perl
by salva (Canon) on Jun 01, 2012 at 14:44 UTC
    I have just uploaded version 0.19, let's see how it goes at the ActiveState build servers.
      0.19 failed on Activestates build system http://ppm4.activestate.com/MSWin32-x86/5.12/1200/S/SA/SALVA/Math-Int64-0.19.d/log-20120601T213822.txt. INT64_MAX is only in a Platform SDK header called intsafe.h. That was introduced somewhere between Studio 2005 and Studio 2008. My Studio 2003 doesn't have it, ActiveState doesn't have it.I added
      static char *right_b_error = "right-shift right operand is out +of bounds"; static char *right_error = "right shift overflows"; #ifndef INT64_MAX #define INT64_MAX _I64_MAX #endif #ifndef INT64_MIN #define INT64_MIN _I64_MIN #endif #ifndef UINT64_MAX #define UINT64_MAX _UI64_MAX #endif #ifndef UINT32_MAX #define UINT32_MAX _UI32_MAX #endif #include "strtoint64.h" #include "isaac64.h"
      and that fixed the limit constants problem. There are still more problems. After fixing the limit constants problem I got this
      Int64.c Int64.xs(254) : error C2059: syntax error : 'bad suffix on number' Int64.xs(254) : error C2146: syntax error : missing ')' before identif +ier 'p63' Int64.xs(254) : error C2144: syntax error : '<Unknown>' should be prec +eded by '< Unknown>' Int64.xs(254) : error C2144: syntax error : '<Unknown>' should be prec +eded by '< Unknown>' Int64.xs(254) : error C2143: syntax error : missing ')' before 'identi +fier' Int64.xs(254) : error C2059: syntax error : 'bad suffix on number' Int64.xs(255) : warning C4244: 'return' : conversion from 'NV' to 'int +64_t', pos sible loss of data Int64.xs(334) : error C2059: syntax error : 'bad suffix on number' Int64.xs(334) : error C2146: syntax error : missing ')' before identif +ier 'p64' Int64.xs(334) : error C2144: syntax error : '<Unknown>' should be prec +eded by '< Unknown>' Int64.xs(334) : error C2144: syntax error : '<Unknown>' should be prec +eded by '< Unknown>' Int64.xs(334) : error C2143: syntax error : missing ')' before 'identi +fier'
      VC is complaining about these strange constants.
      if (may_die_on_overflow && ((nv >= 0x1p63) || (nv < -0x1p63))) overflow(aTHX_ out +_of_bounds_error_s); return nv;
      This isn't C89. http://msdn.microsoft.com/en-us/library/w9bk1wcy%28v=vs.80%29.aspx http://msdn.microsoft.com/en-us/library/2k2xf226%28v=vs.80%29. So this will never compile on Visual C unless its fixed. I don't know how to fix that myself. So what is 0x1p63 as a normal C literal?

        I haven't seen that constant either. Google finds me a message for gcc which seems to claim that it's a C99 thing for declaring floating point constants in hexadecimal. I found some discussion by example, which suggests to me that 0x1p63 could be 1E63.

        I'm not sure why things get different between 32bit mode and 64bit mode here, but maybe your code never compiled under VC64bit either.

      Ill be watching. Thanks for trying to get it work on ActiveState's packager.