]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
vasnprintf: Tiny optimization.
authorBruno Haible <bruno@clisp.org>
Sat, 12 Dec 2009 15:07:06 +0000 (16:07 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 12 Dec 2009 15:08:01 +0000 (16:08 +0100)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/vasnprintf.c
gettext-runtime/libasprintf/ChangeLog
gettext-runtime/libasprintf/vasnprintf.c

index 01c65c3923b7eec65f9a9f99e40d705884a76c0c..fe63bf88c3685253b838100344115b05935b0940 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-22  Bruno Haible  <bruno@clisp.org>
+
+       * vasnprintf.c (decimal_point_char): Choose the fast path also on
+       MacOS X.
+
 2009-11-17  Eric Blake  <ebb9@byu.net>
 
        * vasnprintf.c (VASNPRINTF): Avoid shadowing our own local variables.
index 791376b2164e3e4ae07de8a49707e79ace5a9a7c..d64cec2c53ef1ab8927f033623a059b07b0720fe 100644 (file)
@@ -262,10 +262,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];
index 458c2c5cf2f90b1f0d43d6d3d9af27736d28cccf..c81433fcd291c008f495aecfe847fb083aec0e19 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-22  Bruno Haible  <bruno@clisp.org>
+
+       * vasnprintf.c (decimal_point_char): Choose the fast path also on
+       MacOS X.
+
 2009-11-17  Eric Blake  <ebb9@byu.net>
 
        * vasnprintf.c (VASNPRINTF): Avoid shadowing our own local variables.
index 791376b2164e3e4ae07de8a49707e79ace5a9a7c..d64cec2c53ef1ab8927f033623a059b07b0720fe 100644 (file)
@@ -262,10 +262,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];