// // Copyright (C) Microsoft Corporation // All rights reserved. // // This file is for internal WRL usage only // #ifndef _WRL_INTERNAL_H_ #define _WRL_INTERNAL_H_ #ifdef _MSC_VER #pragma once #endif // _MSC_VER #ifndef __WRL_ASSERT__ #ifdef __WRL_CONFIGURATION_LEGACY__ // Take NT_ASSERT for windows build #include #define __WRL_ASSERT__(cond) NT_ASSERT(cond) #else // Take CRT assert as default #include #define __WRL_ASSERT__(cond) _ASSERTE(cond) #endif // BUILD_WINDOWS #endif // __WRL_ASSERT__ #ifndef __WRL_IMPLEMENTS_FTM_BASE__ #ifdef __WRL_CONFIGURATION_LEGACY__ #define __WRL_IMPLEMENTS_FTM_BASE__(flags) (false) #else #define __WRL_IMPLEMENTS_FTM_BASE__(flags) ((flags & ::Microsoft::WRL::InhibitFtmBase) == 0) #endif #endif #ifndef __WRL_CONFIGURATION_LEGACY__ #ifndef __WRL_STRICT__ //#define __WRL_STRICT__ #endif #endif // Include common headers #include // Helper types namespace Microsoft { namespace WRL { namespace Details { struct BoolStruct { int Member; }; typedef int BoolStruct::* BoolType; inline void __declspec(noreturn) RaiseException(HRESULT hr, DWORD dwExceptionFlags = EXCEPTION_NONCONTINUABLE) throw() { ::RaiseException(static_cast(hr), dwExceptionFlags, 0, NULL); #ifdef __clang__ __builtin_unreachable(); #endif } template struct IsConvertible { static const bool value = __is_convertible_to(From, To); }; template struct EnableIf { }; template struct EnableIf { typedef T type; }; template struct IsSame { static const bool value = false; }; template struct IsSame { static const bool value = true; }; template struct RemoveReference { typedef T Type; }; template struct RemoveReference { typedef T Type; }; template struct RemoveReference { typedef T Type; }; template inline typename RemoveReference::Type&& Move(_Inout_ T&& arg) throw() { return ((typename RemoveReference::Type&&)arg); } template inline void Swap(_Inout_ T& left, _Inout_ T& right) throw() { T tmp = Move(left); left = Move(right); right = Move(tmp); } // Disables template argument deduction from Forward helper template struct Identity { // Map T to type unchanged typedef T Type; }; template inline T&& Forward(typename Identity::Type& arg) throw() { // Forward arg, given explicitly specified Type parameter return (T&&)arg; } template struct IsBaseOfStrict { static const bool value = __is_base_of(Base, Derived); }; template struct IsBaseOfStrict { static const bool value = false; }; }}} // namespace Microsoft::WRL::Details #endif // _WRL_INTERNAL_H_