#ifndef __SNPRINTF_H #define __SNPRINTF_H #include "port/sys.h" /* impose some defaults, if we need snprintf and friends on the platform * given, we define the proper values in include/port/sys.h */ #ifndef HAVE_CONFIG_H #define HAVE_CONFIG_H 0 #endif #define TEST_SNPRINTF 0 #ifndef HAVE_STDARG_H #define HAVE_STDARG_H 1 #endif #ifndef HAVE_STDDEF_H #define HAVE_STDDEF_H 1 #endif #ifndef HAVE_SYS_TYPES_H #define HAVE_SYS_TYPES_H 1 #endif #ifndef HAVE_STDLIB_H #define HAVE_STDLIB_H 1 #endif #ifndef HAVE_VA_COPY #define HAVE_VA_COPY 1 #endif #if HAVE_STDARG_H #include /* for va_list */ #endif #if HAVE_SYS_TYPES_H #include /* for size_t */ #endif #if !defined HAVE_VSNPRINTF #define vsnprintf rpl_vsnprintf #if HAVE_STDARG_H extern int rpl_vsnprintf(char *str, size_t size, const char *format, va_list args); #else #error va_list required for vsnprintf! #endif /* HAVE_STDARG_H */ #endif /* !defined HAVE_VSNPRINTF */ #if !defined HAVE_SNPRINTF #define snprintf rpl_snprintf #if HAVE_STDARG_H extern int rpl_snprintf(char *str, size_t size, const char *format, ...); #else extern int rpl_snprintf(va_alist) va_dcl; #endif /* HAVE_STDARG_H */ #endif /* ! defined HAVE_SNPRINTF */ #if !defined HAVE_VASPRINTF #define vasprintf rpl_vasprintf extern int rpl_vasprintf(char **ret, const char *format, va_list ap); #endif /* ! defined HAVE_VASPRINTF */ #if !defined HAVE_ASPRINTF #define asprintf rpl_asprintf #if HAVE_STDARG_H extern int rpl_asprintf(char **ret, const char *format, ...); #else extern int rpl_asprintf(va_alist) va_dcl; #endif /* HAVE_STDARG_H */ #endif /* ! defined HAVE_ASPRINTF */ #endif /* ifndef __SNPRINTF_H */