From b50bca981ebe3616dbbb1ed97b4f0fe528c6e91c Mon Sep 17 00:00:00 2001 From: John Melas Date: Thu, 28 Jan 2021 03:29:24 +0200 Subject: [PATCH] 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 --- src/hostapi/wdmks/pa_win_wdmks.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hostapi/wdmks/pa_win_wdmks.c b/src/hostapi/wdmks/pa_win_wdmks.c index 7224e13..a5e25ad 100644 --- a/src/hostapi/wdmks/pa_win_wdmks.c +++ b/src/hostapi/wdmks/pa_win_wdmks.c @@ -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 -- 2.43.0