]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Portability tweak for NetBSD.
authorBruno Haible <bruno@clisp.org>
Fri, 29 Aug 2003 20:21:32 +0000 (20:21 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:10:56 +0000 (12:10 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/printf.c
gettext-runtime/intl/vasnprintf.c
gettext-runtime/m4/ChangeLog
gettext-runtime/m4/gettext.m4

index 3a8f43e653bfff155b464b4e89a85d1313b2ca45..4bc99ac38da480ebf60dc6ed337269235ce072d9 100644 (file)
@@ -1,3 +1,9 @@
+2003-08-29  Bruno Haible  <bruno@clisp.org>
+
+       * vasnprintf.c: Test HAVE_DECL__SNPRINTF instead of HAVE__SNPRINTF.
+       Test HAVE_DECL__SNWPRINTF instead of HAVE__SNWPRINTF.
+       * printf.c: Likewise.
+
 2003-08-27  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.in (install-exec): Fix the 2003-04-06 patch.
index 08846a8520899d53da7a2cb4dad0706de846a370..b0593bbaa8ae568290c3a163dda2695108e3ca40 100644 (file)
@@ -164,7 +164,7 @@ libintl_sprintf (char *resultbuf, const char *format, ...)
 
 #if HAVE_SNPRINTF
 
-# if HAVE__SNPRINTF
+# if HAVE_DECL__SNPRINTF
    /* Windows.  */
 #  define system_vsnprintf _vsnprintf
 # else
@@ -260,7 +260,7 @@ libintl_asprintf (char **resultp, const char *format, ...)
 #include "asnprintf.c"
 #endif
 
-# if HAVE__SNWPRINTF
+# if HAVE_DECL__SNWPRINTF
    /* Windows.  */
 #  define system_vswprintf _vsnwprintf
 # else
index 28938549f82d9d342cadc38799f385f906db4a16..7a46ca99aee16b48b4bd7c305d41e770ea785a57 100644 (file)
@@ -88,7 +88,7 @@ local_wcslen (const wchar_t *s)
 # define DIRECTIVES wchar_t_directives
 # define PRINTF_PARSE wprintf_parse
 # define USE_SNPRINTF 1
-# if HAVE__SNWPRINTF
+# if HAVE_DECL__SNWPRINTF
    /* On Windows, the function swprintf() has a different signature than
       on Unix; we use the _snwprintf() function instead.  */
 #  define SNPRINTF _snwprintf
@@ -102,8 +102,8 @@ local_wcslen (const wchar_t *s)
 # define DIRECTIVE char_directive
 # define DIRECTIVES char_directives
 # define PRINTF_PARSE printf_parse
-# define USE_SNPRINTF (HAVE__SNPRINTF || HAVE_SNPRINTF)
-# if HAVE__SNPRINTF
+# define USE_SNPRINTF (HAVE_DECL__SNPRINTF || HAVE_SNPRINTF)
+# if HAVE_DECL__SNPRINTF
    /* Windows.  */
 #  define SNPRINTF _snprintf
 # else
index 239a383b34f376d71c8f826134740e47665c8016..6f9ccf1a8f482e31f68503722b2188be60452cd9 100644 (file)
@@ -1,3 +1,8 @@
+2003-08-29  Bruno Haible  <bruno@clisp.org>
+
+       * gettext.m4 (AM_INTL_SUBDIR): Test whether _snprintf and _snwprintf
+       are declared, not only existent as functions.
+
 2003-08-24  Bruno Haible  <bruno@clisp.org>
 
        * gettext.m4 (AM_INTL_SUBDIR): Also check for _snprintf, _snwprintf.
index e62c515f0a83fa5eee1ed175f635e3f8cc471b1d..ab9d10fba7bf4f328c40c1d964337a68c76b1445 100644 (file)
@@ -1,4 +1,4 @@
-# gettext.m4 serial 24 (gettext-0.12.2)
+# gettext.m4 serial 25 (gettext-0.12.2)
 dnl Copyright (C) 1995-2003 Free Software Foundation, Inc.
 dnl This file is free software, distributed under the terms of the GNU
 dnl General Public License.  As a special exception to the GNU General
@@ -379,8 +379,13 @@ AC_DEFUN([AM_INTL_SUBDIR],
 stdlib.h string.h unistd.h sys/param.h])
   AC_CHECK_FUNCS([asprintf getcwd getegid geteuid getgid getuid mempcpy \
 munmap putenv setenv setlocale snprintf stpcpy strcasecmp strdup strtoul \
-tsearch wcslen wprintf _snprintf _snwprintf __argz_count __argz_stringify \
-__argz_next __fsetlocking])
+tsearch wcslen wprintf __argz_count __argz_stringify __argz_next \
+__fsetlocking])
+
+  dnl Use the _snprintf function only if it is declared (because on NetBSD it
+  dnl is defined as a weak alias of snprintf; we prefer to use the latter).
+  gt_CHECK_DECL(_snprintf, [#include <stdio.h>])
+  gt_CHECK_DECL(_snwprintf, [#include <stdio.h>])
 
   dnl Use the *_unlocked functions only if they are declared.
   dnl (because some of them were defined without being declared in Solaris