From: Paul Eggert Date: Fri, 30 Apr 2010 22:23:38 +0000 (+0100) Subject: sort: use long doubles only when effective X-Git-Tag: v8.6~190 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d861519d2a3214df2b4cd2ee6d59e8772371f780;p=platform%2Fupstream%2Fcoreutils.git sort: use long doubles only when effective * src/sort.c (general_numcompare): Don't use long double if strtold is not available, as it may introduce needless overhead. --- diff --git a/src/sort.c b/src/sort.c index a815244..54b97e2 100644 --- a/src/sort.c +++ b/src/sort.c @@ -1856,15 +1856,17 @@ general_numcompare (const char *sa, const char *sb) only if A and B can't be compared more cheaply/accurately. */ #if HAVE_C99_STRTOLD /* provided by c-strtold module. */ -# define STRTOD strtold +# define long_double long double #else -# define STRTOD strtod +# define long_double double +# undef strtold +# define strtold strtod #endif char *ea; char *eb; - long double a = STRTOD (sa, &ea); - long double b = STRTOD (sb, &eb); + long_double a = strtold (sa, &ea); + long_double b = strtold (sb, &eb); /* Put conversion errors at the start of the collating sequence. */ if (sa == ea)