aboutsummaryrefslogtreecommitdiff
path: root/libtcc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libtcc.c')
-rw-r--r--libtcc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libtcc.c b/libtcc.c
index 58a5ca0..e538321 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -1080,6 +1080,12 @@ ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags)
if (ext[0])
ext++;
+#ifdef CONFIG_TCC_ASM
+ /* if .S file, define __ASSEMBLER__ like gcc does */
+ if (!strcmp(ext, "S"))
+ tcc_define_symbol(s1, "__ASSEMBLER__", NULL);
+#endif
+
/* open the file */
ret = tcc_open(s1, filename);
if (ret < 0) {