AS_IF([test "$hw_cv_func_vsnprintf_c99" = yes],
[AC_DEFINE([HAVE_VSNPRINTF], [1],
[Define to 1 if you have a C99 compliant `vsnprintf' function.])],
- [AC_DEFINE([vsnprintf], [rpl_vsnprintf],
- [Define to rpl_vsnprintf if the replacement function should be used.])
- AC_CHECK_HEADERS([inttypes.h locale.h stddef.h stdint.h])
+ [AC_CHECK_HEADERS([inttypes.h locale.h stddef.h stdint.h])
AC_CHECK_MEMBERS([struct lconv.decimal_point, struct lconv.thousands_sep],
[], [], [#include <locale.h>])
AC_TYPE_LONG_DOUBLE
AS_IF([test "$hw_cv_func_snprintf_c99" = yes],
[AC_DEFINE([HAVE_SNPRINTF], [1],
[Define to 1 if you have a C99 compliant `snprintf' function.])],
- [AC_DEFINE([snprintf], [rpl_snprintf],
- [Define to rpl_snprintf if the replacement function should be used.])
- _HW_FUNC_XPRINTF_REPLACE])
+ [_HW_FUNC_XPRINTF_REPLACE])
])# HW_FUNC_SNPRINTF
# HW_FUNC_VASPRINTF
[hw_cv_func_vasprintf=yes],
[hw_cv_func_vasprintf=no])
AS_IF([test "$hw_cv_func_vasprintf" = no],
- [AC_DEFINE([vasprintf], [rpl_vasprintf],
- [Define to rpl_vasprintf if the replacement function should be used.])
- AC_CHECK_HEADERS([stdlib.h])
+ [AC_CHECK_HEADERS([stdlib.h])
HW_FUNC_VA_COPY
AS_IF([test "$hw_cv_func_va_copy" = no],
[HW_FUNC___VA_COPY])
[hw_cv_func_asprintf=yes],
[hw_cv_func_asprintf=no])
AS_IF([test "$hw_cv_func_asprintf" = no],
- [AC_DEFINE([asprintf], [rpl_asprintf],
- [Define to rpl_asprintf if the replacement function should be used.])
- _HW_FUNC_XPRINTF_REPLACE])
+ [_HW_FUNC_XPRINTF_REPLACE])
])# HW_FUNC_ASPRINTF
# _HW_FUNC_XPRINTF_REPLACE
extern int errno;
+#if !HAVE_VSNPRINTF
+ int rpl_vsnprintf(char *, size_t, const char *, va_list);
+ #define vsnprintf rpl_vsnprintf
+#endif
+#if !HAVE_SNPRINTF
+ int rpl_snprintf(char *, size_t, const char *, ...);
+ #define snprintf rpl_snprintf
+#endif
+#if !HAVE_VASPRINTF
+ int rpl_vasprintf(char **, const char *, va_list);
+ #define vasprintf rpl_vasprintf
+#endif
+#if !HAVE_ASPRINTF
+ int rpl_asprintf(char **, const char *, ...);
+ #define asprintf rpl_asprintf
+#endif
+
int
rpl_vsnprintf(char *str, size_t size, const char *format, va_list args)
{
#if !HAVE_VSNPRINTF
int rpl_vsnprintf(char *, size_t, const char *, va_list);
+ #define vsnprintf rpl_vsnprintf
#endif
#if !HAVE_SNPRINTF
int rpl_snprintf(char *, size_t, const char *, ...);
+ #define snprintf rpl_snprintf
#endif
#if !HAVE_VASPRINTF
int rpl_vasprintf(char **, const char *, va_list);
+ #define vasprintf rpl_vasprintf
#endif
#if !HAVE_ASPRINTF
int rpl_asprintf(char **, const char *, ...);
+ #define asprintf rpl_asprintf
#endif
#ifdef HAVE_STDBOOL_H