summaryrefslogtreecommitdiff
path: root/include/drm++/helper.hpp
blob: 3b6e90df7bab3be7ca12ae2f0db953edf0579ae9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* SPDX-License-Identifier: MIT */

#pragma once

#include <cstdint>
#include <functional>

namespace drm {

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using s8 = int8_t;
using s16 = int16_t;
using s32 = int32_t;
using s64 = int64_t;

template<typename T>
using ref = std::reference_wrapper<T>;

}

/* Helpful macros */
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-macros"

#define GETTER(name) [[nodiscard]] auto name() const { return m_##name; }
#define DEFAULT_OPERATORS(classname) \
    classname(const classname&) = default; \
    classname& operator=(const classname&) = default; \
    classname(classname&&) = default; \
    classname& operator=(classname&&) = default;

#pragma clang diagnostic pop