Commit acc5a383 acc5a383d5d9dc8f94eb88dd052b9996958d17b2 by Sam Roberts

One way to get rid of the annoying warnings about asprintf() not being

declared is to always call a mailutils wrapper function, which in turn
calls the real function. That means the wrappers (and other functions in
lib) will still compile with warnings, but the mailbox and utility code
can compile clean.
1 parent 8f380c03
......@@ -6,7 +6,7 @@ SUBDIRS = posix
INCLUDES = -I${top_srcdir}/include
libmailutils_la_SOURCES = basename.c daemon.c getopt.c getopt1.c md5.c \
mu_dbm.c getline.c xstrdup.c xmalloc.c argcv.c \
mu_argp.c pin.c
mu_argp.c pin.c mu_asprintf.c
EXTRA_DIST = alloca.c fnmatch.c fgetpwent.c getpass.c malloc.c obstack.c \
realloc.c setenv.c snprintf.c strchrnul.c strndup.c strnlen.c strncasecmp.c \
......@@ -16,7 +16,7 @@ EXTRA_DIST = alloca.c fnmatch.c fgetpwent.c getpass.c malloc.c obstack.c \
noinst_HEADERS = argcv.h error.h fnmatch.h getline.h getopt.h md5.h mu_dbm.h\
regex.h snprintf.h xalloc.h xstrtol.h obstack.h mu_argp.h \
argp-fmtstream.h argp-namefrob.h argp.h
argp-fmtstream.h argp-namefrob.h argp.h mu_asprintf.h
libmailutils_la_LIBADD = @LTLIBOBJS@ @LTALLOCA@
......
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "mu_asprintf.h"
int
mu_vasprintf (char **result, const char *format, va_list * args)
{
return vasprintf (result, format, args);
}
extern int
mu_asprintf (char **result, const char *format, ...)
{
va_list args;
int done;
va_start (args, format);
done = vasprintf (result, format, args);
va_end (args);
return done;
}
/*
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef MUASPRINTF_H
#define MUASPRINTF_H
#include <mailutils/mu_features.h>
#include <stdarg.h>
extern int mu_vasprintf __P ((char **result, const char *format, va_list * args));
extern int mu_asprintf __P ((char **result, const char *format, ...));
#endif
......@@ -2,7 +2,7 @@
AUTOMAKE_OPTIONS = ../lib/ansi2knr
INCLUDES = -I${top_srcdir}/include -I${top_srcdir}/mailbox/include
INCLUDES = -I${top_srcdir}/include -I${top_srcdir}/mailbox/include -I${top_srcdir}/lib
AM_CFLAGS = -DSITE_VIRTUAL_PWDDIR=\"@SITE_VIRTUAL_PWDDIR@\"
SUBDIRS = include
......