[PATCH 8/9] cygwin: add the predefines '__cdecl', ...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For CygWin, GCC defines some pseudo-specifiers like '__cdecl',
'__stdcall' or '_thiscall'. Some of these are already defined by cgcc.

So, add these predefines to sparse itself.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 predefine.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/predefine.c b/predefine.c
index 0f36f7ef56d2..94952e81d1df 100644
--- a/predefine.c
+++ b/predefine.c
@@ -221,6 +221,15 @@ void predefined_macros(void)
 		predefine("__CYGWIN__", 1, "1");
 		if (arch_m64 == ARCH_LP32)
 			predefine("__CYGWIN32__", 1, "1");
+		add_pre_buffer("#define __cdecl __attribute__((__cdecl__))\n");
+		add_pre_buffer("#define __declspec(x) __attribute__((x))\n");
+		add_pre_buffer("#define __fastcall __attribute__((__fastcall__))\n");
+		add_pre_buffer("#define __stdcall __attribute__((__stdcall__))\n");
+		add_pre_buffer("#define __thiscall __attribute__((__thiscall__))\n");
+		add_pre_buffer("#define _cdecl __attribute__((__cdecl__))\n");
+		add_pre_buffer("#define _fastcall __attribute__((__fastcall__))\n");
+		add_pre_buffer("#define _stdcall __attribute__((__stdcall__))\n");
+		add_pre_buffer("#define _thiscall __attribute__((__thiscall__))\n");
 		break;
 	case OS_DARWIN:
 		predefine("__APPLE__", 1, "1");
-- 
2.27.0




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux