aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/winapi/utils.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--include/winapi/utils.hpp (renamed from include/winapi/workarounds.hpp)16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/winapi/workarounds.hpp b/include/winapi/utils.hpp
index a5a3607..8e8407c 100644
--- a/include/winapi/workarounds.hpp
+++ b/include/winapi/utils.hpp
@@ -5,4 +5,20 @@
#pragma once
+#include <windows.h>
+
+#include <cassert>
+
#define WINAPI_UNUSED_PARAMETER(...) (void)(__VA_ARGS__)
+
+namespace winapi {
+
+struct LocalDelete {
+ void operator()(void* ptr) const {
+ const auto ret = ::LocalFree(ptr);
+ assert(ret == NULL);
+ WINAPI_UNUSED_PARAMETER(ret);
+ }
+};
+
+} // namespace winapi