I think this `__stdcall` macro should be removed.

-- 
Best regards,
LIU Hao
From 16ad382685cb899e9369a28ab8c37c8afb3def59 Mon Sep 17 00:00:00 2001
From: LIU Hao <lh_mo...@126.com>
Date: Sun, 6 Nov 2022 03:12:49 +0800
Subject: [PATCH] headers/_mingw: Remove the obsolete `__stdcall` macro

This was introduced in 8bcbcee35c14048ab361c1f4db12dbd5b521cd07.

Both GCC and Clang have it as a builtin macro, which expands to
`__attribute__((__stdcall__))`. It shouldn't be redefined, unless it's
really necessary, for example, when working around bugs in a certain
version of the compiler.

Nowadays, in the case of x86_64, this code

  int (* __cdecl cdecl_ptr)(int);
  int (* __stdcall stdcall_ptr)(int) = cdecl_ptr;

compiles without warnings or errors. The `__stdcall` attribute does
not have any effects whatsoever and can be left intact.

Signed-off-by: LIU Hao <lh_mo...@126.com>
---
 mingw-w64-headers/crt/_mingw.h.in | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/mingw-w64-headers/crt/_mingw.h.in 
b/mingw-w64-headers/crt/_mingw.h.in
index 3a83bbeff..f931579a7 100644
--- a/mingw-w64-headers/crt/_mingw.h.in
+++ b/mingw-w64-headers/crt/_mingw.h.in
@@ -27,13 +27,6 @@
 #endif
 
 /* C/C++ specific language defines.  */
-#ifdef _WIN64
-#ifdef __stdcall
-#undef __stdcall
-#endif
-#define __stdcall
-#endif
-
 #ifndef __GNUC__
 # ifndef __MINGW_IMPORT
 #  define __MINGW_IMPORT  __declspec(dllimport)
-- 
2.38.1

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to