History

Merge branch 'mob' of git://repo.or.cz/tinycc into mypatch

Add Visual Studio processor identification

Christian Jullien committed 10 years ago

Commit 6db7a212 parents 30238b1 ff158bf5 files · +20 −20Browse files

Unified · Split

5 files
  1. libtcc.c +6 −6
  2. tcc.h +3 −3
  3. tccelf.c +2 −2
  4. tccpp.c +2 −2
  5. x86_64-gen.c +7 −7
libtcc.c+6−6
@@ -135,7 +135,7 @@ BOOL WINAPI DllMain (HINSTANCE hDll, DWORD dwReason, LPVOID lpReserved) · 134 unmodified lines
135135
136136 /********************************************************/
137137 /* copy a string and truncate it. */
138−PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s)
138+ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s)
139139 {
140140 char *q, *q_end;
141141 int c;
@@ -155,7 +155,7 @@ PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s) · 13 unmodified lines
155155 }
156156
157157 /* strcat and truncate. */
158−PUB_FUNC char *pstrcat(char *buf, int buf_size, const char *s)
158+ST_FUNC char *pstrcat(char *buf, int buf_size, const char *s)
159159 {
160160 int len;
161161 len = strlen(buf);
@@ -164,7 +164,7 @@ PUB_FUNC char *pstrcat(char *buf, int buf_size, const char *s) · 2 unmodified lines
164164 return buf;
165165 }
166166
167−PUB_FUNC char *pstrncpy(char *out, const char *in, size_t num)
167+ST_FUNC char *pstrncpy(char *out, const char *in, size_t num)
168168 {
169169 memcpy(out, in, num);
170170 out[num] = '\0';
@@ -1544,7 +1544,7 @@ typedef struct stat file_info_t; · 1373 unmodified lines
15441544 typedef BY_HANDLE_FILE_INFORMATION file_info_t;
15451545 #endif
15461546
1547−int get_file_info(const char *fname, file_info_t *out_info)
1547+static int get_file_info(const char *fname, file_info_t *out_info)
15481548 {
15491549 #ifndef _WIN32
15501550 return stat(fname, out_info);
@@ -1561,7 +1561,7 @@ int get_file_info(const char *fname, file_info_t *out_info) · 10 unmodified lines
15611561 #endif
15621562 }
15631563
1564−int is_dir(file_info_t *info)
1564+static int is_dir(file_info_t *info)
15651565 {
15661566 #ifndef _WIN32
15671567 return S_ISDIR(info->st_mode);
@@ -1571,7 +1571,7 @@ int is_dir(file_info_t *info) · 3 unmodified lines
15711571 #endif
15721572 }
15731573
1574−int is_same_file(const file_info_t *fi1, const file_info_t *fi2)
1574+static int is_same_file(const file_info_t *fi1, const file_info_t *fi2)
15751575 {
15761576 #ifndef _WIN32
15771577 return fi1->st_dev == fi2->st_dev &&
tcc.h+3−3
@@ -1167,9 +1167,9 @@ ST_DATA struct TCCState *tcc_state; · 1166 unmodified lines
11671167 #define AFF_PREPROCESS 0x0004 /* preprocess file */
11681168
11691169 /* public functions currently used by the tcc main function */
1170−PUB_FUNC char *pstrcpy(char *buf, int buf_size, const char *s);
1171−PUB_FUNC char *pstrcat(char *buf, int buf_size, const char *s);
1172−PUB_FUNC char *pstrncpy(char *out, const char *in, size_t num);
1170+ST_FUNC char *pstrcpy(char *buf, int buf_size, const char *s);
1171+ST_FUNC char *pstrcat(char *buf, int buf_size, const char *s);
1172+ST_FUNC char *pstrncpy(char *out, const char *in, size_t num);
11731173 PUB_FUNC char *tcc_basename(const char *name);
11741174 PUB_FUNC char *tcc_fileextension (const char *name);
11751175
tccelf.c+2−2
@@ -1729,7 +1729,7 @@ static void tcc_output_binary(TCCState *s1, FILE *f, · 1728 unmodified lines
17291729 #define EXTRA_RELITEMS 14
17301730
17311731 /* move the relocation value from .dynsym to .got */
1732−void patch_dynsym_undef(TCCState *s1, Section *s)
1732+static void patch_dynsym_undef(TCCState *s1, Section *s)
17331733 {
17341734 uint32_t *gotd = (void *)s1->got->data;
17351735 ElfW(Sym) *sym;
@@ -1748,7 +1748,7 @@ void patch_dynsym_undef(TCCState *s1, Section *s) · 12 unmodified lines
17481748 #define EXTRA_RELITEMS 9
17491749
17501750 /* zero plt offsets of weak symbols in .dynsym */
1751−void patch_dynsym_undef(TCCState *s1, Section *s)
1751+static void patch_dynsym_undef(TCCState *s1, Section *s)
17521752 {
17531753 ElfW(Sym) *sym;
17541754
tccpp.c+2−2
@@ -2048,7 +2048,7 @@ static void parse_escape_string(CString *outstr, const uint8_t *buf, int is_long · 2047 unmodified lines
20482048 cstr_wccat(outstr, '\0');
20492049 }
20502050
2051−void parse_string(const char *s, int len)
2051+static void parse_string(const char *s, int len)
20522052 {
20532053 uint8_t buf[1000], *p = buf;
20542054 int is_long, sep;
@@ -3208,7 +3208,7 @@ static int macro_subst_tok( · 1153 unmodified lines
32083208 return 0;
32093209 }
32103210
3211−int paste_tokens(int t1, CValue *v1, int t2, CValue *v2)
3211+static int paste_tokens(int t1, CValue *v1, int t2, CValue *v2)
32123212 {
32133213 CString cstr;
32143214 int n;
x86_64-gen.c+7−7
@@ -156,7 +156,7 @@ static unsigned long func_sub_sp_offset; · 155 unmodified lines
156156 static int func_ret_sub;
157157
158158 /* XXX: make it faster ? */
159−void g(int c)
159+ST_FUNC void g(int c)
160160 {
161161 int ind1;
162162 ind1 = ind + 1;
@@ -166,7 +166,7 @@ void g(int c) · 3 unmodified lines
166166 ind = ind1;
167167 }
168168
169−void o(unsigned int c)
169+ST_FUNC void o(unsigned int c)
170170 {
171171 while (c) {
172172 g(c);
@@ -174,13 +174,13 @@ void o(unsigned int c) · 1 unmodified line
174174 }
175175 }
176176
177−void gen_le16(int v)
177+ST_FUNC void gen_le16(int v)
178178 {
179179 g(v);
180180 g(v >> 8);
181181 }
182182
183−void gen_le32(int c)
183+ST_FUNC void gen_le32(int c)
184184 {
185185 g(c);
186186 g(c >> 8);
@@ -188,7 +188,7 @@ void gen_le32(int c) · 1 unmodified line
188188 g(c >> 24);
189189 }
190190
191−void gen_le64(int64_t c)
191+ST_FUNC void gen_le64(int64_t c)
192192 {
193193 g(c);
194194 g(c >> 8);
@@ -200,7 +200,7 @@ void gen_le64(int64_t c) · 5 unmodified lines
200200 g(c >> 56);
201201 }
202202
203−void orex(int ll, int r, int r2, int b)
203+static void orex(int ll, int r, int r2, int b)
204204 {
205205 if ((r & VT_VALMASK) >= VT_CONST)
206206 r = 0;
@@ -212,7 +212,7 @@ void orex(int ll, int r, int r2, int b) · 5 unmodified lines
212212 }
213213
214214 /* output a symbol and patch all calls to it */
215−void gsym_addr(int t, int a)
215+ST_FUNC void gsym_addr(int t, int a)
216216 {
217217 while (t) {
218218 unsigned char *ptr = cur_text_section->data + t;

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