On 2018/04/26 12:44, JonY via Mingw-w64-public wrote:
On 04/25/2018 07:47 PM, Josh de Kock wrote:
---
  mingw-w64-headers/crt/_mingw.h.in | 4 ++++
  1 file changed, 4 insertions(+)


Can you show a test case where it fails without this patch?


user@pc:~$ cat t.rc
#include <winver.h>
user@pc:~$ x86_64-w64-mingw32-clang -xc -E -P -DRC_INVOKED t.rc | sed '/^$/d'
#pragma pack(push,_CRT_PACKING)
 typedef __builtin_va_list __gnuc_va_list;
  typedef __gnuc_va_list va_list;
#pragma pack(pop)
void __attribute__((__cdecl__)) __debugbreak(void);
extern __inline__ __attribute__((__always_inline__,__gnu_inline__)) void __attribute__((__cdecl__)) __debugbreak(void)
{
  __asm__ __volatile__("int {$}3":);
}
const char *__mingw_get_crt_info (void);
user@pc:~$

Using a sufficiently pendantic resource compiler, it cannot handle C constructs. RC_INVOKED should guard for this. With this patch no output is produced for the above test file. Though it seems there are a few other cases where C is not guarded by RC_INVOKED (such as windows.h), but they seem minimal. Would a patch guarding more thoroughly be accepted? The current behaviour seems to intend to guard all C with RC_INVOKED but due to the resource compilers mostly being rather lax, it is difficult to notice the few cases where they are not.

--
Josh

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to