Adjust va_list to work with musl

This commit is contained in:
Steffen Nurpmeso 2017-09-30 00:11:59 +02:00
parent 2e5751caf1
commit a1c9051313
2 changed files with 7 additions and 2 deletions

View File

@ -17,8 +17,9 @@ typedef struct {
} __va_list_struct;
/* Avoid conflicting definition for va_list on musl libc */
#ifndef __DEFINED_va_list
#if !defined __DEFINED_va_list || defined __TCC_NEEDS_va_list
typedef __va_list_struct va_list[1];
#undef __DEFINED_va_list
#define __DEFINED_va_list
#endif

View File

@ -854,7 +854,11 @@ LIBTCCAPI TCCState *tcc_new(void)
#endif
#if defined(TCC_MUSL)
tcc_define_symbol(s, "__builtin_va_list", "void *");
tcc_define_symbol(s, "__TCC_NEEDS_va_list", "");
tcc_define_symbol(s, "__builtin_va_list", "va_list");
tcc_define_symbol(s, "__DEFINED_va_list", "");
tcc_define_symbol(s, "__DEFINED___isoc_va_list", "");
tcc_define_symbol(s, "__isoc_va_list", "void *");
#endif /* TCC_MUSL */
#ifdef TCC_TARGET_PE