History

TOK_builtin_malloc: alternative solution

grischka committed 17 years ago

Commit 9a8b2911 parent 742cf052 files · +8 −14Browse files

Unified · Split

2 files
  1. tcc.c +4 −14
  2. tcctok.h +4 −0
tcc.c+4−14
@@ -7801,21 +7801,11 @@ static void unary(void) · 7800 unmodified lines
7801 break;7801 break;
7802#ifdef TCC_TARGET_X86_647802#ifdef TCC_TARGET_X86_64
7803 case TOK_builtin_malloc:7803 case TOK_builtin_malloc:
7804 {7804 tok = TOK_malloc;
7805 char *p = file->buf_ptr;7805 goto tok_identifier;
7806 file->buf_ptr = "malloc";
7807 next_nomacro1();
7808 file->buf_ptr = p;
7809 goto tok_identifier;
7810 }
7811 case TOK_builtin_free:7806 case TOK_builtin_free:
7812 {7807 tok = TOK_free;
7813 char *p = file->buf_ptr;7808 goto tok_identifier;
7814 file->buf_ptr = "free";
7815 next_nomacro1();
7816 file->buf_ptr = p;
7817 goto tok_identifier;
7818 }
7819#endif7809#endif
7820 case TOK_INC:7810 case TOK_INC:
7821 case TOK_DEC:7811 case TOK_DEC:
tcctok.h+4−0
@@ -113,6 +113,8 @@ · 112 unmodified lines
113#ifdef TCC_TARGET_X86_64113#ifdef TCC_TARGET_X86_64
114 DEF(TOK_builtin_malloc, "__builtin_malloc")114 DEF(TOK_builtin_malloc, "__builtin_malloc")
115 DEF(TOK_builtin_free, "__builtin_free")115 DEF(TOK_builtin_free, "__builtin_free")
116 DEF(TOK_malloc, "malloc")
117 DEF(TOK_free, "free")
116#endif118#endif
117 DEF(TOK_REGPARM1, "regparm")119 DEF(TOK_REGPARM1, "regparm")
118 DEF(TOK_REGPARM2, "__regparm__")120 DEF(TOK_REGPARM2, "__regparm__")
@@ -216,11 +218,13 @@ · 97 unmodified lines
216 DEF(TOK___bound_ptr_indir16, "__bound_ptr_indir16")218 DEF(TOK___bound_ptr_indir16, "__bound_ptr_indir16")
217 DEF(TOK___bound_local_new, "__bound_local_new")219 DEF(TOK___bound_local_new, "__bound_local_new")
218 DEF(TOK___bound_local_delete, "__bound_local_delete")220 DEF(TOK___bound_local_delete, "__bound_local_delete")
221#if 0
219 DEF(TOK_malloc, "malloc")222 DEF(TOK_malloc, "malloc")
220 DEF(TOK_free, "free")223 DEF(TOK_free, "free")
221 DEF(TOK_realloc, "realloc")224 DEF(TOK_realloc, "realloc")
222 DEF(TOK_memalign, "memalign")225 DEF(TOK_memalign, "memalign")
223 DEF(TOK_calloc, "calloc")226 DEF(TOK_calloc, "calloc")
227#endif
224 DEF(TOK_memmove, "memmove")228 DEF(TOK_memmove, "memmove")
225 DEF(TOK_strlen, "strlen")229 DEF(TOK_strlen, "strlen")
226 DEF(TOK_strcpy, "strcpy")230 DEF(TOK_strcpy, "strcpy")

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