Re: Modifying the Euphoria interpreter
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Jun 12, 2007
- 578 views
CChris wrote: > No, it's even worse than that. > Remember that, if ex.exe tries to compile a program which mentions > open_dll(), it errors out even though the the function won't ever be > executed because the call is protected by a "if platform()=??? then". > The error is generated before the platform dependent code is removed. > But replacing the call with "machine_func(50,"kernel32.dll") won't hurt. As well as the same things others have tried, I just tested this here:
constant k32=open_dll("kernel32") constant k32=machine_func(50,"kernel32")
Despite beginning to mistrust myself, I was right. Both the above fail equally on ex.exe, since you cannot put a platform() check around either. It is true, btw, to say that you cannot use constant definitions like the above in platform independent code. Instead you must use atom vars. The point I am trying to make here is that you seem to be locked into using a direct call to machine_func when it will make no significant difference - see the definition of open_dll() in dll.e. It is the machine_func call itself which fails on ex.exe, NOT the trivial open_dll() wrapper... you can even prove this by putting a display inside open_dll just before the call to machine_func: it will show fine, just before ex.exe crashes. Regards, Pete