From ddcf783b5977764f654fb6e9f754265478acf2f6 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 28 May 2005 13:40:59 +0200 Subject: libiberty.h: (snprintf) [!HAVE_DECL_SNPRINTF]: Declare if needed. include: 2005-05-28 Eli Zaretskii * libiberty.h: (snprintf) [!HAVE_DECL_SNPRINTF]: Declare if needed. (vsnprintf) [!HAVE_DECL_VSNPRINTF]: Declare if needed. libiberty: 2005-05-28 Eli Zaretskii * configure.ac: Add snprintf and vsnprintf to AC_CHEK_DECLS. * config.in, configure: Regenerate. From-SVN: r100292 --- include/ChangeLog | 14 ++++++++++---- include/libiberty.h | 10 ++++++++++ 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/ChangeLog b/include/ChangeLog index e7eb8e016c9..0eb2b090d15 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,9 @@ +2005-05-28 Eli Zaretskii + + * libiberty.h: (snprintf) [!HAVE_DECL_SNPRINTF]: Declare if + needed. + (vsnprintf) [!HAVE_DECL_VSNPRINTF]: Declare if needed. + 2005-05-25 Richard Henderson * demangle.h (DEMANGLE_COMPONENT_HIDDEN_ALIAS): New. @@ -7,7 +13,7 @@ * libiberty.h (ACONCAT): Properly cast value of alloca(). * ansidecl.h (ATTRIBUTE_UNUSED_LABEL): Don't define if - __cplusplus. + __cplusplus. 2005-05-12 Steve Ellcey @@ -67,7 +73,7 @@ 2005-03-28 Mark Mitchell * libiberty.h (ffs): Declare, if necessary. - + 2005-03-27 Gabriel Dos Reis * xregex2.h (_RE_ARGS): Remove definition and uses. @@ -177,9 +183,9 @@ * hashtab.h (struct htab): Add size_prime_index. 2004-04-13 Jeff Law - + * hashtab.h (htab_remove_elt_with_hash): Prototype new function. - + 2004-03-30 Zack Weinberg * hashtab.h, splay-tree.h: Use new shorter form of GTY markers. diff --git a/include/libiberty.h b/include/libiberty.h index 9af981cd74e..75cbedc23dd 100644 --- a/include/libiberty.h +++ b/include/libiberty.h @@ -531,6 +531,16 @@ extern int vasprintf (char **, const char *, va_list) ATTRIBUTE_PRINTF(2,0); #endif +#if defined(HAVE_DECL_SNPRINTF) && !HAVE_DECL_SNPRINTF +/* Like sprintf but prints at most N characters. */ +extern int snprintf (char *, size_t, const char *, ...) ATTRIBUTE_PRINTF_3; +#endif + +#if defined(HAVE_DECL_VSNPRINTF) && !HAVE_DECL_VSNPRINTF +/* Like vsprintf but prints at most N characters. */ +extern int vsnprintf (char *, size_t, const char *, va_list); +#endif + #define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) /* Drastically simplified alloca configurator. If we're using GCC, -- cgit v1.2.1