diff --git a/nui/src/nui/backend/window.cpp b/nui/src/nui/backend/window.cpp index 65ba76d4..e97dceac 100644 --- a/nui/src/nui/backend/window.cpp +++ b/nui/src/nui/backend/window.cpp @@ -25,6 +25,10 @@ # include # include #elif defined(_WIN32) +# if defined(_MSC_VER) && defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wlanguage-extension-token" +# endif #endif #include @@ -94,7 +98,9 @@ namespace Nui # include "mac_webview_config_from_window_options.ipp" #elif defined(_WIN32) # include +#ifndef _MSC_VER # include +#endif # include # include "environment_options_from_window_options.ipp" constexpr static auto wakeUpMessage = WM_APP + 1; @@ -687,4 +693,8 @@ namespace Nui return impl_->pool.executor(); } // ##################################################################################################################### -} \ No newline at end of file +} + +#if defined(_MSC_VER) && defined(__clang__) +# pragma clang diagnostic pop +#endif \ No newline at end of file diff --git a/nui/windows/weakreference.h b/nui/windows/weakreference.h index 6b6789a1..04fcce44 100644 --- a/nui/windows/weakreference.h +++ b/nui/windows/weakreference.h @@ -29,8 +29,11 @@ #ifndef __weakreference_h__ #define __weakreference_h__ -#if defined(_MSC_VER) && (_MSC_VER >= 1020) -# pragma once +#pragma once + +#if defined(_MSC_VER) && defined(__clang__) +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wlanguage-extension-token" #endif /* Forward Declarations */ @@ -81,6 +84,8 @@ extern "C" { /* [in] */ __RPC__in REFIID riid, /* [iid_is][out] */ __RPC__deref_out IInspectable * *objectReference) = 0; + virtual ~IWeakReference() = default; + template _At_(*objectReference, _When_(FAILED(return), _Null_)) _At_(*objectReference, _When_(SUCCEEDED(return), _Maybenull_)) HRESULT @@ -89,7 +94,7 @@ extern "C" { static_assert( __is_base_of(IInspectable, T), "Only Windows Runtime interfaces can be resolved by weak reference"); return Resolve(__uuidof(T), (IInspectable**)objectReference); - } + } }; } // extern C++ # else @@ -238,4 +243,8 @@ extern "C" { } #endif +#if defined(_MSC_VER) && defined(__clang__) +# pragma clang diagnostic pop +#endif + #endif \ No newline at end of file diff --git a/nui/windows/wrl/client.h b/nui/windows/wrl/client.h index c7aa5f95..8cfcdd77 100644 --- a/nui/windows/wrl/client.h +++ b/nui/windows/wrl/client.h @@ -7,6 +7,13 @@ #ifndef _WRL_CLIENT_H_ #define _WRL_CLIENT_H_ +#pragma once + +#if defined(_MSC_VER) && defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wlanguage-extension-token" +#endif + #include #include #include @@ -380,4 +387,9 @@ namespace ABI } } +#if defined(_MSC_VER) && defined(__clang__) +# pragma clang diagnostic pop +#endif + + #endif diff --git a/nui/windows/wrl/implements.h b/nui/windows/wrl/implements.h index 86c7afa8..14bd57eb 100644 --- a/nui/windows/wrl/implements.h +++ b/nui/windows/wrl/implements.h @@ -71,9 +71,7 @@ namespace Microsoft template struct CloakedIid : T { -#ifndef _MSC_VER virtual ~CloakedIid() = default; -#endif }; enum RuntimeClassType @@ -212,11 +210,10 @@ namespace Microsoft reinterpret_cast(&module_), this, nullptr) == nullptr && "The module was already instantiated"); - SRWLOCK initSRWLOCK = SRWLOCK_INIT; + [[maybe_unused]] SRWLOCK initSRWLOCK = SRWLOCK_INIT; __WRL_ASSERT__( reinterpret_cast(&moduleLock_)->Ptr == initSRWLOCK.Ptr && "Different value for moduleLock_ than SRWLOCK_INIT"); - (initSRWLOCK); #else module_ = this; #endif @@ -923,9 +920,7 @@ namespace Microsoft riid, ppv, pRefDelegated); } -#ifndef _MSC_VER virtual ~ImplementsHelper() = default; -#endif IUnknown* CastToUnknown() throw() { diff --git a/nui/windows/wrl/patch.h b/nui/windows/wrl/patch.h index 02239ea2..3a53ef2d 100644 --- a/nui/windows/wrl/patch.h +++ b/nui/windows/wrl/patch.h @@ -1,3 +1,5 @@ #pragma once -constexpr auto JSCRIPT_E_CANTEXECUTE = 0x89020001; \ No newline at end of file +#ifndef JSCRIPT_E_CANTEXECUTE +constexpr auto JSCRIPT_E_CANTEXECUTE = 0x89020001; +#endif \ No newline at end of file