what’s the best way to update my threaded haxelib for backwards compatibility?
before I imported the target specific Thread classes but they were deprecated in 4.0.0 for sys.thread.Thread
.
#if neko
import neko.vm.Thread;
#elseif java
import java.vm.Thread;
#elseif cpp
import cpp.vm.Thread;
#end
//...elsewhere...
#if (neko || java || cpp)
_worker = Thread.create(sendThreaded);
#end
I’m assuming that #if (target.threaded)
won’t work before 4.0.0, does that mean I should do the following?
#if (target.threaded)
import sys.thread.Thread;
#elseif neko
import neko.vm.Thread;
#elseif java
import java.vm.Thread;
#elseif cpp
import cpp.vm.Thread;
#end
//...elsewhere...
#if (target.threaded || neko || java || cpp)
_worker = Thread.create(sendThreaded);
#end
if so, is there a way to do something like this?
#if (target.threaded || neko || java || cpp)
#define THREADED
#end
//...elsewhere...
#if THREADED