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
_______________________________________________
Tinycc-devel mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to