mupen64plus / mupen64plus-core

Core module of the Mupen64Plus project
1.32k stars 258 forks source link

mupen64plus-core no longer builds on Apple Silicon #1042

Closed estefan3112 closed 1 year ago

estefan3112 commented 1 year ago

Hi, while the entire repo built successfully for quite some time on Apple Silicon, the compile of the core fails here (below). All other parts of mupen64plus still build fine. Cheers!

../../src/device/dd/dd_controller.c:511:30: error: call to undeclared library function 'abs' with type 'int (int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] cycles += 4825 abs(track - old_track); ^ ../../src/device/dd/dd_controller.c:511:30: note: include the header or explicitly provide a declaration for 'abs' ../../src/device/dd/dd_controller.c:511:30: warning: taking the absolute value of unsigned type 'unsigned int' has no effect [-Wabsolute-value] cycles += 4825 abs(track - old_track); ^ ../../src/device/dd/dd_controller.c:511:30: note: remove the call to 'abs' since unsigned values cannot be negative cycles += 4825 abs(track - old_track); ^~~ ../../src/device/dd/dd_controller.c:546:30: warning: taking the absolute value of unsigned type 'unsigned int' has no effect [-Wabsolute-value] cycles += 4825 abs(track - old_track); ^ ../../src/device/dd/dd_controller.c:546:30: note: remove the call to 'abs' since unsigned values cannot be negative cycles += 4825 * abs(track - old_track); ^~~ 2 warnings and 1 error generated. make: *** [_obj/device/dd/dd_controller.o] Error 1

richard42 commented 1 year ago

thanks; this should be fixed now

estefan3112 commented 1 year ago

Works again, what an easy fix, thank you! All up and running again.