changeset 338:9ac95a76e8f3

[project @ 2004-11-07 15:43:33 by bellard] gcc 3.4 compile fix
author bellard
date Sun, 07 Nov 2004 15:43:33 +0000
parents ab2fa6ee2e59
children 04d8a922bf07
files bcheck.c
diffstat 1 files changed, 5 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/bcheck.c	Sun Nov 07 15:43:15 2004 +0000
+++ b/bcheck.c	Sun Nov 07 15:43:33 2004 +0000
@@ -74,19 +74,7 @@
 void __bound_new_region(void *p, unsigned long size);
 int __bound_delete_region(void *p);
 
-/* currently, tcc cannot compile that because we use unsupported GNU C
-   extensions */
-#if !defined(__TINYC__)
-void *__bound_ptr_add(void *p, int offset) __attribute__((regparm(2)));
-void *__bound_ptr_indir1(void *p, int offset) __attribute__((regparm(2)));
-void *__bound_ptr_indir2(void *p, int offset) __attribute__((regparm(2)));
-void *__bound_ptr_indir4(void *p, int offset) __attribute__((regparm(2)));
-void *__bound_ptr_indir8(void *p, int offset) __attribute__((regparm(2)));
-void *__bound_ptr_indir12(void *p, int offset) __attribute__((regparm(2)));
-void *__bound_ptr_indir16(void *p, int offset) __attribute__((regparm(2)));
-void __bound_local_new(void *p) __attribute__((regparm(1)));
-void __bound_local_delete(void *p) __attribute__((regparm(1)));
-#endif
+#define FASTCALL __attribute__((regparm(3)))
 
 void *__bound_malloc(size_t size, const void *caller);
 void *__bound_memalign(size_t size, size_t align, const void *caller);
@@ -168,7 +156,7 @@
 
 /* return '(p + offset)' for pointer arithmetic (a pointer can reach
    the end of a region in this case */
-void *__bound_ptr_add(void *p, int offset)
+void * FASTCALL __bound_ptr_add(void *p, int offset)
 {
     unsigned long addr = (unsigned long)p;
     BoundEntry *e;
@@ -194,7 +182,7 @@
 /* return '(p + offset)' for pointer indirection (the resulting must
    be strictly inside the region */
 #define BOUND_PTR_INDIR(dsize)                                          \
-void *__bound_ptr_indir ## dsize (void *p, int offset)                  \
+void * FASTCALL __bound_ptr_indir ## dsize (void *p, int offset)        \
 {                                                                       \
     unsigned long addr = (unsigned long)p;                              \
     BoundEntry *e;                                                      \
@@ -227,7 +215,7 @@
 #endif
 
 /* called when entering a function to add all the local regions */
-void __bound_local_new(void *p1) 
+void FASTCALL __bound_local_new(void *p1) 
 {
     unsigned long addr, size, fp, *p = p1;
     GET_CALLER_FP(fp);
@@ -243,7 +231,7 @@
 }
 
 /* called when leaving a function to delete all the local regions */
-void __bound_local_delete(void *p1) 
+void FASTCALL __bound_local_delete(void *p1) 
 {
     unsigned long addr, fp, *p = p1;
     GET_CALLER_FP(fp);