History

#define __GNUC__ = 2.1

__GNUC__ nowadays as macro seems to mean the "GNU C dialect" rather than the compiler itself. See also http://gcc.gnu.org/ml/gcc/2008-07/msg00026.html This patch will probably cause problems of various kinds but maybe we should try nonetheless.

grischka committed 10 years ago

Commit f3c1ea61 parent 4d247c03 files · +27 −6Browse files

Unified · Split

3 files
  1. libtcc.c +19 −6
  2. tccgen.c +4 −0
  3. tcctok.h +4 −0
libtcc.c+19−6
@@ -885,15 +885,28 @@ LIBTCCAPI TCCState *tcc_new(void) · 884 unmodified lines
885 /* wint_t is unsigned int by default, but (signed) int on BSDs885 /* wint_t is unsigned int by default, but (signed) int on BSDs
886 and unsigned short on windows. Other OSes might have still886 and unsigned short on windows. Other OSes might have still
887 other conventions, sigh. */887 other conventions, sigh. */
888#if defined(__FreeBSD__) || defined (__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__)888# if defined(__FreeBSD__) || defined (__FreeBSD_kernel__)
889 || defined(__NetBSD__) || defined(__OpenBSD__)
889 tcc_define_symbol(s, "__WINT_TYPE__", "int");890 tcc_define_symbol(s, "__WINT_TYPE__", "int");
890#else891# else
891 tcc_define_symbol(s, "__WINT_TYPE__", "unsigned int");892 tcc_define_symbol(s, "__WINT_TYPE__", "unsigned int");
892#endif893# endif
894# if 0
893 /* glibc defines */895 /* glibc defines */
894 tcc_define_symbol(s, "__REDIRECT(name, proto, alias)", "name proto __asm__ (#alias)");896 tcc_define_symbol(s, "__REDIRECT(name, proto, alias)",
895 tcc_define_symbol(s, "__REDIRECT_NTH(name, proto, alias)", "name proto __asm__ (#alias) __THROW");897 "name proto __asm__ (#alias)");
896#endif898 tcc_define_symbol(s, "__REDIRECT_NTH(name, proto, alias)",
899 "name proto __asm__ (#alias) __THROW");
900# endif
901# if 1
902 /* define __GNUC__ to have some useful stuff from sys/cdefs.h */
903 tcc_define_symbol(s, "__GNUC__", "2");
904 tcc_define_symbol(s, "__GNUC_MINOR__", "1");
905 tcc_define_symbol(s, "__builtin_alloca", "alloca");
906 tcc_define_symbol(s, "__builtin_memcpy", "memcpy");
907 tcc_define_symbol(s, "__USER_LABEL_PREFIX__", "");
908# endif
909#endif /* ndef TCC_TARGET_PE */
897 910
898 return s;911 return s;
899}912}
tccgen.c+4−0
@@ -3104,10 +3104,14 @@ static void parse_attribute(AttributeDef *ad) · 3103 unmodified lines
3104 case TOK_MODE_DI:3104 case TOK_MODE_DI:
3105 ad->a.mode = VT_LLONG + 1;3105 ad->a.mode = VT_LLONG + 1;
3106 break;3106 break;
3107 case TOK_MODE_QI:
3108 ad->a.mode = VT_BYTE + 1;
3109 break;
3107 case TOK_MODE_HI:3110 case TOK_MODE_HI:
3108 ad->a.mode = VT_SHORT + 1;3111 ad->a.mode = VT_SHORT + 1;
3109 break;3112 break;
3110 case TOK_MODE_SI:3113 case TOK_MODE_SI:
3114 case TOK_MODE_word:
3111 ad->a.mode = VT_INT + 1;3115 ad->a.mode = VT_INT + 1;
3112 break;3116 break;
3113 default:3117 default:
tcctok.h+4−0
@@ -117,10 +117,14 @@ · 116 unmodified lines
117 DEF(TOK_FASTCALL1, "fastcall")117 DEF(TOK_FASTCALL1, "fastcall")
118 DEF(TOK_FASTCALL2, "__fastcall")118 DEF(TOK_FASTCALL2, "__fastcall")
119 DEF(TOK_FASTCALL3, "__fastcall__")119 DEF(TOK_FASTCALL3, "__fastcall__")
120
120 DEF(TOK_MODE, "__mode__")121 DEF(TOK_MODE, "__mode__")
122 DEF(TOK_MODE_QI, "__QI__")
121 DEF(TOK_MODE_DI, "__DI__")123 DEF(TOK_MODE_DI, "__DI__")
122 DEF(TOK_MODE_HI, "__HI__")124 DEF(TOK_MODE_HI, "__HI__")
123 DEF(TOK_MODE_SI, "__SI__")125 DEF(TOK_MODE_SI, "__SI__")
126 DEF(TOK_MODE_word, "__word__")
127
124 DEF(TOK_DLLEXPORT, "dllexport")128 DEF(TOK_DLLEXPORT, "dllexport")
125 DEF(TOK_DLLIMPORT, "dllimport")129 DEF(TOK_DLLIMPORT, "dllimport")
126 DEF(TOK_NORETURN1, "noreturn")130 DEF(TOK_NORETURN1, "noreturn")

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