From de8ab91a76277f669d2225396135d25da653cd7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 5 Jul 2009 21:13:02 +0200 Subject: [PATCH] Work around the lack of a vsnprintf(3) declaration on AIX 5.3. * configure.in: Check for the vsnprintf(3) declaration. * libguile/deprecation.c [!HAVE_DECL_VSNPRINTF]: Provide vsnprintf(3) declaration. This is needed on `powerpc-ibm-aix5.3.0.0'. --- configure.in | 4 +++- libguile/deprecation.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 61754a490..217ac83e3 100644 --- a/configure.in +++ b/configure.in @@ -776,10 +776,12 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid fesetround ftime # only with `_XOPEN_SOURCE' or some such. # flock - on Tru64 5.1b the declaration is available from # but only if `_BSD' is defined. +# vsnprintf - on AIX 5.3, the declaration is only visible with +# `_XOPEN_SOURCE >= 500' or `_ISOC99_SOURCE'. # AC_CHECK_HEADERS(crypt.h netdb.h pthread.h sys/param.h sys/resource.h sys/file.h) AC_CHECK_FUNCS(chroot flock getlogin cuserid getpriority setpriority getpass sethostname gethostname) -AC_CHECK_DECLS([sethostname, strncasecmp, unsetenv, hstrerror, cuserid, flock]) +AC_CHECK_DECLS([sethostname, strncasecmp, unsetenv, hstrerror, cuserid, flock, vsnprintf]) # crypt() may or may not be available, for instance in some countries there # are restrictions on cryptography. diff --git a/libguile/deprecation.c b/libguile/deprecation.c index b45d6041a..d4bde6233 100644 --- a/libguile/deprecation.c +++ b/libguile/deprecation.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2001, 2006 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2006, 2009 Free Software Foundation, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -33,7 +33,9 @@ /* Windows defines. */ #ifdef __MINGW32__ -#define vsnprintf _vsnprintf +# define vsnprintf _vsnprintf +#elif !HAVE_DECL_VSNPRINTF +extern int vsnprintf (char *, size_t, const char *, va_list); #endif