History

tcc: -m32 prefix "win32-" when file extension is present

Henry Kroll III committed 15 years ago

Commit 8f985731 parent c6f5d811 file · +14 −4Browse files

Unified · Split

tcc.c+14−4
@@ -228,10 +228,18 @@ static int expand_args(char ***pargv, const char *str) · 227 unmodified lines
228#define CHILD "x86_64"228#define CHILD "x86_64"
229#endif229#endif
230 230
231static const char *ssuffix(const char *name, const char sep)231static char *ssuffix(const char *oldname, const char sep)
232{232{
233 char *p = strchr(name, sep);233 char *p, *name = tcc_strdup(oldname);
234 return p?p+1:name;234 p = strchr(name, sep);
235 if (p)
236 return p + 1;
237 /* prefix "win32-" when file extension is present */
238 if (*tcc_fileextension(name)){
239 name = tcc_realloc(name, strlen(oldname + 7));
240 sprintf(name, "win32-%s", oldname);
241 }
242 return name;
235}243}
236 244
237static void exec_other_tcc(TCCState *s, int argc,245static void exec_other_tcc(TCCState *s, int argc,
@@ -249,7 +257,9 @@ static void exec_other_tcc(TCCState *s, int argc, · 11 unmodified lines
249 case ARG:257 case ARG:
250 {258 {
251 parent = tcc_basename(argv[0]);259 parent = tcc_basename(argv[0]);
252 sprintf(child_name, CHILD "-%s", ssuffix(parent,'-'));260 child_tcc = ssuffix(parent,'-');
261 sprintf(child_name, CHILD "-%s", child_tcc);
262 tcc_free(child_tcc);
253 if (strcmp(parent, child_name)) {263 if (strcmp(parent, child_name)) {
254 /* child_path = dirname */264 /* child_path = dirname */
255 pstrcpy(child_path, parent - argv[0] + 1, argv[0]);265 pstrcpy(child_path, parent - argv[0] + 1, argv[0]);

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