asprintf.c 627 B

12345678910111213141516171819202122232425262728293031
  1. /* Copyright (C) 2004 Manuel Novoa III <mjn3@codepoet.org>
  2. *
  3. * GNU Library General Public License (LGPL) version 2 or later.
  4. *
  5. * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details.
  6. */
  7. #define vasprintf __vasprintf
  8. #include "_stdio.h"
  9. #include <stdarg.h>
  10. #ifndef __STDIO_HAS_VSNPRINTF
  11. #warning Skipping asprintf and __asprintf since no vsnprintf!
  12. #else
  13. int attribute_hidden __asprintf(char **__restrict buf, const char * __restrict format, ...)
  14. {
  15. va_list arg;
  16. int rv;
  17. va_start(arg, format);
  18. rv = vasprintf(buf, format, arg);
  19. va_end(arg);
  20. return rv;
  21. }
  22. strong_alias(__asprintf,asprintf)
  23. #endif