diff --git a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp index fc0e6e4d..e678dd89 100644 --- a/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp +++ b/SheepShaver/src/kpx_cpu/src/cpu/ppc/ppc-execute.cpp @@ -749,6 +749,35 @@ void powerpc_cpu::execute_stwcx(uint32 opcode) increment_pc(4); } +/** + * Basic (and probably incorrect) implementation for missing functions + * in older C libraries + **/ + +#ifndef signbit +#define signbit(X) my_signbit(X) +#endif + +static inline bool my_signbit(double X) { + return X < 0.0; +} + +#ifndef isless +#define isless(X, Y) my_isless(X, Y) +#endif + +static inline bool my_isless(double X, double Y) { + return X < Y; +} + +#ifndef isgreater +#define isgreater(X, Y) my_isgreater(X, Y) +#endif + +static inline bool my_isgreater(double X, double Y) { + return X > Y; +} + /** * Floating-point compare instruction *