Skip to content

Commit 5b804ca

Browse files
authored
[GEN][ZH] Add underlying types to enum declarations for GCC build (#665)
1 parent 06499f0 commit 5b804ca

File tree

334 files changed

+741
-728
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

334 files changed

+741
-728
lines changed

Core/Libraries/Include/Lib/BaseTypeCore.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
#include <string.h>
3737
// TheSuperHackers @compile feliwir 07/04/2025 Adds utility macros for cross-platform compatibility
3838
#include <Utility/compat.h>
39+
#include <Utility/CppMacros.h>
3940

4041
/*
4142
** Turn off some unneeded warnings.

Dependencies/Utility/Utility/CppMacros.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,9 @@
2424
#else
2525
#define NOEXCEPT_17
2626
#endif
27+
28+
#if __cplusplus >= 201103L
29+
#define CPP_11(code) code
30+
#else
31+
#define CPP_11(code)
32+
#endif

Generals/Code/GameEngine/Include/Common/ActionManager.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
class Object;
4545
class Player;
4646
class SpecialPowerTemplate;
47-
enum SpecialPowerType;
48-
enum WeaponSlotType;
49-
enum CommandSourceType;
50-
enum CanAttackResult;
47+
enum SpecialPowerType CPP_11(: Int);
48+
enum WeaponSlotType CPP_11(: Int);
49+
enum CommandSourceType CPP_11(: Int);
50+
enum CanAttackResult CPP_11(: Int);
5151

52-
enum CanEnterType
52+
enum CanEnterType CPP_11(: Int)
5353
{
5454
CHECK_CAPACITY,
5555
DONT_CHECK_CAPACITY,

Generals/Code/GameEngine/Include/Common/AudioAffect.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,11 @@
3030
#ifndef _AUDIOAFFECT_H_
3131
#define _AUDIOAFFECT_H_
3232

33+
#include <Lib/BaseType.h>
34+
3335
// if it is set by the options panel, use the system setting parameter. Otherwise, this will be
3436
// appended to whatever the current system volume is.
35-
enum AudioAffect
37+
enum AudioAffect CPP_11(: Int)
3638
{
3739
AudioAffect_Music = 0x01,
3840
AudioAffect_Sound = 0x02,

Generals/Code/GameEngine/Include/Common/AudioEventInfo.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,15 @@
4141
struct FieldParse;
4242

4343
// USEFUL DECLARATIONS ////////////////////////////////////////////////////////////////////////////
44-
enum AudioType
44+
enum AudioType CPP_11(: Int)
4545
{
4646
AT_Music,
4747
AT_Streaming,
4848
AT_SoundEffect
4949
};
5050

5151
extern const char *theAudioPriorityNames[];
52-
enum AudioPriority
52+
enum AudioPriority CPP_11(: Int)
5353
{
5454
AP_LOWEST,
5555
AP_LOW,
@@ -59,7 +59,7 @@ enum AudioPriority
5959
};
6060

6161
extern const char *theSoundTypeNames[];
62-
enum SoundType
62+
enum SoundType CPP_11(: Int)
6363
{
6464
ST_UI = 0x0001,
6565
ST_WORLD = 0x0002,
@@ -73,7 +73,7 @@ enum SoundType
7373
};
7474

7575
extern const char *theAudioControlNames[];
76-
enum AudioControl
76+
enum AudioControl CPP_11(: Int)
7777
{
7878
AC_LOOP = 0x0001,
7979
AC_RANDOM = 0x0002,

Generals/Code/GameEngine/Include/Common/AudioEventRTS.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
// forward declarations ///////////////////////////////////////////////////////////////////////////
3939
struct AudioEventInfo;
4040

41-
enum OwnerType
41+
enum OwnerType CPP_11(: Int)
4242
{
4343
OT_Positional,
4444
OT_Drawable,
@@ -47,15 +47,15 @@ enum OwnerType
4747
OT_INVALID
4848
};
4949

50-
enum PortionToPlay
50+
enum PortionToPlay CPP_11(: Int)
5151
{
5252
PP_Attack,
5353
PP_Sound,
5454
PP_Decay,
5555
PP_Done
5656
};
5757

58-
enum AudioPriority;
58+
enum AudioPriority CPP_11(: Int);
5959

6060
// This is called AudioEventRTS because AudioEvent is a typedef in ww3d
6161
// You might want this to be memory pooled (I personally do), but it can't

Generals/Code/GameEngine/Include/Common/AudioHandleSpecialValues.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
#ifndef _AUDIOHANDLESPECIALVALUES_H_
3232
#define _AUDIOHANDLESPECIALVALUES_H_
3333

34-
enum AudioHandleSpecialValues
34+
enum AudioHandleSpecialValues CPP_11(: Int)
3535
{
3636
AHSV_Error = 0x00,
3737
AHSV_NoSound,

Generals/Code/GameEngine/Include/Common/AudioRequest.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
class AudioEventRTS;
3838

39-
enum RequestType
39+
enum RequestType CPP_11(: Int)
4040
{
4141
AR_Play,
4242
AR_Pause,

Generals/Code/GameEngine/Include/Common/BuildAssistant.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ typedef ObjectSellList::iterator ObjectSellListIterator;
7272
//-------------------------------------------------------------------------------------------------
7373
/** Return codes for queries about being able to build */
7474
//-------------------------------------------------------------------------------------------------
75-
enum CanMakeType
75+
enum CanMakeType CPP_11(: Int)
7676
{
7777
CANMAKE_OK,
7878
CANMAKE_NO_PREREQ,
@@ -86,7 +86,7 @@ enum CanMakeType
8686
//-------------------------------------------------------------------------------------------------
8787
/** Return codes for queries about legal build locations */
8888
//-------------------------------------------------------------------------------------------------
89-
enum LegalBuildCode
89+
enum LegalBuildCode CPP_11(: Int)
9090
{
9191
LBC_OK = 0,
9292
LBC_RESTRICTED_TERRAIN,

Generals/Code/GameEngine/Include/Common/DisabledTypes.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
/** Kind of flags for determining groups of things that belong together
4141
* NOTE: You *MUST* keep this in the same order as the DisabledNames[] below */
4242
//-------------------------------------------------------------------------------------------------
43-
enum DisabledType
43+
enum DisabledType CPP_11(: Int)
4444
{
4545
DISABLED_DEFAULT, //Typical disable -- like systems, things that don't need to run.
4646
DISABLED_HACKED, //This unit has been hacked

0 commit comments

Comments
 (0)