From ea4f7f05994cfe61752581340643a49c4f06c87f Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Tue, 23 Apr 2013 01:56:28 +1000 Subject: [PATCH] turn off c++ symbol mangling for GetGameAPI/vmMain/dllEntry --- code/cgame/cg_main.cpp | 2 ++ code/cgame/cg_syscalls.cpp | 2 ++ code/game/g_main.cpp | 2 ++ code/ui/ui_syscalls.cpp | 2 ++ 4 files changed, 8 insertions(+) diff --git a/code/cgame/cg_main.cpp b/code/cgame/cg_main.cpp index f5680eb..fcff295 100644 --- a/code/cgame/cg_main.cpp +++ b/code/cgame/cg_main.cpp @@ -92,6 +92,7 @@ This is the only way control passes into the cgame module. This must be the very first function compiled into the .q3vm file ================ */ +extern "C" { int vmMain( int command, int arg0, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7 ) { centity_t *cent; @@ -175,6 +176,7 @@ Ghoul2 Insert End } return -1; } +} // extern "C" /* Ghoul2 Insert Start diff --git a/code/cgame/cg_syscalls.cpp b/code/cgame/cg_syscalls.cpp index b02d47b..f46895f 100644 --- a/code/cgame/cg_syscalls.cpp +++ b/code/cgame/cg_syscalls.cpp @@ -27,6 +27,7 @@ extern void CG_PreInit(); static int (*qsyscall)( int arg, ... ) = (int (*)( int, ...))-1; +extern "C" { #ifdef _XBOX void cg_dllEntry( int (*syscallptr)( int arg,... ) ) { #else @@ -35,6 +36,7 @@ void dllEntry( int (*syscallptr)( int arg,... ) ) { qsyscall = syscallptr; CG_PreInit(); } +} // extern "C" inline int PASSFLOAT( float x ) { diff --git a/code/game/g_main.cpp b/code/game/g_main.cpp index e5af836..50ccfc6 100644 --- a/code/game/g_main.cpp +++ b/code/game/g_main.cpp @@ -872,6 +872,7 @@ and global variables ================= */ extern int PM_ValidateAnimRange( const int startFrame, const int endFrame, const float animSpeed ); +extern "C" { game_export_t *GetGameAPI( game_import_t *import ) { gameinfo_import_t gameinfo_import; @@ -915,6 +916,7 @@ game_export_t *GetGameAPI( game_import_t *import ) { return &globals; } +} // extern "C" void QDECL G_Error( const char *fmt, ... ) { va_list argptr; diff --git a/code/ui/ui_syscalls.cpp b/code/ui/ui_syscalls.cpp index 05e315f..42ce111 100644 --- a/code/ui/ui_syscalls.cpp +++ b/code/ui/ui_syscalls.cpp @@ -15,10 +15,12 @@ static int (*qsyscall)( int arg, ... ) = (int (*)( int, ...))-1; +extern "C" { void dllEntry( int (*syscallptr)( int arg,... ) ) { qsyscall = syscallptr; // CG_PreInit(); } +} // extern "C" inline int PASSFLOAT( float x ) {