mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
cgen: improve generated source compatibility with latest Alpine (lacking libexecinfo-dev and execinfo.h) and the prebuilt tcc (#16743)
This commit is contained in:
@@ -318,6 +318,17 @@ const c_common_macros = '
|
||||
#define EMPTY_STRUCT_INITIALIZATION 0
|
||||
#endif
|
||||
|
||||
#ifndef _WIN32
|
||||
#if defined __has_include
|
||||
#if __has_include (<execinfo.h>)
|
||||
#include <execinfo.h>
|
||||
#else
|
||||
// On linux: int backtrace(void **__array, int __size);
|
||||
// On BSD: size_t backtrace(void **, size_t);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef __TINYC__
|
||||
#define _Atomic volatile
|
||||
#undef EMPTY_STRUCT_DECLARATION
|
||||
@@ -333,7 +344,6 @@ const c_common_macros = '
|
||||
#define TCCSKIP(x)
|
||||
// #include <byteswap.h>
|
||||
#ifndef _WIN32
|
||||
#include <execinfo.h>
|
||||
int tcc_backtrace(const char *fmt, ...);
|
||||
#endif
|
||||
#endif
|
||||
@@ -501,14 +511,6 @@ typedef int (*qsort_callback_func)(const void*, const void*);
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifndef _WIN32
|
||||
#if defined __has_include
|
||||
#if __has_include (<execinfo.h>)
|
||||
#include <execinfo.h>
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <stdarg.h> // for va_list
|
||||
|
||||
//================================== GLOBALS =================================*/
|
||||
|
||||
Reference in New Issue
Block a user