Work around broken snprintf function on BeOS.
authorBruno Haible <bruno@clisp.org>
Fri, 18 May 2007 17:45:52 +0000 (17:45 +0000)
committerBruno Haible <bruno@clisp.org>
Fri, 18 May 2007 17:45:52 +0000 (17:45 +0000)
ChangeLog
lib/vasnprintf.c

index 4d5569bc2e3dd9ce5d0d07f4f4e11e1c7b84b769..41e6cb24f367e509c580a011448a7f477b70234a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-05-18  Bruno Haible  <bruno@clisp.org>
+
+       * lib/vasnprintf.c (USE_SNPRINTF): Define to 0 on BeOS.
+
 2007-05-18  Bruno Haible  <bruno@clisp.org>
 
        * lib/vasnprintf.m4 (VASNPRINTF) [WIN32]: Use %I64d instead of %lld
index 2c4b42110cac5f0eabb084ee263124d63fd11c1e..a740ebf658c98315dce167eacbaf5c735191d03a 100644 (file)
@@ -111,7 +111,14 @@ local_wcslen (const wchar_t *s)
 # define DIRECTIVE char_directive
 # define DIRECTIVES char_directives
 # define PRINTF_PARSE printf_parse
-# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
+# /* Use snprintf if it exists under the name 'snprintf' or '_snprintf'.
+     But don't use it on BeOS, since BeOS snprintf produces no output if the
+     size argument is >= 0x3000000.  */
+# if (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF) && !defined __BEOS__
+#  define USE_SNPRINTF 1
+# else
+#  define USE_SNPRINTF 0
+# endif
 # if HAVE_DECL__SNPRINTF
    /* Windows.  */
 #  define SNPRINTF _snprintf