aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
diff options
context:
space:
mode:
authorseyko <seyko2@gmail.com>2015-04-10 16:53:29 +0300
committerseyko <seyko2@gmail.com>2015-04-10 16:53:29 +0300
commitd81611b6416a397f69272bffdb90506869e3fce8 (patch)
treea3afcc150fd3c3d684a704d97b1abf4406f2a13e /libtcc.c
parent8037a1ce39730f729b75907d0fa5691412c82e46 (diff)
downloadtinycc-d81611b6416a397f69272bffdb90506869e3fce8.tar.gz
tinycc-d81611b6416a397f69272bffdb90506869e3fce8.tar.bz2
fix a preprocessor for .S
Lets assume that in *.S files a preprocessor directive follow '#' char w/o spaces between. Otherwise there is too many problems with the content of the comments.
Diffstat (limited to 'libtcc.c')
-rw-r--r--libtcc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libtcc.c b/libtcc.c
index fbc2e50..e25381e 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1146,10 +1146,13 @@ ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags)
if (ext[0])
ext++;
+ parse_flags = 0;
#ifdef CONFIG_TCC_ASM
/* if .S file, define __ASSEMBLER__ like gcc does */
- if (!strcmp(ext, "S"))
+ if (!strcmp(ext, "S") || !strcmp(ext, "s")) {
tcc_define_symbol(s1, "__ASSEMBLER__", NULL);
+ parse_flags = PARSE_FLAG_ASM_FILE;
+ }
#endif
/* open the file */