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.

This commit is contained in:
Christian Jullien 2021-06-28 13:07:29 +02:00
parent b5d4b908c4
commit 39d586d7fc

View file

@ -1082,7 +1082,9 @@ LIBTCCAPI int tcc_add_file(TCCState *s, const char *filename)
filetype = AFF_TYPE_ASMPP;
else if (!strcmp(ext, "s"))
filetype = AFF_TYPE_ASM;
else if (!PATHCMP(ext, "c") || !PATHCMP(ext, "i"))
else if (!PATHCMP(ext, "c")
|| !PATHCMP(ext, "h")
|| !PATHCMP(ext, "i"))
filetype = AFF_TYPE_C;
else
filetype |= AFF_TYPE_BIN;