mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-21 15:42:35 +00:00
Implements a wrapper to the call()() function, meant to be used for calling dylibs.
This is useful for two reasons:
It allows us to debug the dylib calls (such as timing for the time being).
14 lines
352 B
Plaintext
14 lines
352 B
Plaintext
|
|
/** A function to wrap calls to DLLs for debugging purposes.
|
|
*/
|
|
/proc/dll_call(dll, func, ...)
|
|
|
|
var/start = world.timeofday
|
|
|
|
var/list/calling_arguments = length(args) > 2 ? args.Copy(3) : null
|
|
|
|
. = call(dll, func)(arglist(calling_arguments))
|
|
|
|
if (world.timeofday - start > 10 SECONDS)
|
|
crash_with("DLL call took longer than 10 seconds: [func]")
|