History

gcc compiles .h files as .c source code, tcc now does the same and no longer complains with "unrecognized file type". It is however adviced to use "-x c" option which exists for this purpose in gcc and was supported by tcc.

Christian Jullien committed 5 years ago

Commit 39d586d1 parent b5d4b901 file · +3 −1Browse files

Unified · Split

libtcc.c+3−1
@@ -1082,7 +1082,9 @@ LIBTCCAPI int tcc_add_file(TCCState *s, const char *filename) · 1081 unmodified lines
1082 filetype = AFF_TYPE_ASMPP;1082 filetype = AFF_TYPE_ASMPP;
1083 else if (!strcmp(ext, "s"))1083 else if (!strcmp(ext, "s"))
1084 filetype = AFF_TYPE_ASM;1084 filetype = AFF_TYPE_ASM;
1085 else if (!PATHCMP(ext, "c") || !PATHCMP(ext, "i"))1085 else if (!PATHCMP(ext, "c")
1086 || !PATHCMP(ext, "h")
1087 || !PATHCMP(ext, "i"))
1086 filetype = AFF_TYPE_C;1088 filetype = AFF_TYPE_C;
1087 else1089 else
1088 filetype |= AFF_TYPE_BIN;1090 filetype |= AFF_TYPE_BIN;

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