alan-if / alan

ALAN IF compilers and interpreters
https://alanif.se
Other
19 stars 3 forks source link

Various updates for the 2.x branch #52

Closed cspiegel closed 1 year ago

cspiegel commented 1 year ago

I tried building the Alan2 interpreter against Windows Glk with a modern MinGW compiler, and ran into a few issues that are fixed here.

The most finicky is the workaround for Alan's redefinition of printf. The supplied glkio_printf prototype doesn't necessarily match with standard headers, causing conflicting definitions for printf itself. But if stdio.h is included before Alan's redefinition, all is good: the standard header doesn't see the renaming, but the rest of Alan does.

I also had to invent a macro for if a Unix Glk startup is wanted: the code previously did a Unix startup unconditionally, then conditionally did a Windows Glk startup. Following the Windows macro, I wrapped the Unix startup in a UNIXGLK macro. This does change behavior, so anybody who was using this before needs to define UNIXGLK. If this is too onerous, it could be changed so that Unix is implied if WINGLK isn't set.

thoni56 commented 1 year ago

I think this looks good. I haven't done anything with the v2 branch for ages so your knowledge about these changes are probably better than mine ;-)

Thank you for your contribution!