SA_Support
Sapphire's Suite's C++ Support library.
Loading...
Searching...
No Matches
Pragma.hpp
Go to the documentation of this file.
1// Copyright (c) 2023 Sapphire's Suite. All Rights Reserved.
2
3#pragma once
4
5#ifndef SAPPHIRE_SUPPORT_PRAGMA_GUARD
6#define SAPPHIRE_SUPPORT_PRAGMA_GUARD
7
10
27
28#if SA_GNU || (SA_CLANG && !SA_MSVC)
29
35 #define __SA_PRAGMA_PUSH _Pragma("GCC diagnostic push")
36
42 #define __SA_PRAGMA_POP _Pragma("GCC diagnostic pop")
43
52 #define __SA_PRAGMA_DISABLE_WARN(_warnName, _warnCode) _Pragma(SA_STR(GCC diagnostic ignored #_warnName))
53
54#elif SA_MSVC
55
61 #define __SA_PRAGMA_PUSH __pragma(warning(push))
62
68 #define __SA_PRAGMA_POP __pragma(warning(pop))
69
78 #define __SA_PRAGMA_DISABLE_WARN(_warnName, _warnCode) __pragma(warning(disable : _warnCode))
79
80#else
81
87 #define __SA_PRAGMA_PUSH
88
94 #define __SA_PRAGMA_POP
95
104 #define __SA_PRAGMA_DISABLE_WARN(_warnName, _warnCode)
105
106#endif
107
109
110
119#define SA_PRAGMA_SDWARN(_warnName, _warnCode)\
120 __SA_PRAGMA_PUSH\
121 __SA_PRAGMA_DISABLE_WARN(_warnName, _warnCode)
122
130#define SA_PRAGMA_EDWARN() __SA_PRAGMA_POP
131
132
133#if SA_GNU || (SA_CLANG && !SA_MSVC)
134
139 #define SA_PRAGMA_SDWARN_GNU(_warnName) SA_PRAGMA_SDWARN(_warnName, 0)
140
145 #define SA_PRAGMA_EDWARN_GNU() SA_PRAGMA_EDWARN()
146
147#else
148
153 #define SA_PRAGMA_SDWARN_GNU(_warnName)
154
159 #define SA_PRAGMA_EDWARN_GNU()
160
161#endif
162
163#if SA_MSVC && !SA_CLANG
164
166 #define SA_PRAGMA_SDWARN_MSVC(_warnCode) SA_PRAGMA_SDWARN(None, _warnCode)
167
172 #define SA_PRAGMA_EDWARN_MSVC() SA_PRAGMA_EDWARN()
173
174#else
175
177 #define SA_PRAGMA_SDWARN_MSVC(_warnCode)
178
183 #define SA_PRAGMA_EDWARN_MSVC()
184
185#endif
186
187
190#endif // GUARD
Compiler support definition file.
Stringify support definition file.