aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard>2004-10-02 14:11:28 +0000
committerbellard <bellard>2004-10-02 14:11:28 +0000
commitdf36de6507e735faee3448687263a5c877d5f074 (patch)
tree69be3aeefa0883f030991f7d79a48c78b71dead0
parentc52df4de381bc79b0ec6803faacb42a6211f77c3 (diff)
downloadtinycc-df36de6507e735faee3448687263a5c877d5f074.tar.gz
tinycc-df36de6507e735faee3448687263a5c877d5f074.tar.bz2
fixes for dietlibc
-rw-r--r--stddef.h2
-rw-r--r--tcc.c8
2 files changed, 7 insertions, 3 deletions
diff --git a/stddef.h b/stddef.h
index 24d7444..89bd7b0 100644
--- a/stddef.h
+++ b/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
presence of 'long long' without __GNUC__, or TCC should define
__GNUC__ ? */
-#ifndef __int8_t_defined
+#if !defined(__int8_t_defined) && !defined(__dietlibc__)
#define __int8_t_defined
typedef char int8_t;
typedef short int int16_t;
diff --git a/tcc.c b/tcc.c
index 655a058..6330206 100644
--- a/tcc.c
+++ b/tcc.c
@@ -9076,15 +9076,19 @@ static int rt_get_caller_pc(unsigned long *paddr,
int i;
if (level == 0) {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__)
*paddr = uc->uc_mcontext.mc_eip;
+#elif defined(__dietlibc__)
+ *paddr = uc->uc_mcontext.eip;
#else
*paddr = uc->uc_mcontext.gregs[REG_EIP];
#endif
return 0;
} else {
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__)
fp = uc->uc_mcontext.mc_ebp;
+#elif defined(__dietlibc__)
+ fp = uc->uc_mcontext.ebp;
#else
fp = uc->uc_mcontext.gregs[REG_EBP];
#endif