Xilmi / OpenXcom

Open-source clone of the original X-Com
http://openxcom.org
GNU General Public License v3.0
19 stars 10 forks source link

Latest version fails to compile on MacOS #44

Closed themaster567 closed 3 weeks ago

themaster567 commented 3 weeks ago

I personally maintain for myself a build for ARM MacOS from a script I salvaged and very lightly modified from the forums a couple years ago. Every so often, it breaks, but I usually was compiling too infrequently to pinpoint what broke, and would just have to wait for when things would work themselves out again.

This time around, I've been compiling with pretty much every push. The latest merge with upstream broke it, and I can give the exact errors:

/Users/killbotvii/OpenXcom/src/Battlescape/Map.cpp:1818:59: error: use of undeclared identifier 'distance'; did you mean 'distanceSq'?
                                                                                                totalDamage -= weapon->getPowerRangeReduction(distance * 16);
                                                                                                                                              ^~~~~~~~
                                                                                                                                              distanceSq
/Users/killbotvii/OpenXcom/src/Battlescape/Map.cpp:1383:13: note: 'distanceSq' declared here
                                                                int distanceSq = action->actor->distance3dToPositionSq(Position(itX, itY, itZ));
                                                                    ^
/Users/killbotvii/OpenXcom/src/Battlescape/Map.cpp:1823:57: error: use of undeclared identifier 'distance'; did you mean 'distanceSq'?
                                                                                                totalDamage -= rule->getPowerRangeReduction(distance * 16);
                                                                                                                                            ^~~~~~~~
                                                                                                                                            distanceSq
/Users/killbotvii/OpenXcom/src/Battlescape/Map.cpp:1383:13: note: 'distanceSq' declared here
                                                                int distanceSq = action->actor->distance3dToPositionSq(Position(itX, itY, itZ));
                                                                    ^

Here is the entire log, if you want it.

If you'd like to start providing builds for ARM MacOS, here's the shell script that I use. Note how it really isn't doing anything at all fancy. I think it would be trivial to implement, to my layman eyes.

Lastly, here is compiled proof that, just a single push ago, it was working: openxcom.zip

themaster567 commented 3 weeks ago

The newest commit b35c4d827f6f1c312f4c1b1b8f70784052d42ad0 has fixed the issue, it now successfully compiles. Thank you!