From 3f97c2cedd5c21649ce1af44f438c8cbcc350858 Mon Sep 17 00:00:00 2001 From: James Urquhart Date: Mon, 9 Feb 2015 16:14:14 +0000 Subject: [PATCH] Fix building on GCC --- Engine/source/app/badWordFilter.cpp | 3 +- Engine/source/console/engineAPI.h | 59 ++++++++++--------- Engine/source/console/simEvents.h | 2 + Engine/source/console/telnetConsole.cpp | 4 +- .../source/platformSDL/menus/popupMenuSDL.cpp | 1 + 5 files changed, 40 insertions(+), 29 deletions(-) diff --git a/Engine/source/app/badWordFilter.cpp b/Engine/source/app/badWordFilter.cpp index 74675370b..7f1dd51a6 100644 --- a/Engine/source/app/badWordFilter.cpp +++ b/Engine/source/app/badWordFilter.cpp @@ -23,9 +23,10 @@ #include "core/strings/stringFunctions.h" #include "console/consoleTypes.h" +#include "console/simBase.h" +#include "console/engineAPI.h" #include "app/badWordFilter.h" #include "core/module.h" -#include "console/engineAPI.h" MODULE_BEGIN( BadWordFilter ) diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 0004c56c9..c2b940f01 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -53,6 +53,11 @@ #include "console/engineStructs.h" #endif +// Needed for the executef macros. Blame GCC. +#ifndef _SIMEVENTS_H_ +#include "console/simEvents.h" +#endif + /// @file /// Definitions for exposing engine functionality to the control layer. @@ -3146,7 +3151,7 @@ struct _EngineCallbackHelper }; -class SimConsoleThreadExecEvent; + #include "console/stringStack.h" // Internal helper for callback support in legacy console system. @@ -3199,7 +3204,7 @@ public: SimConsoleThreadExecEvent *evt = new SimConsoleThreadExecEvent(mArgc, NULL, false, &cb); evt->populateArgs(mArgv); mArgv[ 0 ].value->setStackStringValue(mCallbackName); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3229,7 +3234,7 @@ public: EngineMarshallData( a, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3259,7 +3264,7 @@ public: EngineMarshallData( a, mArgc, mArgv ); EngineMarshallData( b, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3291,7 +3296,7 @@ public: EngineMarshallData( b, mArgc, mArgv ); EngineMarshallData( c, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3325,7 +3330,7 @@ public: EngineMarshallData( c, mArgc, mArgv ); EngineMarshallData( d, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3361,7 +3366,7 @@ public: EngineMarshallData( d, mArgc, mArgv ); EngineMarshallData( e, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3399,7 +3404,7 @@ public: EngineMarshallData( e, mArgc, mArgv ); EngineMarshallData( f, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3439,7 +3444,7 @@ public: EngineMarshallData( f, mArgc, mArgv ); EngineMarshallData( g, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3481,7 +3486,7 @@ public: EngineMarshallData( g, mArgc, mArgv ); EngineMarshallData( h, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3525,7 +3530,7 @@ public: EngineMarshallData( h, mArgc, mArgv ); EngineMarshallData( i, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3571,7 +3576,7 @@ public: EngineMarshallData( i, mArgc, mArgv ); EngineMarshallData( j, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3619,7 +3624,7 @@ public: EngineMarshallData( j, mArgc, mArgv ); EngineMarshallData( k, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -3669,7 +3674,7 @@ public: EngineMarshallData( k, mArgc, mArgv ); EngineMarshallData( l, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4166,7 +4171,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn evt->populateArgs(mArgv); mArgv[ 0 ].value->setStackStringValue(mCallbackName); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } } @@ -4195,7 +4200,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( a, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4225,7 +4230,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( a, mArgc, mArgv ); EngineMarshallData( b, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4257,7 +4262,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( b, mArgc, mArgv ); EngineMarshallData( c, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4291,7 +4296,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( c, mArgc, mArgv ); EngineMarshallData( d, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4327,7 +4332,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( d, mArgc, mArgv ); EngineMarshallData( e, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4365,7 +4370,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( e, mArgc, mArgv ); EngineMarshallData( f, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4405,7 +4410,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( f, mArgc, mArgv ); EngineMarshallData( g, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4447,7 +4452,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( g, mArgc, mArgv ); EngineMarshallData( h, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4491,7 +4496,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( h, mArgc, mArgv ); EngineMarshallData( i, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4537,7 +4542,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( i, mArgc, mArgv ); EngineMarshallData( j, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4585,7 +4590,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( j, mArgc, mArgv ); EngineMarshallData( k, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } @@ -4635,7 +4640,7 @@ template<> struct _EngineConsoleExecCallbackHelper : public _BaseEn EngineMarshallData( k, mArgc, mArgv ); EngineMarshallData( l, mArgc, mArgv ); - Sim::postEvent(Sim::getRootGroup(), evt, Sim::getCurrentTime()); + Sim::postEvent((SimObject*)Sim::getRootGroup(), evt, Sim::getCurrentTime()); return R( EngineUnmarshallData< R >()( cb.waitForResult() ) ); } diff --git a/Engine/source/console/simEvents.h b/Engine/source/console/simEvents.h index c767511a0..362bdb325 100644 --- a/Engine/source/console/simEvents.h +++ b/Engine/source/console/simEvents.h @@ -119,6 +119,8 @@ public: void populateArgs(ConsoleValueRef *argv); }; + +// NOTE: SimConsoleThreadExecCallback & SimConsoleThreadExecEvent moved to engineAPI.h /// Used by Con::threadSafeExecute() struct SimConsoleThreadExecCallback { diff --git a/Engine/source/console/telnetConsole.cpp b/Engine/source/console/telnetConsole.cpp index 2a6e0258a..46e2421f4 100644 --- a/Engine/source/console/telnetConsole.cpp +++ b/Engine/source/console/telnetConsole.cpp @@ -21,9 +21,11 @@ //----------------------------------------------------------------------------- #include "platform/platform.h" + +#include "console/simBase.h" +#include "console/engineAPI.h" #include "console/telnetConsole.h" -#include "console/engineAPI.h" #include "core/strings/stringFunctions.h" #include "core/util/journal/process.h" #include "core/module.h" diff --git a/Engine/source/platformSDL/menus/popupMenuSDL.cpp b/Engine/source/platformSDL/menus/popupMenuSDL.cpp index c9d283de5..3d196e1a2 100644 --- a/Engine/source/platformSDL/menus/popupMenuSDL.cpp +++ b/Engine/source/platformSDL/menus/popupMenuSDL.cpp @@ -35,6 +35,7 @@ #include "gui/editor/guiMenuBar.h" #include "platformSDL/menus/PlatformSDLPopupMenuData.h" +#include "console/engineAPI.h" ////////////////////////////////////////////////////////////////////////// // Platform Menu Data