cvsuser     04/10/20 01:03:33

  Modified:    src      string.c
  Log:
  [perl #31919] [PATCH] Win32 perlnum test failure - test 36 (+- zero)
  
  Visual C++ compiles '-0.0' to 0.0, which leads to the error.  Attached
  patch will fix this.
  
  Courtesy of Ron Blaschke <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.228     +7 -1      parrot/src/string.c
  
  Index: string.c
  ===================================================================
  RCS file: /cvs/public/parrot/src/string.c,v
  retrieving revision 1.227
  retrieving revision 1.228
  diff -u -w -r1.227 -r1.228
  --- string.c  18 Oct 2004 01:35:33 -0000      1.227
  +++ string.c  20 Oct 2004 08:03:33 -0000      1.228
  @@ -1,6 +1,6 @@
   /*
   Copyright: 2001-2003 The Perl Foundation.  All Rights Reserved.
  -$Id: string.c,v 1.227 2004/10/18 01:35:33 brentdax Exp $
  +$Id: string.c,v 1.228 2004/10/20 08:03:33 leo Exp $
   
   =head1 NAME
   
  @@ -2588,7 +2588,13 @@
           f = atof(p);
           /* Not all atof()s return -0 from "-0" */
           if (*p == '-' && f == 0.0)
  +#if defined(_MSC_VER)
  +            /* Visual C++ compiles -0.0 to 0.0, so we need to trick
  +               the compiler. */
  +            f = 0.0 * -1;
  +#else
               f = -0.0;
  +#endif
           string_cstring_free(cstr);
           return f;
       }
  
  
  

Reply via email to