Lodestone.Common
Loading...
Searching...
No Matches
Defines.h
Go to the documentation of this file.
1//
2// Created by DexrnZacAttack on 10/14/25 using zPc-i2.
3//
4#pragma once
5#include <gtl/phmap.hpp>
6
7#ifdef __EMSCRIPTEN__
8#define LODESTONE_API
9#define NO_DISCARD __attribute__((used))
10#elif defined(LODESTONE_EXPORTS)
11#if defined(__GNUC__) || defined(__clang__)
12#define NO_DISCARD __attribute__((used))
13#define LODESTONE_API __attribute__((visibility("default")))
14#else
15#define NO_DISCARD __declspec(noinline)
16#define LODESTONE_API __declspec(dllexport)
17#endif
18#else
19#if defined(__GNUC__) || defined(__clang__)
20#define NO_DISCARD __attribute__((used))
21#define LODESTONE_API __attribute__((visibility("default")))
22#else
23#define NO_DISCARD __declspec(noinline)
24#define LODESTONE_API __declspec(dllimport)
25#endif
26#endif
27
28#if defined(_MSC_VER)
29#define TO_SECTION(n) __pragma(section(n, read)) __declspec(allocate(n))
30#elif defined(__GNUC__) || defined(__clang__)
31#define TO_SECTION(n) __attribute__((section(n)))
32#endif
33
34// you're telling me they couldn't have come up with some neat way to cast
35// between unique_ptr types?
36#define CAST_UNIQUE_PTR(to, var) \
37 std::unique_ptr<to>(static_cast<to *>(var.release()));
38
39typedef long signed int signed_size_t;
40
41template <typename... T>
42#ifdef CMAKE_BUILD_DEBUG
43using map_t = std::unordered_map<T...>; // so we can inspect in debugger
44#else
45using map_t = gtl::flat_hash_map<T...>;
46#endif
long signed int signed_size_t
Definition Defines.h:39
gtl::flat_hash_map< T... > map_t
Definition Defines.h:45