Skip to content

[GEN][ZH] Add underlying types to enum declarations for GCC build #665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions Core/Libraries/Include/Lib/BaseTypeCore.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <string.h>
// TheSuperHackers @compile feliwir 07/04/2025 Adds utility macros for cross-platform compatibility
#include <Utility/compat.h>
#include <Utility/CppMacros.h>

/*
** Turn off some unneeded warnings.
Expand Down
6 changes: 6 additions & 0 deletions Dependencies/Utility/Utility/CppMacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,9 @@
#else
#define NOEXCEPT_17
#endif

#if __cplusplus >= 201103L
#define CPP_11(code) code
#else
#define CPP_11(code)
#endif
10 changes: 5 additions & 5 deletions Generals/Code/GameEngine/Include/Common/ActionManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@
class Object;
class Player;
class SpecialPowerTemplate;
enum SpecialPowerType;
enum WeaponSlotType;
enum CommandSourceType;
enum CanAttackResult;
enum SpecialPowerType CPP_11(: Int);
enum WeaponSlotType CPP_11(: Int);
enum CommandSourceType CPP_11(: Int);
enum CanAttackResult CPP_11(: Int);

enum CanEnterType
enum CanEnterType CPP_11(: Int)
{
CHECK_CAPACITY,
DONT_CHECK_CAPACITY,
Expand Down
4 changes: 3 additions & 1 deletion Generals/Code/GameEngine/Include/Common/AudioAffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@
#ifndef _AUDIOAFFECT_H_
#define _AUDIOAFFECT_H_

#include <Lib/BaseType.h>

// if it is set by the options panel, use the system setting parameter. Otherwise, this will be
// appended to whatever the current system volume is.
enum AudioAffect
enum AudioAffect CPP_11(: Int)
{
AudioAffect_Music = 0x01,
AudioAffect_Sound = 0x02,
Expand Down
8 changes: 4 additions & 4 deletions Generals/Code/GameEngine/Include/Common/AudioEventInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@
struct FieldParse;

// USEFUL DECLARATIONS ////////////////////////////////////////////////////////////////////////////
enum AudioType
enum AudioType CPP_11(: Int)
{
AT_Music,
AT_Streaming,
AT_SoundEffect
};

extern const char *theAudioPriorityNames[];
enum AudioPriority
enum AudioPriority CPP_11(: Int)
{
AP_LOWEST,
AP_LOW,
Expand All @@ -59,7 +59,7 @@ enum AudioPriority
};

extern const char *theSoundTypeNames[];
enum SoundType
enum SoundType CPP_11(: Int)
{
ST_UI = 0x0001,
ST_WORLD = 0x0002,
Expand All @@ -73,7 +73,7 @@ enum SoundType
};

extern const char *theAudioControlNames[];
enum AudioControl
enum AudioControl CPP_11(: Int)
{
AC_LOOP = 0x0001,
AC_RANDOM = 0x0002,
Expand Down
6 changes: 3 additions & 3 deletions Generals/Code/GameEngine/Include/Common/AudioEventRTS.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
// forward declarations ///////////////////////////////////////////////////////////////////////////
struct AudioEventInfo;

enum OwnerType
enum OwnerType CPP_11(: Int)
{
OT_Positional,
OT_Drawable,
Expand All @@ -47,15 +47,15 @@ enum OwnerType
OT_INVALID
};

enum PortionToPlay
enum PortionToPlay CPP_11(: Int)
{
PP_Attack,
PP_Sound,
PP_Decay,
PP_Done
};

enum AudioPriority;
enum AudioPriority CPP_11(: Int);

// This is called AudioEventRTS because AudioEvent is a typedef in ww3d
// You might want this to be memory pooled (I personally do), but it can't
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#ifndef _AUDIOHANDLESPECIALVALUES_H_
#define _AUDIOHANDLESPECIALVALUES_H_

enum AudioHandleSpecialValues
enum AudioHandleSpecialValues CPP_11(: Int)
{
AHSV_Error = 0x00,
AHSV_NoSound,
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/Common/AudioRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

class AudioEventRTS;

enum RequestType
enum RequestType CPP_11(: Int)
{
AR_Play,
AR_Pause,
Expand Down
4 changes: 2 additions & 2 deletions Generals/Code/GameEngine/Include/Common/BuildAssistant.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ typedef ObjectSellList::iterator ObjectSellListIterator;
//-------------------------------------------------------------------------------------------------
/** Return codes for queries about being able to build */
//-------------------------------------------------------------------------------------------------
enum CanMakeType
enum CanMakeType CPP_11(: Int)
{
CANMAKE_OK,
CANMAKE_NO_PREREQ,
Expand All @@ -86,7 +86,7 @@ enum CanMakeType
//-------------------------------------------------------------------------------------------------
/** Return codes for queries about legal build locations */
//-------------------------------------------------------------------------------------------------
enum LegalBuildCode
enum LegalBuildCode CPP_11(: Int)
{
LBC_OK = 0,
LBC_RESTRICTED_TERRAIN,
Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/Common/DisabledTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
/** Kind of flags for determining groups of things that belong together
* NOTE: You *MUST* keep this in the same order as the DisabledNames[] below */
//-------------------------------------------------------------------------------------------------
enum DisabledType
enum DisabledType CPP_11(: Int)
{
DISABLED_DEFAULT, //Typical disable -- like systems, things that don't need to run.
DISABLED_HACKED, //This unit has been hacked
Expand Down
4 changes: 2 additions & 2 deletions Generals/Code/GameEngine/Include/Common/DrawModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ class TracerDrawInterface;
class RopeDrawInterface;
class LaserDrawInterface;
class FXList;
enum TerrainDecalType;
enum ShadowType;
enum TerrainDecalType CPP_11(: Int);
enum ShadowType CPP_11(: Int);

//class ModelConditionFlags;

Expand Down
2 changes: 1 addition & 1 deletion Generals/Code/GameEngine/Include/Common/Errors.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
to add to this list as necessary; however, there should generally be very
few codes needed.
*/
enum ErrorCode
enum ErrorCode CPP_11(: UnsignedInt)
{
ERROR_BASE = 0xdead0001, // a nice, distinctive value

Expand Down
4 changes: 2 additions & 2 deletions Generals/Code/GameEngine/Include/Common/GameAudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ class Object;
class SoundManager;


enum AudioAffect;
enum AudioType;
enum AudioAffect CPP_11(: Int);
enum AudioType CPP_11(: Int);

struct AudioEventInfo;
struct AudioRequest;
Expand Down
20 changes: 10 additions & 10 deletions Generals/Code/GameEngine/Include/Common/GameCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ enum
#endif

//-------------------------------------------------------------------------------------------------
enum GameDifficulty
enum GameDifficulty CPP_11(: Int)
{
DIFFICULTY_EASY,
DIFFICULTY_NORMAL,
Expand All @@ -130,7 +130,7 @@ enum GameDifficulty
};

//-------------------------------------------------------------------------------------------------
enum PlayerType
enum PlayerType CPP_11(: Int)
{
PLAYER_HUMAN, ///< player is human-controlled
PLAYER_COMPUTER, ///< player is computer-controlled
Expand All @@ -140,7 +140,7 @@ enum PlayerType

//-------------------------------------------------------------------------------------------------
/// A PartitionCell can be one of three states for Shroud
enum CellShroudStatus
enum CellShroudStatus CPP_11(: Int)
{
CELLSHROUD_CLEAR,
CELLSHROUD_FOGGED,
Expand All @@ -151,7 +151,7 @@ enum CellShroudStatus

//-------------------------------------------------------------------------------------------------
/// Since an object can take up more than a single PartitionCell, this is a status that applies to the whole Object
enum ObjectShroudStatus
enum ObjectShroudStatus CPP_11(: Int)
{
OBJECTSHROUD_INVALID, ///< indeterminate state, will recompute
OBJECTSHROUD_CLEAR, ///< object is not shrouded at all (ie, completely visible)
Expand All @@ -164,7 +164,7 @@ enum ObjectShroudStatus
};

//-------------------------------------------------------------------------------------------------
enum GuardMode
enum GuardMode CPP_11(: Int)
{
GUARDMODE_NORMAL,
GUARDMODE_GUARD_WITHOUT_PURSUIT, // no pursuit out of guard area
Expand All @@ -185,7 +185,7 @@ enum

/// Veterancy level define needed by several files that don't need the full Experience code.
// NOTE NOTE NOTE: Keep TheVeterencyNames in sync with these.
enum VeterancyLevel
enum VeterancyLevel CPP_11(: Int)
{
LEVEL_REGULAR = 0,
LEVEL_VETERAN,
Expand All @@ -204,7 +204,7 @@ extern const char *TheVeterancyNames[];

//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
enum CommandSourceType
enum CommandSourceType CPP_11(: Int)
{

CMD_FROM_PLAYER = 0,
Expand All @@ -215,7 +215,7 @@ enum CommandSourceType
}; ///< the source of a command

//-------------------------------------------------------------------------------------------------
enum AbleToAttackType
enum AbleToAttackType CPP_11(: Int)
{
_ATTACK_FORCED = 0x01,
_ATTACK_CONTINUED = 0x02,
Expand Down Expand Up @@ -453,7 +453,7 @@ class DLINK_ITERATOR

// ------------------------------------------------------------------------

enum WhichTurretType
enum WhichTurretType CPP_11(: Int)
{
TURRET_INVALID = -1,

Expand All @@ -476,7 +476,7 @@ inline Real stdAngleDiff(Real a1, Real a2)

// ------------------------------------------------------------------------
// NOTE NOTE NOTE: Keep TheRelationShipNames in sync with this enum
enum Relationship
enum Relationship CPP_11(: Int)
{
ENEMIES = 0,
NEUTRAL,
Expand Down
10 changes: 5 additions & 5 deletions Generals/Code/GameEngine/Include/Common/GameLOD.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
#ifndef _GAME_LOD_H_
#define _GAME_LOD_H_

enum ParticlePriorityType;
enum ParticlePriorityType CPP_11(: Int);

#define MAX_LOD_PRESETS_PER_LEVEL 32 //number of hardware configs preset for each low,medium,high
#define MAX_BENCH_PROFILES 16

//Make sure this enum stays in sync with GameLODNames[]
enum StaticGameLODLevel
enum StaticGameLODLevel CPP_11(: Int)
{
STATIC_GAME_LOD_UNKNOWN=-1,
STATIC_GAME_LOD_LOW,
Expand All @@ -52,7 +52,7 @@ enum StaticGameLODLevel
STATIC_GAME_LOD_COUNT
};

enum DynamicGameLODLevel
enum DynamicGameLODLevel CPP_11(: Int)
{
DYNAMIC_GAME_LOD_UNKNOWN=-1,
DYNAMIC_GAME_LOD_LOW,
Expand All @@ -63,7 +63,7 @@ enum DynamicGameLODLevel
};

//Make sure this stays in sync with CPUNames[] in gamelod.cpp
enum CpuType
enum CpuType CPP_11(: Int)
{
XX, //unknown type
P3,
Expand All @@ -72,7 +72,7 @@ enum CpuType
};

//Keep this in sync with VideoNames in Gamelod.cpp
enum ChipsetType
enum ChipsetType CPP_11(: Int)
{ DC_UNKNOWN,
DC_VOODOO2,
DC_VOODOO3,
Expand Down
8 changes: 4 additions & 4 deletions Generals/Code/GameEngine/Include/Common/GameState.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ typedef void (*IterateSaveFileCallback)( AsciiString filename, void *userData );
* save/load menu initialization you can make that menu allow loading only, or allow
* both saving and loading from the same menu */
// ------------------------------------------------------------------------------------------------
enum SaveLoadLayoutType
enum SaveLoadLayoutType CPP_11(: Int)
{
SLLT_INVALID = 0,
SLLT_SAVE_AND_LOAD,
Expand Down Expand Up @@ -82,7 +82,7 @@ struct SaveDate

// ------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------
enum SaveFileType
enum SaveFileType CPP_11(: Int)
{
SAVE_FILE_TYPE_NORMAL, ///< a regular save game at any arbitrary point in the game
SAVE_FILE_TYPE_MISSION, ///< a save game in between missions (a mission save)
Expand Down Expand Up @@ -126,7 +126,7 @@ struct AvailableGameInfo

// ------------------------------------------------------------------------------------------------
// ------------------------------------------------------------------------------------------------
enum SaveCode
enum SaveCode CPP_11(: Int)
{
SC_INVALID = -1,
SC_OK,
Expand All @@ -139,7 +139,7 @@ enum SaveCode
SC_ERROR,
};

enum SnapshotType {
enum SnapshotType CPP_11(: Int) {
SNAPSHOT_SAVELOAD,
SNAPSHOT_DEEPCRC_LOGICONLY,
SNAPSHOT_DEEPCRC,
Expand Down
Loading