History

tccasm: define __ASSEMBLER__ for .S files, like gcc does

Joe Soroka committed 15 years ago

Commit a25325e1 parent 75c66952 files · +10 −0Browse files

Unified · Split

2 files
  1. libtcc.c +6 −0
  2. tests/asmtest.S +4 −0
libtcc.c+6−0
@@ -1080,6 +1080,12 @@ ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags) · 1079 unmodified lines
1080 if (ext[0])1080 if (ext[0])
1081 ext++;1081 ext++;
1082 1082
1083#ifdef CONFIG_TCC_ASM
1084 /* if .S file, define __ASSEMBLER__ like gcc does */
1085 if (!strcmp(ext, "S"))
1086 tcc_define_symbol(s1, "__ASSEMBLER__", NULL);
1087#endif
1088
1083 /* open the file */1089 /* open the file */
1084 ret = tcc_open(s1, filename);1090 ret = tcc_open(s1, filename);
1085 if (ret < 0) {1091 if (ret < 0) {
tests/asmtest.S+4−0
@@ -564,3 +564,7 @@ int $0x10 · 563 unmodified lines
564 pushl $1564 pushl $1
565 pushw $1565 pushw $1
566 push $1566 push $1
567
568#ifdef __ASSEMBLER__ // should be defined, for S files
569 inc %eax
570#endif

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