Fix globals_store and globals_restore

This commit is contained in:
8dcc 2023-07-22 15:48:01 +02:00
parent 24c1d796d9
commit 4913d4802c
1 changed files with 5 additions and 6 deletions

View File

@ -1,5 +1,6 @@
#include <stdio.h> #include <stdio.h>
#include <string.h>
#include <dlfcn.h> #include <dlfcn.h>
#include "include/globals.h" #include "include/globals.h"
@ -43,13 +44,11 @@ bool globals_init(void) {
} }
void globals_store(void) { void globals_store(void) {
o_engine = *i_engine; memcpy(&o_engine, i_engine, sizeof(cl_enginefunc_t));
o_client = *i_client; memcpy(&o_client, i_client, sizeof(cl_clientfunc_t));
o_pmove = *i_pmove;
} }
void globals_restore(void) { void globals_restore(void) {
*i_engine = o_engine; memcpy(i_engine, &o_engine, sizeof(cl_enginefunc_t));
*i_client = o_client; memcpy(i_client, &o_client, sizeof(cl_clientfunc_t));
*i_pmove = o_pmove;
} }