History

gcc 3.4 compile fix

bellard committed 22 years ago

Commit 398e22c1 parent 6bbfb8f1 file · +5 −17Browse files

Unified · Split

bcheck.c+5−17
@@ -74,19 +74,7 @@ void __bound_init(void); · 73 unmodified lines
7474 void __bound_new_region(void *p, unsigned long size);
7575 int __bound_delete_region(void *p);
7676
77−/* currently, tcc cannot compile that because we use unsupported GNU C
78− extensions */
79−#if !defined(__TINYC__)
80−void *__bound_ptr_add(void *p, int offset) __attribute__((regparm(2)));
81−void *__bound_ptr_indir1(void *p, int offset) __attribute__((regparm(2)));
82−void *__bound_ptr_indir2(void *p, int offset) __attribute__((regparm(2)));
83−void *__bound_ptr_indir4(void *p, int offset) __attribute__((regparm(2)));
84−void *__bound_ptr_indir8(void *p, int offset) __attribute__((regparm(2)));
85−void *__bound_ptr_indir12(void *p, int offset) __attribute__((regparm(2)));
86−void *__bound_ptr_indir16(void *p, int offset) __attribute__((regparm(2)));
87−void __bound_local_new(void *p) __attribute__((regparm(1)));
88−void __bound_local_delete(void *p) __attribute__((regparm(1)));
89−#endif
77+#define FASTCALL __attribute__((regparm(3)))
9078
9179 void *__bound_malloc(size_t size, const void *caller);
9280 void *__bound_memalign(size_t size, size_t align, const void *caller);
@@ -168,7 +156,7 @@ static void bound_alloc_error(void) · 75 unmodified lines
168156
169157 /* return '(p + offset)' for pointer arithmetic (a pointer can reach
170158 the end of a region in this case */
171−void *__bound_ptr_add(void *p, int offset)
159+void * FASTCALL __bound_ptr_add(void *p, int offset)
172160 {
173161 unsigned long addr = (unsigned long)p;
174162 BoundEntry *e;
@@ -194,7 +182,7 @@ void *__bound_ptr_add(void *p, int offset) · 19 unmodified lines
194182 /* return '(p + offset)' for pointer indirection (the resulting must
195183 be strictly inside the region */
196184 #define BOUND_PTR_INDIR(dsize) \
197−void *__bound_ptr_indir ## dsize (void *p, int offset) \
185+void * FASTCALL __bound_ptr_indir ## dsize (void *p, int offset) \
198186 { \
199187 unsigned long addr = (unsigned long)p; \
200188 BoundEntry *e; \
@@ -227,7 +215,7 @@ void *__bound_ptr_indir ## dsize (void *p, int offset) \ · 26 unmodified lines
227215 #endif
228216
229217 /* called when entering a function to add all the local regions */
230−void __bound_local_new(void *p1)
218+void FASTCALL __bound_local_new(void *p1)
231219 {
232220 unsigned long addr, size, fp, *p = p1;
233221 GET_CALLER_FP(fp);
@@ -243,7 +231,7 @@ void __bound_local_new(void *p1) · 9 unmodified lines
243231 }
244232
245233 /* called when leaving a function to delete all the local regions */
246−void __bound_local_delete(void *p1)
234+void FASTCALL __bound_local_delete(void *p1)
247235 {
248236 unsigned long addr, fp, *p = p1;
249237 GET_CALLER_FP(fp);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t