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
18#if defined(_DEBUG) || defined(DEBUG)
22#define GALAXY_DEBUG_BUILD true
23#elif defined(_NDEBUG) || defined(NDEBUG)
27#define GALAXY_DEBUG_BUILD false
28#endif
29
33#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(_WIN64) || defined(_MSC_VER) || defined(SDL_PLATFORM_WINDOWS) || \
34 defined(SDL_PLATFORM_WIN32)
35#define GALAXY_WIN_PLATFORM
36#endif
37
41#if defined(__linux__) || defined(__unix) || defined(_POISX_VERSION) || defined(__GNUC__) || defined(__clang__) || defined(SDL_PLATFORM_LINUX)
42#define GALAXY_LINUX_PLATFORM
43#endif
44
45#ifdef GALAXY_WIN_PLATFORM
46#define GALAXY_PLATFORM_PUSH __pragma(warning(push))
47#define GALAXY_PLATFORM_POP __pragma(warning(pop))
48#define GALAXY_PLATFORM_WARNING(x) __pragma(warning(disable : x))
49#elif GALAXY_UNIX_PLATFORM
50#define GALAXY_PLATFORM_PUSH _Pragma("GCC diagnostic push")
51#define GALAXY_PLATFORM_POP _Pragma("GCC diagnostic pop")
52#define GALAXY_DO_PRAGMA(x) _Pragma(#x)
53#define GALAXY_PLATFORM_WARNING(x) GALAXY_DO_PRAGMA(GCC diagnostic ignored #x)
54#endif
55
56#define GALAXY_DISABLE_WARNING_PUSH GALAXY_PLATFORM_PUSH
57#define GALAXY_DISABLE_WARNING_POP GALAXY_PLATFORM_POP
58#define GALAXY_DISABLE_WARNING(x) GALAXY_PLATFORM_WARNING(x)
59
60#endif