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
74void __bound_new_region(void *p, unsigned long size);74void __bound_new_region(void *p, unsigned long size);
75int __bound_delete_region(void *p);75int __bound_delete_region(void *p);
76 76
77/* currently, tcc cannot compile that because we use unsupported GNU C77#define FASTCALL __attribute__((regparm(3)))
78 extensions */
79#if !defined(__TINYC__)
80void *__bound_ptr_add(void *p, int offset) __attribute__((regparm(2)));
81void *__bound_ptr_indir1(void *p, int offset) __attribute__((regparm(2)));
82void *__bound_ptr_indir2(void *p, int offset) __attribute__((regparm(2)));
83void *__bound_ptr_indir4(void *p, int offset) __attribute__((regparm(2)));
84void *__bound_ptr_indir8(void *p, int offset) __attribute__((regparm(2)));
85void *__bound_ptr_indir12(void *p, int offset) __attribute__((regparm(2)));
86void *__bound_ptr_indir16(void *p, int offset) __attribute__((regparm(2)));
87void __bound_local_new(void *p) __attribute__((regparm(1)));
88void __bound_local_delete(void *p) __attribute__((regparm(1)));
89#endif
90 78
91void *__bound_malloc(size_t size, const void *caller);79void *__bound_malloc(size_t size, const void *caller);
92void *__bound_memalign(size_t size, size_t align, const void *caller);80void *__bound_memalign(size_t size, size_t align, const void *caller);
@@ -168,7 +156,7 @@ static void bound_alloc_error(void) · 75 unmodified lines
168 156
169/* return '(p + offset)' for pointer arithmetic (a pointer can reach157/* return '(p + offset)' for pointer arithmetic (a pointer can reach
170 the end of a region in this case */158 the end of a region in this case */
171void *__bound_ptr_add(void *p, int offset)159void * FASTCALL __bound_ptr_add(void *p, int offset)
172{160{
173 unsigned long addr = (unsigned long)p;161 unsigned long addr = (unsigned long)p;
174 BoundEntry *e;162 BoundEntry *e;
@@ -194,7 +182,7 @@ void *__bound_ptr_add(void *p, int offset) · 19 unmodified lines
194/* return '(p + offset)' for pointer indirection (the resulting must182/* return '(p + offset)' for pointer indirection (the resulting must
195 be strictly inside the region */183 be strictly inside the region */
196#define BOUND_PTR_INDIR(dsize) \184#define BOUND_PTR_INDIR(dsize) \
197void *__bound_ptr_indir ## dsize (void *p, int offset) \185void * FASTCALL __bound_ptr_indir ## dsize (void *p, int offset) \
198{ \186{ \
199 unsigned long addr = (unsigned long)p; \187 unsigned long addr = (unsigned long)p; \
200 BoundEntry *e; \188 BoundEntry *e; \
@@ -227,7 +215,7 @@ void *__bound_ptr_indir ## dsize (void *p, int offset) \ · 26 unmodified lines
227#endif215#endif
228 216
229/* called when entering a function to add all the local regions */217/* called when entering a function to add all the local regions */
230void __bound_local_new(void *p1) 218void FASTCALL __bound_local_new(void *p1)
231{219{
232 unsigned long addr, size, fp, *p = p1;220 unsigned long addr, size, fp, *p = p1;
233 GET_CALLER_FP(fp);221 GET_CALLER_FP(fp);
@@ -243,7 +231,7 @@ void __bound_local_new(void *p1) · 9 unmodified lines
243}231}
244 232
245/* called when leaving a function to delete all the local regions */233/* called when leaving a function to delete all the local regions */
246void __bound_local_delete(void *p1) 234void FASTCALL __bound_local_delete(void *p1)
247{235{
248 unsigned long addr, fp, *p = p1;236 unsigned long addr, fp, *p = p1;
249 GET_CALLER_FP(fp);237 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