Addendum: This is also needed, to avoid two functions in the same name (one in libc, the other one possibly in a user-defined shared library - the overriding would not work in this situation).
*** lib/vasnprintf.h 14 May 2005 06:03:58 -0000 1.4 --- lib/vasnprintf.h 4 Mar 2007 23:48:11 -0000 *************** *** 1,5 **** /* vsprintf with automatic memory allocation. ! Copyright (C) 2002-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by --- 1,5 ---- /* vsprintf with automatic memory allocation. ! Copyright (C) 2002-2004, 2007 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by *************** *** 65,70 **** --- 65,74 ---- free (output); } */ + #if REPLACE_VASNPRINTF + # define asnprintf rpl_asnprintf + # define vasnprintf rpl_vasnprintf + #endif extern char * asnprintf (char *resultbuf, size_t *lengthp, const char *format, ...) __attribute__ ((__format__ (__printf__, 3, 4))); extern char * vasnprintf (char *resultbuf, size_t *lengthp, const char *format, va_list args) *** m4/vasnprintf-posix.m4 4 Mar 2007 23:28:59 -0000 1.1 --- m4/vasnprintf-posix.m4 4 Mar 2007 23:48:11 -0000 *************** *** 19,24 **** --- 19,28 ---- && test $ac_cv_func_vasnprintf = yes; then : # vasnprintf exists and is already POSIX compliant. else + if test $ac_cv_func_vasnprintf = yes; then + AC_DEFINE([REPLACE_VASNPRINTF], 1, + [Define if vasnprintf exists but is overridden by gnulib.]) + fi if ! expr "$gl_cv_func_printf_directive_a" : ".*yes" > /dev/null; then AC_DEFINE([NEED_PRINTF_DIRECTIVE_A], 1, [Define if the vasnprintf implementation needs special code for