Skip to content

Commit

Permalink
fix(fxserver): more fixes for linux compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
prikolium-cfx committed Oct 10, 2024
1 parent 420a6f5 commit ec017ce
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

#include "fxScripting.h"

#include <stdexcept>

#ifndef IS_FXSERVER
#include <scrEngine.h>
#endif
Expand Down
4 changes: 2 additions & 2 deletions code/components/citizen-scripting-core/src/ScriptInvoker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ void ScriptNativeContext::Invoke(IScriptHost& host)
char* error = "Unknown";
host.GetLastErrorText(&error);

throw std::exception(va("Execution of native %016llx in script host failed: %s", nativeIdentifier, error));
throw std::runtime_error(va("Execution of native %016llx in script host failed: %s", nativeIdentifier, error));
}

PostInvoke();
Expand Down Expand Up @@ -299,7 +299,7 @@ static void InvokeNativeHandler(fxNativeContext& context, rage::scrEngine::Nativ
exceptionAddress = GetExceptionInformation()->ExceptionRecord->ExceptionAddress,
FilterFunc(GetExceptionInformation(), context.nativeIdentifier))
{
throw std::exception(va("Error executing native 0x%016llx at address %s.", context.nativeIdentifier, FormatModuleAddress(exceptionAddress)));
throw std::runtime_error(va("Error executing native 0x%016llx at address %s.", context.nativeIdentifier, FormatModuleAddress(exceptionAddress)));
}
}

Expand Down
3 changes: 2 additions & 1 deletion code/components/citizen-scripting-v8/src/V8ScriptRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <chrono>
#include <sstream>
#include <stack>
#include <stdexcept>

#include <CoreConsole.h>
#include <SharedFunction.h>
Expand Down Expand Up @@ -1494,7 +1495,7 @@ static inline void CallHandler(void* handler, uint64_t nativeIdentifier, rage::s
}
__except (exceptionAddress = (GetExceptionInformation())->ExceptionRecord->ExceptionAddress, EXCEPTION_EXECUTE_HANDLER)
{
throw std::exception(va("Error executing native 0x%016llx at address %p.", nativeIdentifier, exceptionAddress));
throw std::runtime_error(va("Error executing native 0x%016llx at address %p.", nativeIdentifier, exceptionAddress));
}
}

Expand Down
5 changes: 4 additions & 1 deletion code/components/gta-net-five/src/ClientRPC.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
#include <StdInc.h>

#include <stdexcept>

#include <ScriptEngine.h>
#include <RpcConfiguration.h>

Expand Down Expand Up @@ -56,7 +59,7 @@ static inline void CallHandler(const THandler& handler, uint64_t nativeIdentifie
}
__except (exceptionAddress = (GetExceptionInformation())->ExceptionRecord->ExceptionAddress, ShouldHandleUnwind((GetExceptionInformation())->ExceptionRecord->ExceptionCode, nativeIdentifier))
{
throw std::exception(va("Error executing native 0x%016llx at address %s.", nativeIdentifier, FormatModuleAddress(exceptionAddress)));
throw std::runtime_error(va("Error executing native 0x%016llx at address %s.", nativeIdentifier, FormatModuleAddress(exceptionAddress)));
}
}

Expand Down
5 changes: 4 additions & 1 deletion code/components/scripting-gta/src/ScriptEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
*/

#include "StdInc.h"

#include <stdexcept>

#include <ScriptEngine.h>

#include <jitasm.h>
Expand Down Expand Up @@ -64,7 +67,7 @@ static inline void CallHandler(const THandler& rageHandler, uint64_t nativeIdent
}
__except (exceptionAddress = (GetExceptionInformation())->ExceptionRecord->ExceptionAddress, ShouldHandleUnwind(GetExceptionInformation(), (GetExceptionInformation())->ExceptionRecord->ExceptionCode, nativeIdentifier))
{
throw std::exception(va("Error executing native 0x%016llx at address %s.", nativeIdentifier, FormatModuleAddress(exceptionAddress)));
throw std::runtime_error(va("Error executing native 0x%016llx at address %s.", nativeIdentifier, FormatModuleAddress(exceptionAddress)));
}
//#endif
}
Expand Down

0 comments on commit ec017ce

Please sign in to comment.