Add header for globals.c
With DECLARE_SYMBOLS and DECLARE_EXTERNS macros hw extern for hw.so handler Externs engine and client symbol pointers (and originals) globals_init function
This commit is contained in:
parent
eb64855797
commit
12b3af41c1
|
@ -0,0 +1,32 @@
|
|||
#ifndef _GLOBALS_H
|
||||
#define _GLOBALS_H
|
||||
|
||||
#include "sdk.h"
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
/*
|
||||
* prefix | meaning
|
||||
* -------+----------------
|
||||
* gp_* | global pointer
|
||||
* go_* | global original
|
||||
*/
|
||||
#define DECLARE_SYMBOLS(type, name) \
|
||||
type* gp_##name = NULL; \
|
||||
type go_##name;
|
||||
|
||||
#define DECLARE_EXTERNS(type, name) \
|
||||
extern type* gp_##name; \
|
||||
extern type go_##name;
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
extern void* hw;
|
||||
DECLARE_EXTERNS(cl_enginefunc_t, engine);
|
||||
DECLARE_EXTERNS(cl_clientfunc_t, client);
|
||||
|
||||
/*----------------------------------------------------------------------------*/
|
||||
|
||||
bool globals_init(void);
|
||||
|
||||
#endif /* _GLOBALS_H */
|
Loading…
Reference in New Issue