galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
Pragma.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_PLATFORM_PRAGMA_HPP_
9#define GALAXY_PLATFORM_PRAGMA_HPP_
10
11#include <SDL3/SDL_platform.h>
12
16#define GALAXY_UNUSED(var) ((void)(var))
17
21#define GALAXY_AUTOARG(x) decltype(x), x
22
23#if defined(_DEBUG) || defined(DEBUG)
27#define GALAXY_DEBUG_BUILD true
28#elif defined(_NDEBUG) || defined(NDEBUG)
32#define GALAXY_DEBUG_BUILD false
33#endif
34
38#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(_WIN64) || defined(_MSC_VER) || defined(SDL_PLATFORM_WINDOWS) || \
39 defined(SDL_PLATFORM_WIN32)
40#define GALAXY_WIN_PLATFORM
41#endif
42
46#if defined(__linux__) || defined(__unix) || defined(_POISX_VERSION) || defined(__GNUC__) || defined(__clang__) || defined(SDL_PLATFORM_LINUX)
47#define GALAXY_LINUX_PLATFORM
48#endif
49
50#ifdef GALAXY_WIN_PLATFORM
51#define GALAXY_PLATFORM_PUSH __pragma(warning(push))
52#define GALAXY_PLATFORM_POP __pragma(warning(pop))
53#define GALAXY_PLATFORM_WARNING(x) __pragma(warning(disable : x))
54#elif GALAXY_UNIX_PLATFORM
55#define GALAXY_PLATFORM_PUSH _Pragma("GCC diagnostic push")
56#define GALAXY_PLATFORM_POP _Pragma("GCC diagnostic pop")
57#define GALAXY_DO_PRAGMA(x) _Pragma(#x)
58#define GALAXY_PLATFORM_WARNING(x) GALAXY_DO_PRAGMA(GCC diagnostic ignored #x)
59#endif
60
61#define GALAXY_DISABLE_WARNING_PUSH GALAXY_PLATFORM_PUSH
62#define GALAXY_DISABLE_WARNING_POP GALAXY_PLATFORM_POP
63#define GALAXY_DISABLE_WARNING(x) GALAXY_PLATFORM_WARNING(x)
64
65#endif