bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

vasnprintf: tiny optim


From: Bruno Haible
Subject: vasnprintf: tiny optim
Date: Mon, 23 Nov 2009 02:43:29 +0100
User-agent: KMail/1.9.9

A tiny optimization: Use nl_langinfo also on MacOS X.


2009-11-22  Bruno Haible  <address@hidden>

        vasnprintf: Tiny optimization.
        * lib/vasnprintf.c (decimal_point_char): Choose the fast path also on
        MacOS X.

--- lib/vasnprintf.c.orig       2009-11-23 02:40:23.000000000 +0100
+++ lib/vasnprintf.c    2009-11-23 02:39:17.000000000 +0100
@@ -261,10 +261,10 @@
 {
   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];




reply via email to

[Prev in Thread] Current Thread [Next in Thread]