ManaPlus
enumdefines.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2015-2019 The ManaPlus Developers
4  * Copyright (C) 2019-2021 Andrei Karas
5  *
6  * This file is part of The ManaPlus Client.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef ENUMS_SIMPLETYPES_ENUMDEFINES_H
23 #define ENUMS_SIMPLETYPES_ENUMDEFINES_H
24 
25 #include "localconsts.h"
26 
27 #ifdef ADVGCC
28 
29 #define enumStart(name) enum class name
30 #define enumStartT(name, type) enum class name : type
31 #define enumEnd(name) ; \
32  typedef name name##T
33 
34 #else // ADVGCC
35 
36 #define enumStart(name) \
37  namespace name \
38  { \
39  enum T
40 
41 #define enumStartT(name, type) \
42  namespace name \
43  { \
44  enum T
45 
46 #define enumEnd(name) \
47  ;\
48  } \
49  typedef name::T name##T
50 
51 #endif // ADVGCC
52 
53 #define enum2Start(name) \
54  namespace name \
55  { \
56  enum T
57 
58 #define enum2End(name) \
59  ;\
60  } \
61  typedef name::T name##T
62 
63 #endif // ENUMS_SIMPLETYPES_ENUMDEFINES_H