summaryrefslogtreecommitdiffhomepage
path: root/compat/prelude.hpp
blob: 595e681c282452cd3ea273bd3e02d61b4734de56 (plain)
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#pragma once

#if defined __CLION_IDE__ && __CLION_IDE__ >= 20240100 && defined __GNUG__
#define CORRADE_ASSUME(condition) __attribute__((assume(condition)))
#endif

#include "integer-types.hpp"
#include "move.hpp"
#include <type_traits>
#include <Corrade/Tags.h>
#include <Corrade/Utility/Macros.h>
#include <Corrade/Containers/Containers.h>
#include <Magnum/Magnum.h>

// todo add colors prefix thing
#define DBG_nospace (::Corrade::Utility::Debug{::Corrade::Utility::Debug::Flag::NoSpace})
#define WARN_nospace (::Corrade::Utility::Warning{::Corrade::Utility::Debug::Flag::NoSpace})
#define ERR_nospace (::Corrade::Utility::Error{::Corrade::Utility::Debug::Flag::NoSpace})

#define DBG (::Corrade::Utility::Debug{})
#define WARN (::Corrade::Utility::Warning{})
#define ERR (::Corrade::Utility::Error{})

#if defined __CLION_IDE__ || !(defined __cpp_size_t_suffix || defined _MSC_VER && _MSVC_LANG < 202004)
#ifdef _MSC_VER
#pragma system_header
#else
#pragma GCC system_header
#endif
consteval auto operator""uz(unsigned long long int x) { return ::floormat::size_t(x); }
#endif

namespace Corrade::Containers::Literals {}
namespace Corrade::Utility::Path {}
namespace Magnum::Math::Literals {}

namespace Magnum {
using Vector2uz = ::Magnum::Math::Vector2<size_t>;
using Vector3uz = ::Magnum::Math::Vector3<size_t>;
using Vector4uz = ::Magnum::Math::Vector4<size_t>;
} // namespace Magnum

namespace floormat {
    using namespace ::Magnum;
    using namespace ::Corrade::Containers;
    using namespace ::Corrade::Containers::Literals;
    using namespace ::Magnum::Math::Literals;
    using Debug [[maybe_unused]] = ::Corrade::Utility::Debug;
    using Error [[maybe_unused]] = ::Corrade::Utility::Error;
    namespace Path = Corrade::Utility::Path; // NOLINT(misc-unused-alias-decls)
    constexpr inline InPlaceInitT InPlace = InPlaceInit;
} // namespace floormat