Skip to content

Portability - #685

Merged
ryfactor merged 11 commits into
Attnam:masterfrom
zenorogue:portability
Aug 2, 2026
Merged

Portability#685
ryfactor merged 11 commits into
Attnam:masterfrom
zenorogue:portability

Conversation

@zenorogue

Copy link
Copy Markdown
Contributor

Various commits intended to improve portability, in various ways.

Note: I am cross-compiling the Windows version on Linux using x86_64-w64-mingw32-g++. So this is 64-bit. I am not sure how to make cmake work (I am compiling using my own scripts instead which I have not included in the PR).

  • The saves in the Linux and Windows versions I compiled were not compatible, because on Linux "long" is 64-bit, while in Windows, at least according to the x86_64-w64-mingw32-g++ compiler, it is 32-bit, so Windows would read 32 bit of a Linux long and the next 32 bits would be assumed to refer to something else. I have fixed this by making save.h use 64 bits anyway when recording "long" or "ulong". An alternative solution would be redefine "ulong" to be 64-bit and replace all occurrences of "long" with a new 64-bit type.
  • The Linux version was configured to install itself in the system -- added a cmake option PORTABLE_BUILD to create a "portable build" working from a single directory. Also this option uniformizes the highscore filename between Linux and Windows. It was mostly for Steam but I guess it could also be used if you wanted to launch IVAN from a USB stick that you use on both Linux and Windows, and keep user data between them.
  • There was a problem with festring and fearray allocating an int* before the actual content and then treating it as ulong, which did not work when int* and ulong have different sizes. (Weird that this worked on Wine for me. It crashed on actual Windows though.)
  • Also it appears that _findfist crashes in w64-mingw32 (even in my minimal program) -- I have added an option USE_OPENDIR to use the Unix standard functions opendir/readdir which work there.

@ryfactor
ryfactor self-requested a review July 31, 2026 10:24
Comment thread xbrzscale/libxbrzscale.h Outdated
Comment thread xbrzscale/libxbrzscale.h Outdated
zenorogue and others added 2 commits August 1, 2026 22:53
Co-authored-by: ryfactor <6005108+ryfactor@users.noreply.github.com>
Co-authored-by: ryfactor <6005108+ryfactor@users.noreply.github.com>
@ryfactor
ryfactor merged commit de528ac into Attnam:master Aug 2, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants