Hack to force GCC to invoke cancel_job() through DF's vtable
GCC appears to be optimizing the call to `cancel_job()` to use the stub in *DFHack's* job_handler vtable, which is a no-op. Lua was unaffected because it invokes vmethods through method pointers (without knowing the target instance at compile time), so use a similar approach here for now. As mentioned by @ab9rf on Discord, we should pursue an alternative like asking Bay12 to expose the relevant code through a global `std::function` instead of a vmethod.develop
parent
07e8e83837
commit
40bfb6b8ff
Loading…
Reference in New Issue