use variadic arguments in DEFINE_GUID also for MSVC (#374)
The fix for DEFINE_GUID that was recently added in pa_win_wdmks.c is also needed for the MSVC compiler. Latest versions of the compiler support the /Zc:preprocessor option which is conforming to C99 and later standards https://docs.microsoft.com/en-us/cpp/build/reference/zc-preprocessor?view=msvc-160 so it generates the exact same error as Clang (too many arguments error). Co-authored-by: John Melas <john@jmelas.gr>
This commit is contained in:
parent
358d153564
commit
b50bca981e
1 changed files with 2 additions and 2 deletions
|
|
@ -163,7 +163,7 @@ Default is to use the pin category.
|
|||
#define DYNAMIC_GUID(data) {data}
|
||||
#define _NTRTL_ /* Turn off default definition of DEFINE_GUIDEX */
|
||||
#undef DEFINE_GUID
|
||||
#ifdef __clang__ /* clang-cl: avoid too many arguments error */
|
||||
#if defined(__clang__) || (defined(_MSVC_TRADITIONAL) && !_MSVC_TRADITIONAL) /* clang-cl and new msvc preprocessor: avoid too many arguments error */
|
||||
#define DEFINE_GUID(n, ...) EXTERN_C const GUID n = {__VA_ARGS__}
|
||||
#define DEFINE_GUID_THUNK(n, ...) DEFINE_GUID(n, __VA_ARGS__)
|
||||
#define DEFINE_GUIDEX(n) DEFINE_GUID_THUNK(n, STATIC_##n)
|
||||
|
|
@ -171,7 +171,7 @@ Default is to use the pin category.
|
|||
#define DEFINE_GUID(n, data) EXTERN_C const GUID n = {data}
|
||||
#define DEFINE_GUID_THUNK(n, data) DEFINE_GUID(n, data)
|
||||
#define DEFINE_GUIDEX(n) DEFINE_GUID_THUNK(n, STATIC_##n)
|
||||
#endif /* __clang__ */
|
||||
#endif /* __clang__, !_MSVC_TRADITIONAL */
|
||||
#endif
|
||||
|
||||
#include <setupapi.h>
|
||||
|
|
|
|||
Loading…
Reference in a new issue