GREM
3.12.0
Game/Rendering Engine Modules for C++
Loading...
Searching...
No Matches
include
GREM
core
attributes.hpp
Go to the documentation of this file.
1
// SPDX-FileCopyrightText: 2026 Ivar Härnqvist
2
// SPDX-License-Identifier: MIT
3
4
#ifndef GREM_CORE_ATTRIBUTES_HPP
5
#define GREM_CORE_ATTRIBUTES_HPP
6
7
#include <
GREM/build_config.hpp
>
8
9
#ifndef GREM_ALWAYS_INLINE
10
#define GREM_ALWAYS_INLINE inline
11
#elif defined(__clang__) || defined(__GNUC__)
12
#define GREM_ALWAYS_INLINE __attribute__((always_inline)) inline
13
#elif defined(_MSC_VER)
14
#define GREM_ALWAYS_INLINE __forceinline
15
#else
16
#define GREM_ALWAYS_INLINE inline
17
#endif
18
19
#ifndef GREM_NOINLINE
20
#if defined(__clang__) || defined(__GNUC__)
21
#define GREM_NOINLINE __attribute__((noinline))
22
#elif defined(_MSC_VER)
23
#define GREM_NOINLINE __declspec(noinline)
24
#else
25
#define GREM_NOINLINE
26
#endif
27
#endif
28
29
#ifndef GREM_FLATTEN
30
#if defined(__clang__) || defined(__GNUC__)
31
#define GREM_FLATTEN __attribute__((flatten))
32
#else
33
#define GREM_FLATTEN
34
#endif
35
#endif
36
37
#ifndef GREM_EXPORT
38
#if defined(_WIN32)
39
#define GREM_EXPORT __declspec(dllexport)
40
#elif defined(__clang__) || defined(__GNUC__)
41
#define GREM_EXPORT __attribute__((visibility("default")))
42
#else
43
#define GREM_EXPORT
44
#endif
45
#endif
46
47
#ifndef GREM_VECTORCALL
48
#if defined(_MSC_VER) || (defined(__clang__) && !defined(__EMSCRIPTEN__))
49
#define GREM_VECTORCALL __vectorcall
50
#else
51
#define GREM_VECTORCALL
52
#endif
53
#endif
54
55
#ifndef GREM_THREAD_LOCAL
56
#ifdef GREM_USE_MULTITHREADING
57
#define GREM_THREAD_LOCAL thread_local
58
#else
59
#define GREM_THREAD_LOCAL static
60
#endif
61
#endif
62
63
#endif
build_config.hpp
Generated by
1.15.0