[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] tinycc on Mac
From: |
Daniel Glöckner |
Subject: |
Re: [Tinycc-devel] tinycc on Mac |
Date: |
Sat, 16 May 2009 10:54:53 +0200 |
User-agent: |
Mutt/1.4.2.1i |
On Sat, May 16, 2009 at 09:41:17AM +0200, Francesco Turci wrote:
> tcc.c: In function ?rt_get_caller_pc?:
> tcc.c:9865: error: request for member ?gregs? in something not a
> structure or union
Could you test the attached patch?
I don't have a Mac to test on.
I based the patch on this mail:
http://erlang.org/pipermail/erlang-questions/2006-August/022194.html
Daniel
diff --git a/libtcc.c b/libtcc.c
index bca1946..8f02a58 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1477,6 +1477,8 @@ static int rt_get_caller_pc(unsigned long *paddr,
*paddr = uc->uc_mcontext.mc_eip;
#elif defined(__dietlibc__)
*paddr = uc->uc_mcontext.eip;
+#elif defined (__DARWIN__)
+ *paddr = uc->uc_mcontext->ss.eip;
#else
*paddr = uc->uc_mcontext.gregs[REG_EIP];
#endif
@@ -1486,6 +1488,8 @@ static int rt_get_caller_pc(unsigned long *paddr,
fp = uc->uc_mcontext.mc_ebp;
#elif defined(__dietlibc__)
fp = uc->uc_mcontext.ebp;
+#elif defined (__DARWIN__)
+ fp = uc->uc_mcontext->ss.ebp;
#else
fp = uc->uc_mcontext.gregs[REG_EBP];
#endif