aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/include/winapi/utils.hpp
blob: 8e8407cfae4593819dab4ce59dcc73b65b694631 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11






                                                                 



                    
                                                        











                                          
// Copyright (c) 2020 Egor Tensin <Egor.Tensin@gmail.com>
// This file is part of the "winapi-common" project.
// For details, see https://github.com/egor-tensin/winapi-common.
// Distributed under the MIT License.

#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