TrueReality
v0.1.1912
WarningUtils.h
Go to the documentation of this file.
1
/*
2
* True Reality Open Source Game and Simulation Engine
3
* Copyright © 2021 Acid Rain Studios LLC
4
*
5
* The Base of this class has been adopted from the Delta3D engine
6
*
7
* This library is free software; you can redistribute it and/or modify it under
8
* the terms of the GNU Lesser General Public License as published by the Free
9
* Software Foundation; either version 3.0 of the License, or (at your option)
10
* any later version.
11
*
12
* This library is distributed in the hope that it will be useful, but WITHOUT
13
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
14
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
15
* details.
16
*
17
* You should have received a copy of the GNU Lesser General Public License
18
* along with this library; if not, write to the Free Software Foundation, Inc.,
19
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
*
21
* Class Inspired by the Delta3D Engine
22
* http://delta3dengine.org/
23
*
24
* @author David Guthrie
25
*/
26
#pragma once
27
28
namespace
trUtil
29
{
30
#if defined(_MSC_VER) && _MSC_VER >= 1600
31
# define TR_DISABLE_WARNING_START_CLANG(...) \
32
__pragma(warning(push))
33
# define TR_DISABLE_WARNING_START_MSVC(...) \
34
__pragma(warning(push)) \
35
__pragma(warning(disable:__VA_ARGS__))
36
# define TR_DISABLE_WARNING_ALL_START \
37
__pragma(warning(push, 0))
38
# define TR_DISABLE_WARNING_END \
39
__pragma(warning(pop))
40
__pragma(warning(disable:4251))
41
42
#elif defined __clang__
43
# define _STR_(X) #X
44
// Because MSVC warning codes
45
# define TR_DISABLE_WARNING_START_MSVC(...) \
46
_Pragma("clang diagnostic push")
47
# define TR_DISABLE_WARNING_START_CLANG(...) \
48
_Pragma("clang diagnostic push")\
49
_Pragma(_STR_(GCC diagnostic ignored __VA_ARGS__))
50
# define TR_DISABLE_WARNING_ALL_START \
51
_Pragma("clang diagnostic push") \
52
_Pragma("GCC diagnostic ignored \"-Wall\"") \
53
_Pragma("GCC diagnostic ignored \"-Wignored-qualifiers\"")
54
# define TR_DISABLE_WARNING_END \
55
_Pragma("clang diagnostic pop")
56
57
// warning is triggered on things that are not a problem.
58
#pragma GCC diagnostic ignored "-Woverloaded-virtual"
59
#pragma GCC diagnostic ignored "-Wunused-parameter"
60
#pragma GCC diagnostic ignored "-Wdeprecated-register"
61
#else
62
# define TR_DISABLE_WARNING_START_MSVC(...)
63
# define TR_DISABLE_WARNING_START_CLANG(...)
64
# define TR_DISABLE_WARNING_ALL_START
65
# define TR_DISABLE_WARNING_END
66
#endif
67
}
trUtil
Namespace that holds various utility classes for the engine.
Definition:
SmrtPtr.h:208
include
trUtil
WarningUtils.h
Generated by
1.8.13