vasnprintf: Tiny optimization.
authorBruno Haible <bruno@clisp.org>
Mon, 23 Nov 2009 01:43:23 +0000 (02:43 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 23 Nov 2009 01:43:23 +0000 (02:43 +0100)
ChangeLog
lib/vasnprintf.c

index ff3d5e52612f518760c295f8db3d5374ac5935be..3bb6922c472db24bf3aa5f91b63b1e218ac44210 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-22  Bruno Haible  <bruno@clisp.org>
+
+       vasnprintf: Tiny optimization.
+       * lib/vasnprintf.c (decimal_point_char): Choose the fast path also on
+       MacOS X.
+
 2009-11-22  Bruno Haible  <bruno@clisp.org>
 
        Tests for module 'duplocale'.
index ab662888b0fefa9f7fa23cf815f134064f83b1ae..faffd9ee9c0053959342608e574475fe801f5be9 100644 (file)
@@ -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];