mirror of
https://github.com/mirror/tinycc.git
synced 2025-04-01 12:30:08 +08:00
fixes for dietlibc
This commit is contained in:
parent
c52df4de38
commit
df36de6507
2
stddef.h
2
stddef.h
@ -10,7 +10,7 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
|
|||||||
/* need to do that because of glibc 2.1 bug (should have a way to test
|
/* need to do that because of glibc 2.1 bug (should have a way to test
|
||||||
presence of 'long long' without __GNUC__, or TCC should define
|
presence of 'long long' without __GNUC__, or TCC should define
|
||||||
__GNUC__ ? */
|
__GNUC__ ? */
|
||||||
#ifndef __int8_t_defined
|
#if !defined(__int8_t_defined) && !defined(__dietlibc__)
|
||||||
#define __int8_t_defined
|
#define __int8_t_defined
|
||||||
typedef char int8_t;
|
typedef char int8_t;
|
||||||
typedef short int int16_t;
|
typedef short int int16_t;
|
||||||
|
8
tcc.c
8
tcc.c
@ -9076,15 +9076,19 @@ static int rt_get_caller_pc(unsigned long *paddr,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (level == 0) {
|
if (level == 0) {
|
||||||
#ifdef __FreeBSD__
|
#if defined(__FreeBSD__)
|
||||||
*paddr = uc->uc_mcontext.mc_eip;
|
*paddr = uc->uc_mcontext.mc_eip;
|
||||||
|
#elif defined(__dietlibc__)
|
||||||
|
*paddr = uc->uc_mcontext.eip;
|
||||||
#else
|
#else
|
||||||
*paddr = uc->uc_mcontext.gregs[REG_EIP];
|
*paddr = uc->uc_mcontext.gregs[REG_EIP];
|
||||||
#endif
|
#endif
|
||||||
return 0;
|
return 0;
|
||||||
} else {
|
} else {
|
||||||
#ifdef __FreeBSD__
|
#if defined(__FreeBSD__)
|
||||||
fp = uc->uc_mcontext.mc_ebp;
|
fp = uc->uc_mcontext.mc_ebp;
|
||||||
|
#elif defined(__dietlibc__)
|
||||||
|
fp = uc->uc_mcontext.ebp;
|
||||||
#else
|
#else
|
||||||
fp = uc->uc_mcontext.gregs[REG_EBP];
|
fp = uc->uc_mcontext.gregs[REG_EBP];
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user