在 2024-07-31 00:37, Pali Rohár 写道:
Well, I do not know. I have just looked at different versions of
delayimp.h and winerror.h header files available on internet and always
they were present in some SDK folder. So I though that are part of SDK.
Normally people install all headers files which comes from CRT, WinSDK,
Visual Studio, etc... so it is hard to guess from which source it comes
from.

I have rephrased the last paragraph. What do you think?



--
Best regards,
LIU Hao
From 48cf32beae4d400cf6a7f1d57ab51c2b409a9f44 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Pali=20Roh=C3=A1r?= <pali.ro...@gmail.com>
Date: Sun, 28 Jul 2024 20:58:52 +0200
Subject: [PATCH] headers: Fix compile warning: FACILITY_VISUALCPP redefined

Warning is:

    In file included from misc/delay-f.c:11:
    mingw-w64-headers/include/delayimp.h:64: warning: "FACILITY_VISUALCPP" redefined
     #define FACILITY_VISUALCPP ((LONG)0x6d)

    In file included from mingw-w64-headers/include/winbase.h:2817,
                     from mingw-w64-headers/include/windows.h:70,
                     from misc/delay-f.c:10:
    mingw-w64-headers/include/winerror.h:88: note: this is the location of the previous definition
     #define FACILITY_VISUALCPP 109

This same header from Visual Studio has such a definition commented out,
suggesting that it should be defined in winerror.h. We notice that delayimp.h
can't be used without including Windows SDK headers first, so don't redefine
`FACILITY_VISUALCPP` if one has already been defined.

Signed-off-by: LIU Hao <lh_mo...@126.com>
---
 mingw-w64-headers/include/delayimp.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mingw-w64-headers/include/delayimp.h b/mingw-w64-headers/include/delayimp.h
index 637b9aa65..61980ee7c 100644
--- a/mingw-w64-headers/include/delayimp.h
+++ b/mingw-w64-headers/include/delayimp.h
@@ -61,7 +61,9 @@ typedef FARPROC (WINAPI *PfnDliHook)(unsigned dliNotify,PDelayLoadInfo pdli);
 ExternC WINBOOL WINAPI __FUnloadDelayLoadedDLL2(LPCSTR szDll);
 ExternC HRESULT WINAPI __HrLoadAllImportsForDll(LPCSTR szDll);
 
+#ifndef FACILITY_VISUALCPP
 #define FACILITY_VISUALCPP ((LONG)0x6d)
+#endif
 #define VcppException(sev,err) ((sev) | (FACILITY_VISUALCPP<<16) | err)
 
 ExternC PfnDliHook __pfnDliNotifyHook2;
-- 
2.43.0

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

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

Reply via email to