diff options
| author | Luke Street <luke@street.dev> | 2026-02-28 13:11:00 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-28 12:11:00 -0800 |
| commit | c900a043b89786d5e594ec883d9acd92e0db6bc7 (patch) | |
| tree | 72aa155ca8fcb6d1234ccec7a527fcf02745d6ac /include | |
| parent | d017a3cd36dacdcbd6a62640a85b8715540d82e5 (diff) | |
Some GCC compilation fixes (#3114)
* Fix 6-byte multichar literals
* Add `struct` to `e_ga_class::ga_s`
* Fix remaining wrong forward declares (struct/class)
* Replace `#include <string>` with `#include <cstring>`
* Guard FLT_EPSILON define to prevent redefinition
* Add missing `#include <cstring>` for direct cstring function usage
Diffstat (limited to 'include')
33 files changed, 36 insertions, 21 deletions
diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h index bed19cd693..6c5f371b1d 100644 --- a/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h +++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory.h @@ -84,7 +84,7 @@ struct J3DDisplayListInit { }; // size 8 struct J3DTexCoord2Info; -struct J3DCurrentMtxInfo; +class J3DCurrentMtxInfo; /** * @ingroup jsystem-j3d diff --git a/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h b/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h index af166e1b13..e59d158959 100644 --- a/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h +++ b/include/JSystem/J3DGraphLoader/J3DMaterialFactory_v21.h @@ -7,7 +7,7 @@ class J3DMaterial; struct J3DTexCoord2Info; -struct J3DCurrentMtxInfo; +class J3DCurrentMtxInfo; /** * @ingroup jsystem-j3d diff --git a/include/JSystem/J3DGraphLoader/J3DModelLoader.h b/include/JSystem/J3DGraphLoader/J3DModelLoader.h index a06260f3dc..e2569cee19 100644 --- a/include/JSystem/J3DGraphLoader/J3DModelLoader.h +++ b/include/JSystem/J3DGraphLoader/J3DModelLoader.h @@ -6,7 +6,7 @@ class J3DModelData; class J3DMaterialTable; -class J3DModelHierarchy; +struct J3DModelHierarchy; /** * @ingroup jsystem-j3d diff --git a/include/JSystem/JAudio2/JAISound.h b/include/JSystem/JAudio2/JAISound.h index 96e6d96d9a..5e414ade24 100644 --- a/include/JSystem/JAudio2/JAISound.h +++ b/include/JSystem/JAudio2/JAISound.h @@ -68,7 +68,7 @@ public: } id_; }; -class JASTrack; +struct JASTrack; /** * @ingroup jsystem-jaudio diff --git a/include/JSystem/JAudio2/JASChannel.h b/include/JSystem/JAudio2/JASChannel.h index 5b4a959372..8c80268d46 100644 --- a/include/JSystem/JAudio2/JASChannel.h +++ b/include/JSystem/JAudio2/JASChannel.h @@ -8,7 +8,7 @@ #include "JSystem/JAudio2/JASWaveInfo.h" #include <dolphin/os.h> -class JASDSPChannel; +struct JASDSPChannel; namespace JASDsp { struct TChannel; diff --git a/include/JSystem/JAudio2/JASCmdStack.h b/include/JSystem/JAudio2/JASCmdStack.h index c35a1146cb..2ad327362b 100644 --- a/include/JSystem/JAudio2/JASCmdStack.h +++ b/include/JSystem/JAudio2/JASCmdStack.h @@ -3,7 +3,7 @@ #include "JSystem/JSupport/JSUList.h" -class JASTrack; +struct JASTrack; /** * @ingroup jsystem-jaudio diff --git a/include/JSystem/JAudio2/JASSeqCtrl.h b/include/JSystem/JAudio2/JASSeqCtrl.h index 974f1c7065..d481192d6f 100644 --- a/include/JSystem/JAudio2/JASSeqCtrl.h +++ b/include/JSystem/JAudio2/JASSeqCtrl.h @@ -3,7 +3,7 @@ #include "JSystem/JAudio2/JASSeqReader.h" -class JASTrack; +struct JASTrack; class JASSeqParser; /** diff --git a/include/JSystem/JAudio2/JASWSParser.h b/include/JSystem/JAudio2/JASWSParser.h index 000aee0069..1dc68674cf 100644 --- a/include/JSystem/JAudio2/JASWSParser.h +++ b/include/JSystem/JAudio2/JASWSParser.h @@ -5,8 +5,8 @@ class JKRHeap; class JASWaveBank; -class JASBasicWaveBank; -class JASSimpleWaveBank; +struct JASBasicWaveBank; +struct JASSimpleWaveBank; /** * @ingroup jsystem-jaudio diff --git a/include/JSystem/JGadget/search.h b/include/JSystem/JGadget/search.h index bbc5c9ce6c..12507f3dc7 100644 --- a/include/JSystem/JGadget/search.h +++ b/include/JSystem/JGadget/search.h @@ -5,6 +5,7 @@ #include <iterator> #include <functional> #include <algorithm> +#include <cstring> namespace JGadget { namespace search { diff --git a/include/JSystem/JGadget/std-streambuf.h b/include/JSystem/JGadget/std-streambuf.h index d6bf291415..dae56d317c 100644 --- a/include/JSystem/JGadget/std-streambuf.h +++ b/include/JSystem/JGadget/std-streambuf.h @@ -2,7 +2,7 @@ #define JGADGET_STD_STREAMBUF_H #include <dolphin/types.h> -#include <string> +#include <cstring> namespace JGadget { template <typename T> diff --git a/include/JSystem/JGeometry.h b/include/JSystem/JGeometry.h index 696d2f60a4..d0e7c8c03e 100644 --- a/include/JSystem/JGeometry.h +++ b/include/JSystem/JGeometry.h @@ -7,8 +7,10 @@ #ifndef __MWERKS__ #include <limits> +#if !defined(FLT_EPSILON) #define FLT_EPSILON std::numeric_limits<float>::epsilon() #endif +#endif namespace JGeometry { diff --git a/include/SSystem/SComponent/c_m2d.h b/include/SSystem/SComponent/c_m2d.h index f6fe537a76..482dcab0e3 100644 --- a/include/SSystem/SComponent/c_m2d.h +++ b/include/SSystem/SComponent/c_m2d.h @@ -2,7 +2,7 @@ #define C_M2D_H -struct cM2dGCir; +class cM2dGCir; void cM2d_CrossCirLin(cM2dGCir&, float, float, float, float, float*, float*); diff --git a/include/d/actor/d_a_e_ga.h b/include/d/actor/d_a_e_ga.h index 1b357771c6..e690a68fc8 100644 --- a/include/d/actor/d_a_e_ga.h +++ b/include/d/actor/d_a_e_ga.h @@ -34,7 +34,7 @@ public: /* 0x0570 */ u8 prm0; /* 0x0571 */ u8 prm1; /* 0x0572 */ u8 prm2; - /* 0x0574 */ ga_s ga_s[256]; + /* 0x0574 */ struct ga_s ga_s[256]; /* 0x4D74 */ int ga_num; /* 0x4D78 */ u8 HIOInit; /* 0x4D79 */ u8 initialized; diff --git a/include/d/actor/d_a_e_pm.h b/include/d/actor/d_a_e_pm.h index 9077a4d56d..edec93c6a2 100644 --- a/include/d/actor/d_a_e_pm.h +++ b/include/d/actor/d_a_e_pm.h @@ -9,7 +9,7 @@ #include "d/d_cc_uty.h" #include "d/d_msg_flow.h" -class dPath; +struct dPath; /** * @ingroup actors-enemies diff --git a/include/d/actor/d_a_npc.h b/include/d/actor/d_a_npc.h index 205a242050..ea081165be 100644 --- a/include/d/actor/d_a_npc.h +++ b/include/d/actor/d_a_npc.h @@ -10,6 +10,7 @@ #include "d/d_msg_flow.h" #include "d/d_particle_copoly.h" #include "global.h" +#include <cstring> struct daNpc_GetParam1 { // name unknown /* 0x0 */ int fileIdx; diff --git a/include/d/actor/d_a_npc_bou.h b/include/d/actor/d_a_npc_bou.h index 9a1b460ae4..583c90ff3e 100644 --- a/include/d/actor/d_a_npc_bou.h +++ b/include/d/actor/d_a_npc_bou.h @@ -2,6 +2,7 @@ #define D_A_NPC_BOU_H #include "d/actor/d_a_npc.h" +#include <cstring> struct daNpc_Bou_HIOParam { /* 0x00 */ daNpcT_HIOParam common; diff --git a/include/d/actor/d_a_npc_cdn3.h b/include/d/actor/d_a_npc_cdn3.h index 890f362862..6a2e9d7b55 100644 --- a/include/d/actor/d_a_npc_cdn3.h +++ b/include/d/actor/d_a_npc_cdn3.h @@ -4,6 +4,7 @@ #include "d/actor/d_a_npc.h" #include "d/actor/d_a_npc_cd2.h" #include "d/actor/d_a_tag_schedule.h" +#include <cstring> /** * @ingroup actors-npcs diff --git a/include/d/actor/d_a_npc_kn.h b/include/d/actor/d_a_npc_kn.h index fe30a4769f..a14a89aefe 100644 --- a/include/d/actor/d_a_npc_kn.h +++ b/include/d/actor/d_a_npc_kn.h @@ -2,6 +2,7 @@ #define D_A_NPC_KN_H #include "d/actor/d_a_npc.h" +#include <cstring> struct daNpc_Kn_HIOParam { /* 0x00 */ daNpcT_HIOParam common; diff --git a/include/d/actor/d_a_npc_kolin.h b/include/d/actor/d_a_npc_kolin.h index 314a29541b..b6fded937b 100644 --- a/include/d/actor/d_a_npc_kolin.h +++ b/include/d/actor/d_a_npc_kolin.h @@ -2,6 +2,7 @@ #define D_A_NPC_KOLIN_H #include "d/actor/d_a_npc.h" +#include <cstring> struct daNpc_Kolin_HIOParam { /* 0x00 */ daNpcT_HIOParam common; diff --git a/include/d/actor/d_a_npc_the.h b/include/d/actor/d_a_npc_the.h index 6e9a24d42b..bc78a93925 100644 --- a/include/d/actor/d_a_npc_the.h +++ b/include/d/actor/d_a_npc_the.h @@ -2,6 +2,7 @@ #define D_A_NPC_THE_H #include "d/actor/d_a_npc4.h" +#include <cstring> struct daNpcThe_HIOParam { /* 0x00 */ daNpcF_HIOParam common; diff --git a/include/d/actor/d_a_obj_cblock.h b/include/d/actor/d_a_obj_cblock.h index 1a7119a9aa..04881776ec 100644 --- a/include/d/actor/d_a_obj_cblock.h +++ b/include/d/actor/d_a_obj_cblock.h @@ -5,7 +5,7 @@ #include "d/d_cc_d.h" #include "f_op/f_op_actor_mng.h" -class dPath; +struct dPath; /** * @ingroup actors-objects diff --git a/include/d/actor/d_a_passer_mng.h b/include/d/actor/d_a_passer_mng.h index f0ee36903f..aa2a55c00f 100644 --- a/include/d/actor/d_a_passer_mng.h +++ b/include/d/actor/d_a_passer_mng.h @@ -5,7 +5,7 @@ #include "d/d_kankyo.h" #include "f_op/f_op_actor_mng.h" -class dPath; +struct dPath; /** * @ingroup actors-unsorted diff --git a/include/d/d_bg_s_cap_poly.h b/include/d/d_bg_s_cap_poly.h index 0cda04c739..ca4a38542c 100644 --- a/include/d/d_bg_s_cap_poly.h +++ b/include/d/d_bg_s_cap_poly.h @@ -4,7 +4,7 @@ #include "d/d_bg_s_chk.h" #include "SSystem/SComponent/c_m3d_g_aab.h" -struct dBgS_CaptPoly; +class dBgS_CaptPoly; typedef void (*CaptPolyCallback)(dBgS_CaptPoly&, cBgD_Vtx_t*, u16, u16, u16, cM3dGPla*); diff --git a/include/d/d_bg_w.h b/include/d/d_bg_w.h index fa4ba70105..f7f38688f7 100644 --- a/include/d/d_bg_w.h +++ b/include/d/d_bg_w.h @@ -11,7 +11,7 @@ class cBgS_GrpPassChk; class cBgS_PolyPassChk; class fopAc_ac_c; struct cBgD_Vtx_t; -struct dBgS_CaptPoly; +class dBgS_CaptPoly; class cBgW_TriElm { public: diff --git a/include/d/d_bg_w_base.h b/include/d/d_bg_w_base.h index 0a05467820..089af244b8 100644 --- a/include/d/d_bg_w_base.h +++ b/include/d/d_bg_w_base.h @@ -11,7 +11,7 @@ class cBgS_GndChk; class cBgS_LinChk; class cBgS_ShdwDraw; class dBgS_Acch; -struct dBgS_CaptPoly; +class dBgS_CaptPoly; class dBgS_RoofChk; class dBgS_SphChk; class dBgS_SplGrpChk; diff --git a/include/d/d_bg_w_kcol.h b/include/d/d_bg_w_kcol.h index 36e2f9d970..7bb96ccbd4 100644 --- a/include/d/d_bg_w_kcol.h +++ b/include/d/d_bg_w_kcol.h @@ -9,8 +9,8 @@ class cBgS_GrpPassChk; class cBgS_PolyPassChk; -struct dBgPc; -struct dBgS_CaptPoly; +class dBgPc; +class dBgS_CaptPoly; struct KC_PrismData { /* 0x0 */ f32 height; diff --git a/include/d/d_com_inf_game.h b/include/d/d_com_inf_game.h index 25f48c5fd6..c4278cb3cb 100644 --- a/include/d/d_com_inf_game.h +++ b/include/d/d_com_inf_game.h @@ -15,6 +15,7 @@ #include "global.h" #include "m_Do/m_Do_controller_pad.h" #include "m_Do/m_Do_graphic.h" +#include <cstring> enum dComIfG_ButtonStatus { /* 0x00 */ BUTTON_STATUS_NONE, diff --git a/include/d/d_debug_camera.h b/include/d/d_debug_camera.h index d5cd7403ac..2292f46859 100644 --- a/include/d/d_debug_camera.h +++ b/include/d/d_debug_camera.h @@ -3,6 +3,7 @@ #include "d/d_camera.h" #include "JSystem/JHostIO/JORFile.h" +#include <cstring> enum dDbgCam_KeyAction { /* | */ dDbgCam_KeyAction_FIXEDFRM, diff --git a/include/d/d_map.h b/include/d/d_map.h index bbd21787ca..5718e331b2 100644 --- a/include/d/d_map.h +++ b/include/d/d_map.h @@ -3,6 +3,7 @@ #include "d/d_map_path_dmap.h" #include "JSystem/JHostIO/JORReflexible.h" +#include <cstring> struct dMap_HIO_prm_other_s { /* 0x00 */ u8 field_0x0; diff --git a/include/d/d_menu_fmap_map.h b/include/d/d_menu_fmap_map.h index b5b6f7e8d1..b77e43ba70 100644 --- a/include/d/d_menu_fmap_map.h +++ b/include/d/d_menu_fmap_map.h @@ -3,6 +3,7 @@ #include "SSystem/SComponent/c_counter.h" #include <dolphin/types.h> +#include <cstring> #include "d/d_menu_fmap.h" #include "d/d_map.h" #include "d/d_map_path.h" diff --git a/include/d/d_msg_object.h b/include/d/d_msg_object.h index ef7135f09d..2ef3f0ad69 100644 --- a/include/d/d_msg_object.h +++ b/include/d/d_msg_object.h @@ -4,6 +4,7 @@ #include "JSystem/JMessage/control.h" #include "d/d_com_inf_game.h" #include "f_op/f_op_msg.h" +#include <cstring> class COutFont_c; class J2DTextBox; diff --git a/include/d/d_name.h b/include/d/d_name.h index 16ff3414f6..0d877e6b09 100644 --- a/include/d/d_name.h +++ b/include/d/d_name.h @@ -2,6 +2,7 @@ #define D_D_NAME_H #include "d/d_select_cursor.h" +#include <cstring> class CPaneMgr; class CPaneMgrAlpha; diff --git a/include/m_Do/m_Do_hostIO.h b/include/m_Do/m_Do_hostIO.h index 4542ff4ab9..fa4eb8b1af 100644 --- a/include/m_Do/m_Do_hostIO.h +++ b/include/m_Do/m_Do_hostIO.h @@ -2,7 +2,7 @@ #define M_DO_M_DO_HOSTIO_H #include "JSystem/JHostIO/JORReflexible.h" -#include <string> +#include <cstring> class mDoHIO_child_c { public: |
