[PATCH 0/7] MR10303: SDK compliance (2)
This serie ensures a couple of Wine include files are properly defined when included from C++ code. It mainly adds a extern "C" { ... } around the various definitions. The list of modified files has been determined by: - checking Wine headers without extern "C" instruction, while SDK one has it, - not all files matching that criteria have been patched (eg DDK files have been left out) - some files have been patched even if their current content doesn't require it (ie no variable nor extern function definition), esp. when their SDK equivalent has a lot of such definitions (so that the c++ guard is not forgotten when the header file is updated), - search criteria is also not 100% accurate (eg missing EXTERN_C macro). Been triggered by bcrypt.h failing to be used in C++ code (didn't test for the others). -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10303
From: Eric Pouech <epouech@codeweavers.com> Mainly wrapping the header inside extern "C" {...} Part 1 : [a-c] range. Signed-off-by: Eric Pouech <epouech@codeweavers.com> --- include/amaudio.h | 8 ++++++++ include/amva.h | 8 ++++++++ include/bcrypt.h | 8 ++++++++ include/concurrencysal.h | 8 ++++++++ 4 files changed, 32 insertions(+) diff --git a/include/amaudio.h b/include/amaudio.h index e684821b929..a66647e56b2 100644 --- a/include/amaudio.h +++ b/include/amaudio.h @@ -19,6 +19,10 @@ #ifndef __AMAUDIO__ #define __AMAUDIO__ +#ifdef __cplusplus +extern "C" { +#endif + #include <mmsystem.h> #include <dsound.h> @@ -44,4 +48,8 @@ DECLARE_INTERFACE_(IAMDirectSound,IUnknown) }; #undef INTERFACE +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/amva.h b/include/amva.h index faf103270fc..e94a9dbf7a0 100644 --- a/include/amva.h +++ b/include/amva.h @@ -19,6 +19,10 @@ #ifndef __AMVA_INCLUDED__ #define __AMVA_INCLUDED__ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct _tag_AMVABeginFrameInfo { DWORD dwDestSurfaceIndex; @@ -71,4 +75,8 @@ typedef struct _tag_AMVAUncompDataInfo DDPIXELFORMAT ddUncompPixelFormat; } AMVAUncompDataInfo, *LPAMVAUncompDataInfo; +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/bcrypt.h b/include/bcrypt.h index b0cdf6e27a3..0830c14b299 100644 --- a/include/bcrypt.h +++ b/include/bcrypt.h @@ -19,6 +19,10 @@ #ifndef __WINE_BCRYPT_H #define __WINE_BCRYPT_H +#ifdef __cplusplus +extern "C" { +#endif + #ifndef WINAPI #define WINAPI __stdcall #endif @@ -604,4 +608,8 @@ NTSTATUS WINAPI BCryptSetProperty(BCRYPT_HANDLE, LPCWSTR, PUCHAR, ULONG, ULONG); NTSTATUS WINAPI BCryptSignHash(BCRYPT_KEY_HANDLE, void *, PUCHAR, ULONG, PUCHAR, ULONG, ULONG *, ULONG); NTSTATUS WINAPI BCryptVerifySignature(BCRYPT_KEY_HANDLE, void *, UCHAR *, ULONG, UCHAR *, ULONG, ULONG); +#ifdef __cplusplus +} +#endif + #endif /* __WINE_BCRYPT_H */ diff --git a/include/concurrencysal.h b/include/concurrencysal.h index fc86045e9fc..582a282bfb4 100644 --- a/include/concurrencysal.h +++ b/include/concurrencysal.h @@ -7,6 +7,10 @@ #ifndef CONCURRENCYSAL_HXX #define CONCURRENCYSAL_HXX +#ifdef __cplusplus +extern "C" { +#endif + #define _Benign_race_begin_ #define _Benign_race_end_ #define _No_competing_thread_begin_ @@ -45,4 +49,8 @@ #define _Requires_no_locks_held_ #define _Write_guarded_by_(lock) +#ifdef __cplusplus +} +#endif + #endif -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10303
From: Eric Pouech <epouech@codeweavers.com> Mainly wrapping the header inside extern "C" {...} Part 2: [d-e] range. Signed-off-by: Eric Pouech <epouech@codeweavers.com> --- include/d3d10_1shader.h | 8 ++++++++ include/d3d11shader.h | 8 ++++++++ include/davclnt.h | 8 ++++++++ include/devquerydef.h | 8 ++++++++ include/dhcpcsdk.h | 8 ++++++++ include/driverspecs.h | 8 ++++++++ include/dvdmedia.h | 8 ++++++++ include/errorrep.h | 8 ++++++++ 8 files changed, 64 insertions(+) diff --git a/include/d3d10_1shader.h b/include/d3d10_1shader.h index 06dded7e0e8..e562a96ac09 100644 --- a/include/d3d10_1shader.h +++ b/include/d3d10_1shader.h @@ -19,6 +19,10 @@ #ifndef __D3D10_1SHADER_H__ #define __D3D10_1SHADER_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include "d3d10shader.h" DEFINE_GUID(IID_ID3D10ShaderReflection1, 0xc3457783, 0xa846, 0x47ce, 0x95, 0x20, 0xce, 0xa6, 0xf6, 0x6e, 0x74, 0x47); @@ -49,4 +53,8 @@ DECLARE_INTERFACE_(ID3D10ShaderReflection1, IUnknown) }; #undef INTERFACE +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/d3d11shader.h b/include/d3d11shader.h index 236ca023c00..5941bc5db64 100644 --- a/include/d3d11shader.h +++ b/include/d3d11shader.h @@ -19,6 +19,10 @@ #ifndef __D3D11SHADER_H__ #define __D3D11SHADER_H__ +#ifdef __cplusplus +extern "C" { +#endif + #include "d3dcommon.h" /* If not defined set d3dcompiler_47 by default. */ @@ -335,4 +339,8 @@ DECLARE_INTERFACE_(ID3D11FunctionLinkingGraph, IUnknown) }; #undef INTERFACE +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/davclnt.h b/include/davclnt.h index 77c22e0762e..16dc35474fd 100644 --- a/include/davclnt.h +++ b/include/davclnt.h @@ -19,6 +19,10 @@ #ifndef __WINE_DAVCLNT_H #define __WINE_DAVCLNT_H +#ifdef __cplusplus +extern "C" { +#endif + #define OPAQUE_HANDLE DWORD #define DAV_AUTHN_SCHEME_BASIC 0x00000001 @@ -70,4 +74,8 @@ DWORD WINAPI DavGetUNCFromHTTPPath(LPCWSTR,LPWSTR,LPDWORD); OPAQUE_HANDLE WINAPI DavRegisterAuthCallback(PFNDAVAUTHCALLBACK,ULONG); VOID WINAPI DavUnregisterAuthCallback(OPAQUE_HANDLE); +#ifdef __cplusplus +} +#endif + #endif /* __WINE_DAVCLNT_H */ diff --git a/include/devquerydef.h b/include/devquerydef.h index 5ad01205a16..40e03ab8479 100644 --- a/include/devquerydef.h +++ b/include/devquerydef.h @@ -19,6 +19,10 @@ #ifndef __DEVQUERYDEF_H__ #define __DEVQUERYDEF_H__ +#ifdef __cplusplus +extern "C" { +#endif + typedef enum _DEV_OBJECT_TYPE { DevObjectTypeUnknown, @@ -87,4 +91,8 @@ typedef struct _DEV_QUERY_PARAMETER void *Buffer; } DEV_QUERY_PARAMETER, *PDEV_QUERY_PARAMETER; +#ifdef __cplusplus +} +#endif + #endif /* __DEVQUERYDEF_H__ */ diff --git a/include/dhcpcsdk.h b/include/dhcpcsdk.h index 8f96a8212d4..d9f2b913685 100644 --- a/include/dhcpcsdk.h +++ b/include/dhcpcsdk.h @@ -18,6 +18,10 @@ #ifndef _DHCPCSDK_ #define _DHCPCSDK_ +#ifdef __cplusplus +extern "C" { +#endif + #define OPTION_PAD 0 #define OPTION_SUBNET_MASK 1 #define OPTION_TIME_OFFSET 2 @@ -122,4 +126,8 @@ DWORD WINAPI DhcpCApiInitialize(DWORD *); DWORD WINAPI DhcpRequestParams(DWORD, void *, WCHAR *, DHCPCAPI_CLASSID *, DHCPCAPI_PARAMS_ARRAY, DHCPCAPI_PARAMS_ARRAY, BYTE *, DWORD *, WCHAR *); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/driverspecs.h b/include/driverspecs.h index 509a2bd44bf..50fa78a95f3 100644 --- a/include/driverspecs.h +++ b/include/driverspecs.h @@ -9,6 +9,10 @@ #ifndef DRIVERSPECS_H #define DRIVERSPECS_H +#ifdef __cplusplus +extern "C" { +#endif + #include <specstrings.h> #include <concurrencysal.h> @@ -52,4 +56,8 @@ #define __user_code #define __user_driver +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/dvdmedia.h b/include/dvdmedia.h index 6e625b472f8..a61f1ce01fa 100644 --- a/include/dvdmedia.h +++ b/include/dvdmedia.h @@ -19,6 +19,10 @@ #ifndef __DVDMEDIA_H__ #define __DVDMEDIA_H__ +#ifdef __cplusplus +extern "C" { +#endif + #define AMCONTROL_USED 0x00000001 #define AMCONTROL_PAD_TO_4x3 0x00000002 #define AMCONTROL_PAD_TO_16x9 0x00000004 @@ -66,4 +70,8 @@ typedef struct tagMPEG2VIDEOINFO { #define AMINTERLACE_DisplayModeBobOrWeave 0x0080 #define AMINTERLACE_DisplayModeMask 0x00c0 +#ifdef __cplusplus +} +#endif + #endif /* __DVDMEDIA_H__ */ diff --git a/include/errorrep.h b/include/errorrep.h index 5af7bf69450..ee8c492f417 100644 --- a/include/errorrep.h +++ b/include/errorrep.h @@ -21,6 +21,10 @@ #ifndef __WINE_ERRORREP_H #define __WINE_ERRORREP_H +#ifdef __cplusplus +extern "C" { +#endif + typedef enum tagEFaultRepRetVal { frrvOk, @@ -40,4 +44,8 @@ BOOL WINAPI AddERExcludedApplicationA(LPCSTR); BOOL WINAPI AddERExcludedApplicationW(LPCWSTR); #define AddERExcludedApplication WINELIB_NAME_AW(AddERExcludedApplication) +#ifdef __cplusplus +} +#endif + #endif /* __WINE_ERORREP_H */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10303
From: Eric Pouech <epouech@codeweavers.com> Mainly wrapping the header inside extern "C" {...} Part 3: [i-l] range. Signed-off-by: Eric Pouech <epouech@codeweavers.com> --- include/icu.h | 8 ++++++++ include/ifdef.h | 8 ++++++++ include/intsafe.h | 11 +++++++++++ include/ipifcons.h | 8 ++++++++ include/iptypes.h | 8 ++++++++ include/ks.h | 8 ++++++++ 6 files changed, 51 insertions(+) diff --git a/include/icu.h b/include/icu.h index 65615e9bc78..6b9eb6ebc5e 100644 --- a/include/icu.h +++ b/include/icu.h @@ -44,6 +44,10 @@ #ifndef __WINE_ICU_H #define __WINE_ICU_H +#ifdef __cplusplus +extern "C" { +#endif + #define U_MAX_VERSION_LENGTH 4 typedef uint8_t UBiDiLevel; @@ -3038,4 +3042,8 @@ void __cdecl utrans_transIncrementalUChars(const UTransliterator *trans, UChar * void __cdecl utrans_transUChars(const UTransliterator *trans, UChar *text, int32_t *textLength, int32_t textCapacity, int32_t start, int32_t *limit, UErrorCode *status); void __cdecl utrans_unregisterID(const UChar *id, int32_t idLength); +#ifdef __cplusplus +} +#endif + #endif /* __WINE_ICU_H */ diff --git a/include/ifdef.h b/include/ifdef.h index bdda8a20df8..2af86de1e04 100644 --- a/include/ifdef.h +++ b/include/ifdef.h @@ -18,6 +18,10 @@ #ifndef WINE_IFDEF_H #define WINE_IFDEF_H +#ifdef __cplusplus +extern "C" { +#endif + #include <ipifcons.h> typedef ULONG32 NET_IF_OBJECT_ID, *PNET_IF_OBJECT_ID; @@ -226,4 +230,8 @@ typedef struct _NDIS_INTERFACE_INFORMATION { ULONG SupportedStatistics; } NDIS_INTERFACE_INFORMATION, *PNDIS_INTERFACE_INFORMATION; +#ifdef __cplusplus +} +#endif + #endif /* WINE_IFDEF_H*/ diff --git a/include/intsafe.h b/include/intsafe.h index e1fef256147..64c77fac7e8 100644 --- a/include/intsafe.h +++ b/include/intsafe.h @@ -7,6 +7,11 @@ #ifndef _INTSAFE_H_INCLUDED_ #define _INTSAFE_H_INCLUDED_ +#ifdef __cplusplus +extern "C" { +#endif + + #include <winapifamily.h> #if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) @@ -1050,5 +1055,11 @@ __MINGW_INTSAFE_API __MINGW_INTSAFE_MATH(LongLongMult, LONGLONG, mul) #define Int64Mult LongLongMult #endif /* __MINGW_INTSAFE_WORKS */ + #endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */ + +#ifdef __cplusplus +} +#endif + #endif /* _INTSAFE_H_INCLUDED_ */ diff --git a/include/ipifcons.h b/include/ipifcons.h index a29ddb28c14..8cc18dac8b9 100644 --- a/include/ipifcons.h +++ b/include/ipifcons.h @@ -18,6 +18,10 @@ #ifndef WINE_IPIFCONS_H__ #define WINE_IPIFCONS_H__ +#ifdef __cplusplus +extern "C" { +#endif + #define IF_TYPE_OTHER 1 #define IF_TYPE_REGULAR_1822 2 #define IF_TYPE_HDH_1822 3 @@ -243,4 +247,8 @@ typedef enum _INTERNAL_IF_OPER_STATUS MIB_IF_OPER_STATUS_OPERATIONAL = 5, } INTERNAL_IF_OPER_STATUS; +#ifdef __cplusplus +} +#endif + #endif /* WINE_IPIFCONS_H__ */ diff --git a/include/iptypes.h b/include/iptypes.h index d8609654748..bae5da9c0fb 100644 --- a/include/iptypes.h +++ b/include/iptypes.h @@ -19,6 +19,10 @@ #ifndef WINE_IPTYPES_H_ #define WINE_IPTYPES_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include <time.h> #include <ifdef.h> #include <nldef.h> @@ -332,4 +336,8 @@ typedef IP_ADAPTER_ADDRESSES_LH *PIP_ADAPTER_ADDRESSES; #endif /* _WINSOCK2API_ */ +#ifdef __cplusplus +} +#endif + #endif /* WINE_IPTYPES_H_*/ diff --git a/include/ks.h b/include/ks.h index 168357ed1cc..f7320456129 100644 --- a/include/ks.h +++ b/include/ks.h @@ -19,6 +19,10 @@ #ifndef _KS_ #define _KS_ +#ifdef __cplusplus +extern "C" { +#endif + typedef union tagKSIDENTIFIER { struct @@ -63,4 +67,8 @@ typedef union unionKSDATAFORMAT LONGLONG Alignment; } KSDATAFORMAT, *PKSDATAFORMAT, KSDATARANGE, *PKSDATARANGE; +#ifdef __cplusplus +} +#endif + #endif /* _KS_ */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10303
From: Eric Pouech <epouech@codeweavers.com> Mainly wrapping the header inside extern "C" {...} Adding re-inclusion guard for memoryapi.h Part 4: [m] range. Signed-off-by: Eric Pouech <epouech@codeweavers.com> --- include/memoryapi.h | 13 +++++++++++++ include/mgmtapi.h | 8 ++++++++ include/mmreg.h | 9 +++++++++ include/msacmdrv.h | 8 ++++++++ include/mstcpip.h | 8 ++++++++ 5 files changed, 46 insertions(+) diff --git a/include/memoryapi.h b/include/memoryapi.h index 2cfcdd5a273..ac3274b9688 100644 --- a/include/memoryapi.h +++ b/include/memoryapi.h @@ -14,6 +14,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef _MEMORYAPI_H_ +#define _MEMORYAPI_H_ + +#ifdef __cplusplus +extern "C" { +#endif + typedef enum WIN32_MEMORY_INFORMATION_CLASS { MemoryRegionInfo @@ -44,3 +51,9 @@ typedef struct WIN32_MEMORY_REGION_INFORMATION WINBASEAPI HANDLE WINAPI CreateFileMapping2(HANDLE,LPSECURITY_ATTRIBUTES,ULONG,ULONG,ULONG,ULONG64,const WCHAR*,MEM_EXTENDED_PARAMETER*,ULONG); WINBASEAPI DWORD WINAPI DiscardVirtualMemory(void *addr, SIZE_T size); WINBASEAPI BOOL WINAPI QueryVirtualMemoryInformation(HANDLE process,const void *addr, WIN32_MEMORY_INFORMATION_CLASS info_class, void *info, SIZE_T size, SIZE_T *ret_size); + +#ifdef __cplusplus +} +#endif + +#endif /* _MEMORYAPI_H_ */ diff --git a/include/mgmtapi.h b/include/mgmtapi.h index 0d22a7aceac..b44c7ebd595 100644 --- a/include/mgmtapi.h +++ b/include/mgmtapi.h @@ -19,6 +19,14 @@ #ifndef _INC_MGMTAPI #define _INC_MGMTAPI +#ifdef __cplusplus +extern "C" { +#endif + typedef void *LPSNMP_MGR_SESSION; +#ifdef __cplusplus +} +#endif + #endif /* _INC_MGMTAPI */ diff --git a/include/mmreg.h b/include/mmreg.h index 061aaa572a3..feefe9c34a6 100644 --- a/include/mmreg.h +++ b/include/mmreg.h @@ -25,6 +25,11 @@ #pragma pack(push,1) +#ifdef __cplusplus +extern "C" { +#endif + + /*********************************************************************** * Defines/Enums */ @@ -819,6 +824,10 @@ typedef struct tagEXBMINFOHEADER { #endif +#ifdef __cplusplus +} +#endif + #pragma pack(pop) #endif /* __WINE_MMREG_H */ diff --git a/include/msacmdrv.h b/include/msacmdrv.h index 3c17f9866de..f31258ba294 100644 --- a/include/msacmdrv.h +++ b/include/msacmdrv.h @@ -21,6 +21,10 @@ #ifndef __WINE_MSACMDRV_H #define __WINE_MSACMDRV_H +#ifdef __cplusplus +extern "C" { +#endif + #include <stdarg.h> #include <windef.h> @@ -157,4 +161,8 @@ typedef struct _ACMDRVFORMATSUGGEST DWORD cbwfxDst; } ACMDRVFORMATSUGGEST, *PACMDRVFORMATSUGGEST; +#ifdef __cplusplus +} +#endif + #endif /* __WINE_MSACMDRV_H */ diff --git a/include/mstcpip.h b/include/mstcpip.h index c7dffd55f12..95d3da0f1d9 100644 --- a/include/mstcpip.h +++ b/include/mstcpip.h @@ -18,6 +18,10 @@ #ifndef __WINE_MSTCPIP_H #define __WINE_MSTCPIP_H +#ifdef __cplusplus +extern "C" { +#endif + #include <nldef.h> struct tcp_keepalive @@ -85,4 +89,8 @@ struct tcp_keepalive #endif /* USE_WS_PREFIX */ +#ifdef __cplusplus +} +#endif + #endif /* __WINE_MSTCPIP_H */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10303
From: Eric Pouech <epouech@codeweavers.com> Mainly wrapping the header inside extern "C" {...} Part 5: [n-r] range. Signed-off-by: Eric Pouech <epouech@codeweavers.com> --- include/netioapi.h | 8 ++++++++ include/netiodef.h | 14 ++++++++------ include/newdev.h | 8 ++++++++ include/ntddcdrm.h | 8 ++++++++ include/rometadata.h | 8 ++++++++ 5 files changed, 40 insertions(+), 6 deletions(-) diff --git a/include/netioapi.h b/include/netioapi.h index 9994e5b19ac..9d770fc05cc 100644 --- a/include/netioapi.h +++ b/include/netioapi.h @@ -19,6 +19,10 @@ #ifndef __WINE_NETIOAPI_H #define __WINE_NETIOAPI_H +#ifdef __cplusplus +extern "C" { +#endif + #include <ntddndis.h> #ifndef IPHLPAPI_DLL_LINKAGE @@ -289,4 +293,8 @@ IPHLPAPI_DLL_LINKAGE DWORD WINAPI SetCurrentThreadCompartmentId(NET_IF_COMPARTME IPHLPAPI_DLL_LINKAGE PCHAR WINAPI if_indextoname(NET_IFINDEX,PCHAR); IPHLPAPI_DLL_LINKAGE NET_IFINDEX WINAPI if_nametoindex(PCSTR); +#ifdef __cplusplus +} +#endif + #endif /* __WINE_NETIOAPI_H */ diff --git a/include/netiodef.h b/include/netiodef.h index 0d0d316b8eb..062fbc811e6 100644 --- a/include/netiodef.h +++ b/include/netiodef.h @@ -19,6 +19,10 @@ #ifndef __WINE_NETIODEF_H #define __WINE_NETIODEF_H +#ifdef __cplusplus +extern "C" { +#endif + typedef enum _NPI_MODULEID_TYPE { MIT_GUID = 1, @@ -58,15 +62,9 @@ static inline BOOLEAN NmrIsEqualNpiModuleId( const NPI_MODULEID *mod1, const NPI } #ifdef __WINE_INIT_NPI_MODULEID -#ifdef __cplusplus -#define DEFINE_NPI_GUID_MODULEID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ - EXTERN_C const NPI_MODULEID name = \ - { sizeof(NPI_MODULEID), MIT_GUID, { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } } } -#else #define DEFINE_NPI_GUID_MODULEID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ const NPI_MODULEID name = \ { sizeof(NPI_MODULEID), MIT_GUID, { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } } } } -#endif #else /* __WINE_INIT_MODULEID */ #define DEFINE_NPI_GUID_MODULEID(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \ EXTERN_C const NPI_MODULEID name @@ -84,4 +82,8 @@ DEFINE_NPI_MS_MODULEID( NPI_MS_NDIS_MODULEID, 0x11 ); #undef DEFINE_NPI_MS_MODULEID #undef DEFINE_NPI_GUID_MODULEID +#ifdef __cplusplus +} +#endif + #endif /* __WINE_NETIODEF_H */ diff --git a/include/newdev.h b/include/newdev.h index 94b8a940de5..12c293af5b3 100644 --- a/include/newdev.h +++ b/include/newdev.h @@ -21,6 +21,10 @@ #ifndef _INC_NEWDEV #define _INC_NEWDEV +#ifdef __cplusplus +extern "C" { +#endif + #include "setupapi.h" #define INSTALLFLAG_FORCE 0x1 @@ -47,4 +51,8 @@ BOOL WINAPI DiInstallDriverA(HWND parent, const char *inf_path, DWORD flags, BOO BOOL WINAPI DiInstallDriverW(HWND parent, const WCHAR *inf_path, DWORD flags, BOOL *reboot); #define DiInstallDriver WINELIB_NAME_AW(DiInstallDriver) +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/ntddcdrm.h b/include/ntddcdrm.h index 8d45b30417e..3281e8e2f6d 100644 --- a/include/ntddcdrm.h +++ b/include/ntddcdrm.h @@ -21,6 +21,10 @@ #ifndef __NTDDCDRM_H #define __NTDDCDRM_H +#ifdef __cplusplus +extern "C" { +#endif + #define IOCTL_CDROM_BASE FILE_DEVICE_CD_ROM #define IOCTL_CDROM_UNLOAD_DRIVER CTL_CODE(IOCTL_CDROM_BASE, 0x0402, METHOD_BUFFERED, FILE_READ_ACCESS) #define IOCTL_CDROM_READ_TOC CTL_CODE(IOCTL_CDROM_BASE, 0x0000, METHOD_BUFFERED, FILE_READ_ACCESS) @@ -182,4 +186,8 @@ typedef struct __RAW_READ_INFO { TRACK_MODE_TYPE TrackMode; } RAW_READ_INFO, *PRAW_READ_INFO; +#ifdef __cplusplus +} +#endif + #endif /* __NTDDCDRM_H */ diff --git a/include/rometadata.h b/include/rometadata.h index 0d528804778..da3b1ed63b7 100644 --- a/include/rometadata.h +++ b/include/rometadata.h @@ -19,6 +19,14 @@ #ifndef _ROMETADATA_H_ #define _ROMETADATA_H_ +#ifdef __cplusplus +extern "C" { +#endif + STDAPI MetaDataGetDispenser(REFCLSID rclsid, REFIID riid, VOID **obj); +#ifdef __cplusplus +} +#endif + #endif /* _ROMETADATA_H_ */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10303
From: Eric Pouech <epouech@codeweavers.com> Mainly wrapping the header inside extern "C" {...} Part 6: [s-t] range. Signed-off-by: Eric Pouech <epouech@codeweavers.com> --- include/softpub.h | 8 ++++++++ include/tdh.h | 9 +++++++++ include/tpcshrd.h | 7 +++++++ 3 files changed, 24 insertions(+) diff --git a/include/softpub.h b/include/softpub.h index ed10d8fd913..417af9b4a05 100644 --- a/include/softpub.h +++ b/include/softpub.h @@ -19,6 +19,10 @@ #ifndef __WINE_SOFTPUB_H #define __WINE_SOFTPUB_H +#ifdef __cplusplus +extern "C" { +#endif + #include <wintrust.h> #define WINTRUST_ACTION_GENERIC_CERT_VERIFY \ @@ -196,4 +200,8 @@ typedef struct DRIVER_VER_INFO_ DWORD dwBuildNumberHigh; } DRIVER_VER_INFO, *PDRIVER_VER_INFO; +#ifdef __cplusplus +} +#endif + #endif /* __WINE_SOFTPUB_H */ diff --git a/include/tdh.h b/include/tdh.h index 007ccfc7fb7..23c44e38fe5 100644 --- a/include/tdh.h +++ b/include/tdh.h @@ -19,6 +19,10 @@ #ifndef __WINE_TDH_H #define __WINE_TDH_H +#ifdef __cplusplus +extern "C" { +#endif + ULONG WINAPI TdhLoadManifest( WCHAR *manifest ); ULONG WINAPI TdhLoadManifestFromBinary( WCHAR *binary ); @@ -39,4 +43,9 @@ typedef struct _PROVIDER_ENUMERATION_INFO PROVIDER_ENUMERATION_INFO; ULONG WINAPI TdhEnumerateProviders( PROVIDER_ENUMERATION_INFO *buffer, ULONG *buffer_size ); + +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/tpcshrd.h b/include/tpcshrd.h index 8fe9d3fb8ac..809da0cd651 100644 --- a/include/tpcshrd.h +++ b/include/tpcshrd.h @@ -18,6 +18,10 @@ #ifndef __WISPSHRD_H #define __WISPSHRD_H +#ifdef __cplusplus +extern "C" { +#endif + #define TABLET_DISABLE_PRESSANDHOLD 0x00000001 #define WM_TABLET_DEFBASE 0x02c0 @@ -27,5 +31,8 @@ #define WM_TABLET_FLICK (WM_TABLET_DEFBASE + 11) #define WM_TABLET_QUERYSYSTEMGESTURESTATUS (WM_TABLET_DEFBASE + 12) +#ifdef __cplusplus +} +#endif #endif /* __WISPSHRD_H */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10303
From: Eric Pouech <epouech@codeweavers.com> Mainly wrapping the header inside extern "C" {...} Part 6: [w-] range. Signed-off-by: Eric Pouech <epouech@codeweavers.com> --- include/wiadef.h | 13 +++++++++++++ include/winber.h | 8 ++++++++ include/wincontypes.h | 8 ++++++++ include/winioctl.h | 10 +++++++++- include/winsmcrd.h | 8 ++++++++ include/wlanapi.h | 8 ++++++++ include/wofapi.h | 13 +++++++++++++ include/ws2def.h | 8 ++++++++ include/wsdutil.h | 8 ++++++++ include/wspiapi.h | 8 ++++++++ 10 files changed, 91 insertions(+), 1 deletion(-) diff --git a/include/wiadef.h b/include/wiadef.h index bd958728388..b711e4e6401 100644 --- a/include/wiadef.h +++ b/include/wiadef.h @@ -18,6 +18,13 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef _WIADEF_H_ +#define _WIADEF_H_ + +#ifdef __cplusplus +extern "C" { +#endif + #define WIA_DEVINFO_ENUM_ALL 0x0000000f #define WIA_DEVINFO_ENUM_LOCAL 0x00000010 @@ -26,3 +33,9 @@ #define BASE_VAL_WIA_ERROR 0x00000000 #define WIA_S_NO_DEVICE_AVAILABLE MAKE_HRESULT(SEVERITY_ERROR, FACILITY_WIA, (BASE_VAL_WIA_ERROR + 21)) + +#ifdef __cplusplus +} +#endif + +#endif /* _WIADEF_H_ */ diff --git a/include/winber.h b/include/winber.h index cb4f8e3ff54..450c1b4d8b1 100644 --- a/include/winber.h +++ b/include/winber.h @@ -19,6 +19,10 @@ #ifndef __WINE_WINBER_H #define __WINE_WINBER_H +#ifdef __cplusplus +extern "C" { +#endif + #define LBER_ERROR (~0L) #define LBER_DEFAULT (~0L) @@ -41,4 +45,8 @@ int WINAPIV ber_printf( BerElement *, char *, ... ); ULONG WINAPIV ber_scanf( BerElement *, char *, ... ); ULONG CDECL ber_skip_tag( BerElement *, ULONG * ); +#ifdef __cplusplus +} +#endif + #endif /* __WINE_WINBER_H */ diff --git a/include/wincontypes.h b/include/wincontypes.h index d724a80921d..5bf19337946 100644 --- a/include/wincontypes.h +++ b/include/wincontypes.h @@ -19,6 +19,10 @@ #ifndef _WINCONTYPES_ #define _WINCONTYPES_ +#ifdef __cplusplus +extern "C" { +#endif + typedef struct tagCOORD { SHORT X; @@ -132,4 +136,8 @@ typedef struct _CONSOLE_FONT_INFO typedef void *HPCON; +#ifdef __cplusplus +} +#endif + #endif /* _WINCONTYPES_ */ diff --git a/include/winioctl.h b/include/winioctl.h index 08fb307a321..119a5578647 100644 --- a/include/winioctl.h +++ b/include/winioctl.h @@ -19,7 +19,11 @@ #ifndef __WINE_WINIOCTL_H #define __WINE_WINIOCTL_H -#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ +#ifdef __cplusplus +extern "C" { +#endif + +#define CTL_CODE( DeviceType, Function, Method, Access ) ( \ (DWORD)((DeviceType) << 16) | ((Access) << 14) | ((Function) << 2) | (Method) \ ) @@ -698,4 +702,8 @@ DEFINE_GUID(GUID_DEVINTERFACE_SERENUM_BUS_ENUMERATOR, 0x4D36E978, 0xE325, #endif /* DEFINE_GUID */ +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/winsmcrd.h b/include/winsmcrd.h index 15c427c48da..0bb426d007b 100644 --- a/include/winsmcrd.h +++ b/include/winsmcrd.h @@ -19,6 +19,10 @@ #ifndef __WINE_WINSMCRD_H #define __WINE_WINSMCRD_H +#ifdef __cplusplus +extern "C" { +#endif + #define SCARD_PROTOCOL_UNDEFINED 0x00000000 #define SCARD_PROTOCOL_OPTIMAL 0x00000000 #define SCARD_PROTOCOL_T0 0x00000001 @@ -60,4 +64,8 @@ typedef struct _SCARD_IO_REQUEST } SCARD_IO_REQUEST, *PSCARD_IO_REQUEST, *LPSCARD_IO_REQUEST; typedef const SCARD_IO_REQUEST *LPCSCARD_IO_REQUEST; +#ifdef __cplusplus +} +#endif + #endif /* __WINE_WINSMCRD_H */ diff --git a/include/wlanapi.h b/include/wlanapi.h index 5150ff09f47..4bcbe51321b 100644 --- a/include/wlanapi.h +++ b/include/wlanapi.h @@ -19,6 +19,10 @@ #ifndef _WLAN_WLANAPI_H #define _WLAN_WLANAPI_H +#ifdef __cplusplus +extern "C" { +#endif + #include <windot11.h> typedef enum _WLAN_INTERFACE_STATE @@ -254,4 +258,8 @@ DWORD WINAPI WlanRegisterNotification(HANDLE, DWORD, BOOL, WLAN_NOTIFICATION_CAL DWORD WINAPI WlanGetAvailableNetworkList(HANDLE, const GUID *, DWORD, void *, WLAN_AVAILABLE_NETWORK_LIST **); DWORD WINAPI WlanQueryInterface(HANDLE, const GUID *, WLAN_INTF_OPCODE, void *, DWORD *, void **, WLAN_OPCODE_VALUE_TYPE *); +#ifdef __cplusplus +} +#endif + #endif /* _WLAN_WLANAPI_H */ diff --git a/include/wofapi.h b/include/wofapi.h index 8d678dc2d08..7de40aa2e5e 100644 --- a/include/wofapi.h +++ b/include/wofapi.h @@ -16,4 +16,17 @@ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +#ifndef _WOFAPI_H_ +#define _WOFAPI_H_ + +#ifdef __cplusplus +extern "C" { +#endif + BOOL WINAPI WofShouldCompressBinaries(const WCHAR *, ULONG *); + +#ifdef __cplusplus +} +#endif + +#endif /* _WOFAPI_H_ */ diff --git a/include/ws2def.h b/include/ws2def.h index dc3201924c1..17df6331a5b 100644 --- a/include/ws2def.h +++ b/include/ws2def.h @@ -19,6 +19,10 @@ #ifndef _WS2DEF_ #define _WS2DEF_ +#ifdef __cplusplus +extern "C" { +#endif + #include <inaddr.h> #ifdef USE_WS_PREFIX @@ -332,4 +336,8 @@ typedef struct addrinfoexW { struct addrinfoexW *ai_next; } ADDRINFOEXW, *PADDRINFOEXW, *LPADDRINFOEXW; +#ifdef __cplusplus +} +#endif + #endif /* _WS2DEF_ */ diff --git a/include/wsdutil.h b/include/wsdutil.h index b118fcf7861..00807b64acb 100644 --- a/include/wsdutil.h +++ b/include/wsdutil.h @@ -19,6 +19,10 @@ #ifndef WSDUTIL_H #define WSDUTIL_H +#ifdef __cplusplus +extern "C" { +#endif + void * WINAPI WSDAllocateLinkedMemory(void *parent, SIZE_T size) __WINE_ALLOC_SIZE(2) __WINE_MALLOC; void WINAPI WSDAttachLinkedMemory(void *pParent, void *pChild); void WINAPI WSDDetachLinkedMemory(void *pVoid); @@ -30,4 +34,8 @@ HRESULT WINAPI WSDXMLBuildAnyForSingleElement(WSDXML_NAME *pElementName, LPCWSTR HRESULT WINAPI WSDXMLCleanupElement(WSDXML_ELEMENT *pAny); HRESULT WINAPI WSDXMLGetValueFromAny(const WCHAR *pszNamespace, const WCHAR *pszName, WSDXML_ELEMENT *pAny, LPCWSTR *ppszValue); +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/wspiapi.h b/include/wspiapi.h index 7aa034e753a..32ba4d65730 100644 --- a/include/wspiapi.h +++ b/include/wspiapi.h @@ -19,8 +19,16 @@ #ifndef _WSPIAPI_H_ #define _WSPIAPI_H_ +#ifdef __cplusplus +extern "C" { +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h> +#ifdef __cplusplus +} +#endif + #endif /* _WSPIAPI_H_ */ -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10303
Jacek Caban (@jacek) commented about include/wspiapi.h:
#ifndef _WSPIAPI_H_ #define _WSPIAPI_H_
+#ifdef __cplusplus +extern "C" { +#endif + #include <stdio.h> #include <stdlib.h> #include <string.h>
+#ifdef __cplusplus +} +#endif + This block does not make sense. In general, I think extern "C" should be placed after the includes so that it does not affect the included files. If an included file needs extern "C", it should handle that itself. It also does not really make sense to use it when there are no functions in the header, as is the case in some of your changes.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10303#note_131872
participants (3)
-
Eric Pouech -
eric pouech (@epo) -
Jacek Caban (@jacek)