-T(_MS, near, "_near",)
-T(_MS, _near, "__near", = T_near)
-T(_MS, far, "_far",)
-T(_MS, _far, "__far", = T_far)
-T(_MS, cdecl, "cdecl",)
-T(_MS, _cdecl, "_cdecl", = T_cdecl)
-T(_MS, __cdecl, "__cdecl", = T_cdecl)
-T(_MS, stdcall, "_stdcall",)
-T(_MS, __stdcall, "__stdcall", = T_stdcall)
-T(_MS, fastcall, "_fastcall",)
-T(_MS, __fastcall, "__fastcall", = T_fastcall)
-T(_MS, thiscall, "_thiscall",)
-T(_MS, __thiscall, "__thiscall", = T_thiscall)
-T(_MS, forceinline, "_forceinline",)
-T(_MS, __forceinline, "__forceinline", = T_forceinline)
-T(_MS, unaligned, "_unaligned",)
-T(_MS, __unaligned, "__unaligned", = T_unaligned)
-T(_MS, assume, "_assume",)
-T(_MS, __assume, "__assume", = T_assume)
-T(_MS, try, "_try",)
-T(_MS, __try, "__try", = T_try)
-T(_MS, finally, "_finally",)
-T(_MS, __finally, "__finally", = T_finally)
-T(_MS, leave, "_leave",)
-T(_MS, __leave, "__leave", = T_leave)
-T(_MS, except, "_except",)
-T(_MS, __except, "__except", = T_except)
-T(_MS, declspec, "_declspec",)
-T(_MS, __declspec, "__declspec", = T_declspec)
-T(_MS, based, "_based",)
-T(_MS, __based, "__based", = T_based)
+#if defined(__MINGW32__) || defined(__CYGWIN__)
+#ifdef __cdecl
+#undef __cdecl
+#endif
+#ifdef __stdcall
+#undef __stdcall
+#endif
+#ifdef __fastcall
+#undef __fastcall
+#endif
+#endif
+
+/* needed on darwin... */
+#ifdef __signed
+#undef __signed
+#endif
+#ifdef __volatile
+#undef __volatile
+#endif
+#ifdef __const
+#undef __const
+#endif
+#ifdef __restrict
+#undef __restrict
+#endif
+
+#define S(mode, x, val) T(mode, x, #x, val)
+S(_ANSI|_C99|_CXX, signed, )
+S(_ALL, __signed, = T_signed)
+S(_ALL, __signed__, = T_signed)
+S(_C99|_GNUC, _Complex, )
+S(_ALL, __complex__, = T__Complex)
+S(_ALL, __complex, = T__Complex)
+S(_C99|_GNUC, _Imaginary, )
+S(_ALL, __real__, )
+S(_ALL, __real, = T___real__)
+S(_ALL, __imag__, )
+S(_ALL, __imag, = T___imag__)
+S(_ALL, __alignof__, )
+S(_ALL, __alignof, = T___alignof__)
+S(_MS, _alignof, = T___alignof__)
+S(_ANSI|_C99|_CXX, const, )
+S(_ALL, __const, = T_const)
+S(_ALL, __const__, = T_const)
+S(_C99, restrict, )
+S(_ALL, __restrict__, = T_restrict)
+S(_ALL, __restrict, = T_restrict)
+S(_MS, _restrict, = T_restrict)
+S(_ALL, asm, )
+S(_ALL, __asm__, = T_asm)
+S(_MS, _asm, = T_asm)
+S(_ALL, __asm, = T_asm)
+S(_ANSI|_C99|_CXX, volatile, )
+S(_ALL, __volatile, = T_volatile)
+S(_ALL, __volatile__, = T_volatile)
+S(_C99|_CXX, inline, )
+S(_ALL, __inline, = T_inline)
+S(_ALL, __inline__, = T_inline)
+S(_GNUC, typeof, )
+S(_ALL, __typeof, = T_typeof)
+S(_ALL, __typeof__, = T_typeof)
+S(_ALL, __attribute__, )