logo

live-bootstrap

Mirror of <https://github.com/fosslinux/live-bootstrap>

va_list.patch (1251B)


  1. SPDX-FileCopyrightText: 2019 Giovanni Mascellani <gio@debian.org>
  2. SPDX-License-Identifier: MIT
  3. From 1642f5982009e110615a29745f9cafd51a5c1597 Mon Sep 17 00:00:00 2001
  4. From: Giovanni Mascellani <gio@debian.org>
  5. Date: Tue, 11 Jun 2019 11:20:07 +0200
  6. Subject: [PATCH] stdarg.h: add support for tcc.
  7. ---
  8. arch/i386/bits/alltypes.h.in | 14 +++++++++++++-
  9. 1 file changed, 13 insertions(+), 1 deletion(-)
  10. diff --git a/arch/i386/bits/alltypes.h.in b/arch/i386/bits/alltypes.h.in
  11. index 1a8432d3..44cb5987 100644
  12. --- musl-1.1.24/arch/i386/bits/alltypes.h.in
  13. +++ musl-1.1.24/arch/i386/bits/alltypes.h.in
  14. @@ -2,7 +2,19 @@
  15. #define _Int64 long long
  16. #define _Reg int
  17. -#if __GNUC__ >= 3
  18. +#ifdef __TINYC__
  19. +typedef char *__builtin_va_list;
  20. +#define __builtin_va_start(ap,last) ap = ((char *)&(last)) + ((sizeof(last)+3)&~3)
  21. +#define __builtin_va_arg(ap,type) (ap += (sizeof(type)+3)&~3, *(type *)(ap - ((sizeof(type)+3)&~3)))
  22. +#define __builtin_va_copy(dest, src) (dest) = (src)
  23. +#define __builtin_va_end(ap)
  24. +#ifndef __TINYC_redefine_va_list
  25. +#define __TINYC_redefine_va_list
  26. +#undef __DEFINED_va_list
  27. +#endif
  28. +#endif
  29. +
  30. +#if __GNUC__ >= 3 || defined(__TINYC__)
  31. TYPEDEF __builtin_va_list va_list;
  32. TYPEDEF __builtin_va_list __isoc_va_list;
  33. #else
  34. --
  35. GitLab