From: Bruno Haible Date: Fri, 29 Aug 2003 20:21:32 +0000 (+0000) Subject: Portability tweak for NetBSD. X-Git-Tag: v0.13~288 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7bb2ab04f31f974ee4f5a86c93a44d07e0576144;p=thirdparty%2Fgettext.git Portability tweak for NetBSD. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 3a8f43e65..4bc99ac38 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,9 @@ +2003-08-29 Bruno Haible + + * 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 * Makefile.in (install-exec): Fix the 2003-04-06 patch. diff --git a/gettext-runtime/intl/printf.c b/gettext-runtime/intl/printf.c index 08846a852..b0593bbaa 100644 --- a/gettext-runtime/intl/printf.c +++ b/gettext-runtime/intl/printf.c @@ -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 diff --git a/gettext-runtime/intl/vasnprintf.c b/gettext-runtime/intl/vasnprintf.c index 28938549f..7a46ca99a 100644 --- a/gettext-runtime/intl/vasnprintf.c +++ b/gettext-runtime/intl/vasnprintf.c @@ -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 diff --git a/gettext-runtime/m4/ChangeLog b/gettext-runtime/m4/ChangeLog index 239a383b3..6f9ccf1a8 100644 --- a/gettext-runtime/m4/ChangeLog +++ b/gettext-runtime/m4/ChangeLog @@ -1,3 +1,8 @@ +2003-08-29 Bruno Haible + + * gettext.m4 (AM_INTL_SUBDIR): Test whether _snprintf and _snwprintf + are declared, not only existent as functions. + 2003-08-24 Bruno Haible * gettext.m4 (AM_INTL_SUBDIR): Also check for _snprintf, _snwprintf. diff --git a/gettext-runtime/m4/gettext.m4 b/gettext-runtime/m4/gettext.m4 index e62c515f0..ab9d10fba 100644 --- a/gettext-runtime/m4/gettext.m4 +++ b/gettext-runtime/m4/gettext.m4 @@ -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 ]) + gt_CHECK_DECL(_snwprintf, [#include ]) dnl Use the *_unlocked functions only if they are declared. dnl (because some of them were defined without being declared in Solaris