From: Jarkko Hietaniemi Date: Sun, 24 Aug 2003 08:24:46 +0000 (+0000) Subject: An imperfect last resort in case there is no strtoul() but X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a5523c5b64e93879bbacdeec5a11f3570e31e160;p=p5sagit%2Fp5-mst-13.2.git An imperfect last resort in case there is no strtoul() but there is strtol() (like e.g. SunOS 4) because of the Atoul() in Perl_get_hash_seed()). The only true fix would be to implement Perl_my_strtoul() (and Perl_my_strtol(), I guess) in numeric.c. p4raw-id: //depot/perl@20865 --- diff --git a/perl.h b/perl.h index 7586609..cd735af 100644 --- a/perl.h +++ b/perl.h @@ -3929,6 +3929,9 @@ typedef struct am_table_short AMTS; #if !defined(Strtoul) && defined(HAS_STRTOUL) # define Strtoul strtoul #endif +#if !defined(Strtoul) && defined(HAS_STRTOL) /* Last resort. */ +# define Strtoul(s, e, b) strchr((s), '-') ? ULONG_MAX : (unsigned long)strtol((s), (e), (b)) +#endif #ifndef Atoul # define Atoul(s) Strtoul(s, (char **)NULL, 10) #endif