Files
Aurora.3/code/_helpers/dll_call.dm
Erki 45f4652a3a Implement a dll call wrapper (#8944)
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).
2020-07-05 18:31:43 +03:00

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]")