diff options
author | Michael Smith <mikesmiffy128@gmail.com> | 2023-08-20 16:20:03 +0100 |
---|---|---|
committer | Michael Smith <mikesmiffy128@gmail.com> | 2023-08-27 00:46:09 +0100 |
commit | a1998f2f7ce4153d670e2e5cb5018366517cc1ca (patch) | |
tree | 4d899fbad24c728c0b51f183c61ed6a7fb213c04 /src/con_.h | |
parent | 38fa6c52a8a26ac178a3e1f80a8317740b8e82b3 (diff) |
Get things at least compiling under Linux
Nothing really works yet, but at least test.h and fastspin are fixed and
some of the issues with RTTI and libdl and stuff are maybe kind of
sorted, subject to more testing later.
The main issue now seems to be the cvar interface not quite lining up
and crashing pretty much immediately. That'll probably take a lot more
debugging to figure out, which likely still won't be a priority for
quite a while.
Diffstat (limited to 'src/con_.h')
-rw-r--r-- | src/con_.h | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -112,11 +112,6 @@ struct con_cmd { // ConCommand in engine bool has_complcb : 1, use_newcb : 1, use_newcmdiface : 1; }; -// con_var will be a bit different on linux; see offset_to_top etc. -#ifdef __linux__ -#warning FIXME: redo multi-vtable crap for itanium ABI! -#endif - struct con_var { // ConVar in engine struct con_cmdbase base; void **vtable_iconvar; // IConVar in engine (pure virtual) @@ -175,7 +170,7 @@ con_cmdcbv1 con_getcmdcbv1(const struct con_cmd *cmd); */ #if defined(__GNUC__) || defined(__clang__) #ifdef _WIN32 -#define __asm__(x) __asm__("_" x) // stupid mangling meme (not on linux, right?) +#define __asm__(x) __asm__("_" x) // stupid mangling meme, only on windows! #endif void con_msg(const char *fmt, ...) _CON_PRINTF(1, 2) __asm__("Msg"); void con_warn(const char *fmt, ...) _CON_PRINTF(1, 2) __asm__("Warning"); @@ -214,12 +209,19 @@ extern struct _con_vtab_var_wrap { #else // itanium ABI also has the top offset/"whole object" offset in libstdc++ ssize topoffset; - struct itanium_type_info *rtti; + const struct itanium_vmi_type_info *rtti; #endif void *vtable[19]; } _con_vtab_var_wrap; #define _con_vtab_var (_con_vtab_var_wrap.vtable) -extern void *_con_vtab_iconvar[]; +extern struct _con_vtab_iconvar_wrap { +#ifndef _WIN32 + ssize topoffset; + const struct itanium_vmi_type_info *rtti; +#endif + void *vtable[7]; +} _con_vtab_iconvar_wrap; +#define _con_vtab_iconvar _con_vtab_iconvar_wrap.vtable #define _DEF_CVAR(name_, desc, value, hasmin_, min, hasmax_, max, flags_) \ static struct con_var _cvar_##name_ = { \ |