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
14#define GALAXY_UNUSED(var) ((void)(var))
15
19#define GALAXY_AUTOARG(x) decltype(x), x
20
21#if defined(_DEBUG) || defined(DEBUG)
25#define GALAXY_DEBUG_BUILD true
26#elif defined(_NDEBUG) || defined(NDEBUG)
30#define GALAXY_DEBUG_BUILD false
31#endif
32
36#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || defined(_WIN64) || defined(_MSC_VER) || defined(SDL_PLATFORM_WINDOWS) || \
37 defined(SDL_PLATFORM_WIN32)
38#define GALAXY_WIN_PLATFORM
39#endif
40
44#if defined(__linux__) || defined(__unix) || defined(_POISX_VERSION) || defined(__GNUC__) || defined(__clang__) || defined(SDL_PLATFORM_LINUX)
45#define GALAXY_LINUX_PLATFORM
46#endif
47
48#ifdef GALAXY_WIN_PLATFORM
49#define GALAXY_PLATFORM_PUSH __pragma(warning(push))
50#define GALAXY_PLATFORM_POP __pragma(warning(pop))
51#define GALAXY_PLATFORM_WARNING(x) __pragma(warning(disable : x))
52#elif GALAXY_UNIX_PLATFORM
53#define GALAXY_PLATFORM_PUSH _Pragma("GCC diagnostic push")
54#define GALAXY_PLATFORM_POP _Pragma("GCC diagnostic pop")
55#define GALAXY_DO_PRAGMA(x) _Pragma(#x)
56#define GALAXY_PLATFORM_WARNING(x) GALAXY_DO_PRAGMA(GCC diagnostic ignored #x)
57#endif
58
59#define GALAXY_DISABLE_WARNING_PUSH GALAXY_PLATFORM_PUSH
60#define GALAXY_DISABLE_WARNING_POP GALAXY_PLATFORM_POP
61#define GALAXY_DISABLE_WARNING(x) GALAXY_PLATFORM_WARNING(x)
62
63#endif