From 5d8aea77b6e5d4dba66d65199bc4cf75c4d4db93 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Wed, 18 Feb 2009 18:18:21 +0000 Subject: [PATCH] pull up r21888 from trunk ------------------------------------------------------------------------ r21888 | raeburn | 2009-02-04 21:16:22 -0500 (Wed, 04 Feb 2009) | 11 lines Changed paths: M /trunk/src/include/k5-platform.h ticket: 6364 subject: declare replacement [v]asprintf functions target_version: 1.7 tags: pullup If HAVE_VASPRINTF is not defined, make sure krb5int_{,v}asprintf functions always get declared, applying the preprocessor conditional test only to the GCC format attribute. If HAVE_VASPRINTF is defined, don't declare them at all. This fixes a bunch of function-not-declared warnings under Sun cc. ------------------------------------------------------------------------ ticket: 6364 version_fixed: 1.7 status: resolved git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-7@22018 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/k5-platform.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/include/k5-platform.h b/src/include/k5-platform.h index 23ddf6967..1734e42c1 100644 --- a/src/include/k5-platform.h +++ b/src/include/k5-platform.h @@ -912,14 +912,18 @@ snprintf(char *str, size_t size, const char *format, ...) #endif /* win32? */ #endif /* no vsnprintf */ -#if !defined(__cplusplus) && (__GNUC__ > 2) +#ifndef HAVE_VASPRINTF + extern int krb5int_vasprintf(char **, const char *, va_list) - __attribute__((__format__(__printf__, 2, 0))); +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 2, 0))) +#endif + ; extern int krb5int_asprintf(char **, const char *, ...) - __attribute__((__format__(__printf__, 2, 3))); +#if !defined(__cplusplus) && (__GNUC__ > 2) + __attribute__((__format__(__printf__, 2, 3))) #endif - -#ifndef HAVE_VASPRINTF + ; #define vasprintf krb5int_vasprintf /* Assume HAVE_ASPRINTF iff HAVE_VASPRINTF. */ -- 2.26.2