Skip to content

Commit

Permalink
Fix syscall argument expansion on 64-bit
Browse files Browse the repository at this point in the history
Every argument needs to be cast to intptr_t to ensure the memory is correctly aligned for va_arg as it reads everything as intptr_t to support both x86 and x64 correctly.

Merge from ETe etfdevs/ETe@191fd55
  • Loading branch information
ensiform committed Sep 4, 2024
1 parent 17f7907 commit 49ce8a4
Show file tree
Hide file tree
Showing 11 changed files with 501 additions and 1,171 deletions.
36 changes: 31 additions & 5 deletions code/api/et/cg_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ functions imported from the main executable
#define CGAME_IMPORT_API_VERSION 3

typedef enum {
CG_PRINT,
CG_PRINT = 0,
CG_ERROR,
CG_MILLISECONDS,
CG_CVAR_REGISTER,
Expand Down Expand Up @@ -230,7 +230,7 @@ typedef enum {
CG_STOPCAMERA,
CG_GETCAMERAINFO,

CG_MEMSET = 150,
/*CG_MEMSET = 150,
CG_MEMCPY,
CG_STRNCPY,
CG_SIN,
Expand All @@ -242,9 +242,9 @@ typedef enum {
CG_TESTPRINTINT,
CG_TESTPRINTFLOAT,
CG_ACOS,
CG_ACOS,*/

CG_INGAME_POPUP, //----(SA) added
CG_INGAME_POPUP = 162, //----(SA) added

// NERVE - SMF
CG_INGAME_CLOSEPOPUP,
Expand All @@ -264,6 +264,25 @@ typedef enum {
CG_GETHUNKDATA,

CG_PUMPEVENTLOOP,

// zinx
CG_SENDMESSAGE,
CG_MESSAGESTATUS,
// -zinx

// bani
CG_R_LOADDYNAMICSHADER,
// -bani

// fretn
CG_R_RENDERTOTEXTURE,
// -fretn
// bani
CG_R_GETTEXTUREID,
// -bani
// bani
CG_R_FINISH,
// -bani
} cgameImport_t;


Expand All @@ -276,7 +295,7 @@ functions exported to the main executable
*/

typedef enum {
CG_INIT,
CG_INIT = 0,
// void CG_Init( int serverMessageNum, int serverCommandSequence )
// called when the level loads or when the renderer is restarted
// all media should be registered at this time
Expand Down Expand Up @@ -322,6 +341,13 @@ typedef enum {

CG_WANTSBINDKEYS,

// zinx
CG_MESSAGERECEIVED,
// void (*CG_MessageReceived)( const char *buf, int buflen, int serverTime );
// -zinx

CG_EXPORT_LAST,

} cgameExport_t;

//----------------------------------------------
Expand Down
Loading

0 comments on commit 49ce8a4

Please sign in to comment.