mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-24 07:50:12 +08:00
tccasm: define __ASSEMBLER__ for .S files, like gcc does
This commit is contained in:
parent
75c6695932
commit
a25325e9be
6
libtcc.c
6
libtcc.c
@ -1080,6 +1080,12 @@ ST_FUNC int tcc_add_file_internal(TCCState *s1, const char *filename, int flags)
|
|||||||
if (ext[0])
|
if (ext[0])
|
||||||
ext++;
|
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 */
|
/* open the file */
|
||||||
ret = tcc_open(s1, filename);
|
ret = tcc_open(s1, filename);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
|
@ -564,3 +564,7 @@ int $0x10
|
|||||||
pushl $1
|
pushl $1
|
||||||
pushw $1
|
pushw $1
|
||||||
push $1
|
push $1
|
||||||
|
|
||||||
|
#ifdef __ASSEMBLER__ // should be defined, for S files
|
||||||
|
inc %eax
|
||||||
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user