3#include <Foundation/Basics.h>
4#include <Foundation/Basics/Platform/Win/MinWindows.h>
5#include <Foundation/Strings/String.h>
8PL_FOUNDATION_DLL
plString plHRESULTtoString(plMinWindows::HRESULT result);
11PL_ALWAYS_INLINE
plResult plToResult(plMinWindows::HRESULT result)
13 return result >= 0 ? PL_SUCCESS : PL_FAILURE;
16#define PL_HRESULT_TO_FAILURE(code) \
19 plMinWindows::HRESULT s = (code); \
24#define PL_HRESULT_TO_FAILURE_LOG(code) \
27 plMinWindows::HRESULT s = (code); \
30 plLog::Error("Call '{0}' failed with: {1}", PL_PP_STRINGIFY(code), plHRESULTtoString(s)); \
35#define PL_HRESULT_TO_LOG(code) \
38 plMinWindows::HRESULT s = (code); \
41 plLog::Error("Call '{0}' failed with: {1}", PL_PP_STRINGIFY(code), plHRESULTtoString(s)); \
45#define PL_NO_RETURNVALUE
47#define PL_HRESULT_TO_LOG_RET(code, ret) \
50 plMinWindows::HRESULT s = (code); \
53 plLog::Error("Call '{0}' failed with: {1}", PL_PP_STRINGIFY(code), plHRESULTtoString(s)); \
58#define PL_HRESULT_TO_ASSERT(code) \
61 plMinWindows::HRESULT s = (code); \
62 PL_ASSERT_DEV(s >= 0, "Call '{0}' failed with: {1}", PL_PP_STRINGIFY(code), plHRESULTtoString(s)); \
Default enum for returning failure or success, instead of using a bool.
Definition Types.h:54