Rename globals' macros

DECLARE -> DECL
SYMBOLS -> INTF
EXTERNS -> EXTERN
This commit is contained in:
8dcc 2023-07-20 16:38:02 +02:00
parent f395bb1efd
commit 68c30891a8
2 changed files with 11 additions and 8 deletions

View File

@ -6,8 +6,8 @@
#include "include/sdk.h" #include "include/sdk.h"
void* hw; void* hw;
DECLARE_SYMBOLS(cl_enginefunc_t, engine); DECL_INTF(cl_enginefunc_t, engine);
DECLARE_SYMBOLS(cl_clientfunc_t, client); DECL_INTF(cl_clientfunc_t, client);
bool globals_init(void) { bool globals_init(void) {
/* /*

View File

@ -6,24 +6,27 @@
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
/* /*
* Macro for declaring interfaces and it's originals.
* Also extern version for the header.
*
* prefix | meaning * prefix | meaning
* -------+---------------- * -------+----------------
* gp_* | global pointer * gp_* | global pointer
* go_* | global original * go_* | global original
*/ */
#define DECLARE_SYMBOLS(type, name) \ #define DECL_INTF(type, name) \
type* gp_##name = NULL; \ type* gp_##name = NULL; \
type go_##name; type go_##name;
#define DECLARE_EXTERNS(type, name) \ #define DECL_INTF_EXTERN(type, name) \
extern type* gp_##name; \ extern type* gp_##name; \
extern type go_##name; extern type go_##name;
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
extern void* hw; extern void* hw;
DECLARE_EXTERNS(cl_enginefunc_t, engine); DECL_INTF_EXTERN(cl_enginefunc_t, engine);
DECLARE_EXTERNS(cl_clientfunc_t, client); DECL_INTF_EXTERN(cl_clientfunc_t, client);
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/