From b0790fa0d13f875fdd63cbcdcd4f80c259a6867f Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Fri, 2 May 1997 10:32:09 +0000 Subject: [PATCH] prototypes for asprintf, vasprintf git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1631 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/roken/roken.h | 24 ++++++++++++++++++++++++ lib/roken/roken.h.in | 24 ++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/lib/roken/roken.h b/lib/roken/roken.h index 086d3b6a2..703161099 100644 --- a/lib/roken/roken.h +++ b/lib/roken/roken.h @@ -91,6 +91,30 @@ void unsetenv(const char *name); char *getusershell(void); #endif +#if !defined(__GNUC__) && !defined(__attribute__) +#define __attribute__(x) +#endif + +#ifndef HAVE_SNPRINTF +int snprintf (char *str, size_t sz, const char *format, ...) + __attribute__ ((format (printf, 3, 4))); +#endif + +#ifndef HAVE_VSNPRINTF +int vsnprintf (char *str, size_t sz, const char *format, va_list ap) + __attribute__((format (printf, 3, 0))); +#endif + +#ifndef HAVE_ASPRINTF +int asprintf (char **ret, const char *format, ...) + __attribute__ ((format (printf, 2, 3))); +#endif + +#ifndef HAVE_VSNPRINTF +int vasprintf (char **ret, const char *format, va_list ap) + __attribute__((format (printf, 2, 0))); +#endif + #ifndef HAVE_STRDUP char * strdup(const char *old); #endif diff --git a/lib/roken/roken.h.in b/lib/roken/roken.h.in index 086d3b6a2..703161099 100644 --- a/lib/roken/roken.h.in +++ b/lib/roken/roken.h.in @@ -91,6 +91,30 @@ void unsetenv(const char *name); char *getusershell(void); #endif +#if !defined(__GNUC__) && !defined(__attribute__) +#define __attribute__(x) +#endif + +#ifndef HAVE_SNPRINTF +int snprintf (char *str, size_t sz, const char *format, ...) + __attribute__ ((format (printf, 3, 4))); +#endif + +#ifndef HAVE_VSNPRINTF +int vsnprintf (char *str, size_t sz, const char *format, va_list ap) + __attribute__((format (printf, 3, 0))); +#endif + +#ifndef HAVE_ASPRINTF +int asprintf (char **ret, const char *format, ...) + __attribute__ ((format (printf, 2, 3))); +#endif + +#ifndef HAVE_VSNPRINTF +int vasprintf (char **ret, const char *format, va_list ap) + __attribute__((format (printf, 2, 0))); +#endif + #ifndef HAVE_STRDUP char * strdup(const char *old); #endif