Skip to content

Commit

Permalink
Include always.h in more headers
Browse files Browse the repository at this point in the history
  • Loading branch information
xezon committed Mar 6, 2024
1 parent d9e3e41 commit 9d0b18d
Show file tree
Hide file tree
Showing 69 changed files with 111 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/game/client/drawable/update/swayclientupdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "bittype.h"
#include "clientupdatemodule.h"
#include "namekeygenerator.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/client/fxlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "namekeygenerator.h"
#include "rtsutils.h"
#include "subsysteminterface.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/client/globallanguage.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "ini.h"
#include "subsysteminterface.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/client/maputil.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "coord.h"
#include "ini.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/client/terrain/terrainroads.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "color.h"
#include "gametype.h"
#include "ini.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/client/w3dassetmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "assetmgr.h"
#include "mempoolobj.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/audio/audioeventinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "bitflags.h"
#include "ini.h"
#include "mempoolobj.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/audio/audioeventrts.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "audioeventinfo.h"
#include "coord.h"
#include "gametype.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/audio/gamesounds.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "audioeventrts.h"
#include "coord.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/bezier/bezfwditerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "beziersegment.h"

class BezFwdIterator
Expand Down
1 change: 1 addition & 0 deletions src/game/common/bezier/beziersegment.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "coord.h"
#include "matrix4.h"
#include <vector>
Expand Down
1 change: 1 addition & 0 deletions src/game/common/commandlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "gamemessagelist.h"

class CommandList : public GameMessageList
Expand Down
1 change: 1 addition & 0 deletions src/game/common/gamemessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "coord.h"
#include "gametype.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/gamemessagelist.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "gamemessage.h"
#include "subsysteminterface.h"

Expand Down
1 change: 1 addition & 0 deletions src/game/common/globaldata.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "color.h"
#include "coord.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/multiplayersettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#ifdef GAME_DLL
#include "hooker.h"
#endif
Expand Down
1 change: 1 addition & 0 deletions src/game/common/namekeygenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "bittype.h"
#include "ini.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/overridable.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "mempoolobj.h"

template<class T> class Override
Expand Down
1 change: 1 addition & 0 deletions src/game/common/randomvalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "bittype.h"

class INI;
Expand Down
1 change: 1 addition & 0 deletions src/game/common/rts/money.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "snapshot.h"

class INI;
Expand Down
1 change: 1 addition & 0 deletions src/game/common/rts/player.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "academystats.h"
#include "energy.h"
#include "handicap.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/rts/playerlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "player.h"
#include "snapshot.h"
#include "subsysteminterface.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/rts/scorekeeper.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "bitflags.h"
#include "gametype.h"
#include "snapshot.h"
Expand Down
2 changes: 2 additions & 0 deletions src/game/common/system/disabledtypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
#pragma once

#include "always.h"

template<int> class BitFlags;

enum DisabledType
Expand Down
1 change: 1 addition & 0 deletions src/game/common/system/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "gamememory.h"
#include "mempoolobj.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/system/filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "file.h"
#include "rtsutils.h"
#include "subsysteminterface.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/system/functionlexicon.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "gamewindow.h"
#include "namekeygenerator.h"
#include "subsysteminterface.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/system/localfilesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "rtsutils.h"
#include "subsysteminterface.h"
#include <set>
Expand Down
1 change: 1 addition & 0 deletions src/game/common/system/memblob.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "memblock.h"
#include "rawalloc.h"

Expand Down
36 changes: 29 additions & 7 deletions src/game/common/system/mempoolobj.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "errorcodes.h"
#include "mempool.h"
#include "mempoolfact.h"
Expand Down Expand Up @@ -47,14 +48,20 @@ class MemoryPoolObject
#ifdef __SANITIZE_ADDRESS__
#define IMPLEMENT_NAMED_POOL(classname, poolname) \
private: \
virtual MemoryPool *Get_Object_Pool() override { return nullptr; } \
virtual MemoryPool *Get_Object_Pool() override \
{ \
return nullptr; \
} \
\
public: \
enum classname##MagicEnum{ classname##_GLUE_NOT_IMPLEMENTED = 0 };

#define IMPLEMENT_ABSTRACT_POOL(classname) \
protected: \
virtual MemoryPool *Get_Object_Pool() override { throw CODE_01; } \
virtual MemoryPool *Get_Object_Pool() override \
{ \
throw CODE_01; \
} \
\
private:
#else
Expand All @@ -79,26 +86,38 @@ private: \
The##classname##Pool->Get_Alloc_Size()); \
return The##classname##Pool; \
} \
virtual MemoryPool *Get_Object_Pool() override { return Get_Class_Pool(); } \
virtual MemoryPool *Get_Object_Pool() override \
{ \
return Get_Class_Pool(); \
} \
\
public: \
enum classname##MagicEnum{ classname##_GLUE_NOT_IMPLEMENTED = 0 }; \
\
void *operator new(size_t size) { return operator new(size, classname##_GLUE_NOT_IMPLEMENTED); } \
void *operator new(size_t size) \
{ \
return operator new(size, classname##_GLUE_NOT_IMPLEMENTED); \
} \
void *operator new(size_t size, classname##MagicEnum) \
{ \
captainslog_dbgassert(size == sizeof(classname), \
"The wrong operator new is being called; ensure all objects in the hierarchy have MemoryPoolGlue set up " \
"correctly"); \
return Get_Class_Pool()->Allocate_Block(); \
} \
void operator delete(void *ptr) { operator delete(ptr, classname##_GLUE_NOT_IMPLEMENTED); } \
void operator delete(void *ptr) \
{ \
operator delete(ptr, classname##_GLUE_NOT_IMPLEMENTED); \
} \
void operator delete(void *ptr, classname##MagicEnum) \
{ \
captainslog_dbgassert(0, "Please call Delete_Instance instead of delete."); \
Get_Class_Pool()->Free_Block(ptr); \
} \
void *operator new(size_t size, void *where) { return where; } \
void *operator new(size_t size, void *where) \
{ \
return where; \
} \
void operator delete(void *ptr, void *where) {}

/* NOTE: Operator delete above must exist because of the pairing operator new. However, it should never be called directly.
Expand All @@ -108,7 +127,10 @@ public: \
*/
#define IMPLEMENT_ABSTRACT_POOL(classname) \
protected: \
virtual MemoryPool *Get_Object_Pool() override { throw CODE_01; } \
virtual MemoryPool *Get_Object_Pool() override \
{ \
throw CODE_01; \
} \
void *operator new(size_t size) = delete; \
void operator delete(void *ptr) \
{ \
Expand Down
1 change: 1 addition & 0 deletions src/game/common/system/savegame/gamestate.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "snapshot.h"
#include "subsysteminterface.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/system/streamingarchivefile.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "gamememory.h"
#include "ramfile.h"

Expand Down
1 change: 1 addition & 0 deletions src/game/common/system/subsysteminterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include <vector>

Expand Down
1 change: 1 addition & 0 deletions src/game/common/system/xfer.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "gametype.h"
#include "kindof.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/common/system/xfercrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "xfer.h"

class XferCRC : public Xfer
Expand Down
1 change: 1 addition & 0 deletions src/game/common/userpreferences.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include <map>

Expand Down
2 changes: 2 additions & 0 deletions src/game/crashwrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
#pragma once

#include "always.h"

class CrashPreferences;

class CrashPrefWrapper
Expand Down
2 changes: 2 additions & 0 deletions src/game/logic/map/terrainlogic.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
* LICENSE
*/
#pragma once

#include "always.h"
#include "asciistring.h"
#include "coord.h"
#include "gametype.h"
Expand Down
1 change: 1 addition & 0 deletions src/game/logic/object/objectcreationlist.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
#pragma once

#include "always.h"
#include "mempoolobj.h"
#include "namekeygenerator.h"
#include "subsysteminterface.h"
Expand Down
Loading

0 comments on commit 9d0b18d

Please sign in to comment.