~ chicken-core (chicken-5) 50a505dc5009ef5656c46f1a15c474f3d79feec0
commit 50a505dc5009ef5656c46f1a15c474f3d79feec0 Author: Kooda <kooda@upyum.com> AuthorDate: Fri Feb 14 15:51:03 2020 +0100 Commit: Kooda <kooda@upyum.com> CommitDate: Tue Mar 24 13:43:11 2020 +0100 Make CHICKEN build with TCC diff --git a/chicken.h b/chicken.h index 376b0a26..e76e3188 100644 --- a/chicken.h +++ b/chicken.h @@ -1009,12 +1009,16 @@ typedef void (C_ccall *C_proc)(C_word, C_word *) C_noret; #define C_heaptop ((C_word **)(&C_fromspace_top)) #define C_drop(n) (C_temporary_stack += (n)) #define C_alloc(n) ((C_word *)C_alloca((n) * sizeof(C_word))) -#if defined (__llvm__) && defined (__GNUC__) +#if (defined (__llvm__) && defined (__GNUC__)) || defined (__TINYC__) # if defined (__i386__) # define C_stack_pointer ({C_word *sp; __asm__ __volatile__("movl %%esp,%0":"=r"(sp):);sp;}) # elif defined (__x86_64__) # define C_stack_pointer ({C_word *sp; __asm__ __volatile__("movq %%rsp,%0":"=r"(sp):);sp;}) # else +/* Not alloca(0) because: + * - LLVM allocates anyways + * - TCC always returns NULL + */ # define C_stack_pointer ((C_word *)C_alloca(1)) # endif #elseTrap