From 0581dde596c645aab197339a2468f4f16253315e Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 23 Nov 2009 02:43:23 +0100 Subject: [PATCH] vasnprintf: Tiny optimization. --- ChangeLog | 6 ++++++ lib/vasnprintf.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff3d5e5261..3bb6922c47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-22 Bruno Haible + + vasnprintf: Tiny optimization. + * lib/vasnprintf.c (decimal_point_char): Choose the fast path also on + MacOS X. + 2009-11-22 Bruno Haible Tests for module 'duplocale'. diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index ab662888b0..faffd9ee9c 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -261,10 +261,10 @@ decimal_point_char (void) { const char *point; /* Determine it in a multithread-safe way. We know nl_langinfo is - multithread-safe on glibc systems, but is not required to be multithread- - safe by POSIX. sprintf(), however, is multithread-safe. localeconv() - is rarely multithread-safe. */ -# if HAVE_NL_LANGINFO && __GLIBC__ + multithread-safe on glibc systems and MacOS X systems, but is not required + to be multithread-safe by POSIX. sprintf(), however, is multithread-safe. + localeconv() is rarely multithread-safe. */ +# if HAVE_NL_LANGINFO && (__GLIBC__ || (defined __APPLE__ && defined __MACH__)) point = nl_langinfo (RADIXCHAR); # elif 1 char pointbuf[5]; -- 2.30.2