diff --git a/SourceS/miniwin.h b/SourceS/miniwin.h index 380f2a84e..05b91b4cc 100644 --- a/SourceS/miniwin.h +++ b/SourceS/miniwin.h @@ -15,7 +15,12 @@ #include // For _rotr() #if !defined(_MSC_VER) && defined(DEVILUTION_ENGINE) +#if defined(__x86_64__) || defined(__i386__) #include +#else +unsigned int _rotl(unsigned int value, int shift); +unsigned int _rotr(unsigned int value, int shift); +#endif #endif #ifndef _WIN32 diff --git a/SourceX/miniwin/misc.cpp b/SourceX/miniwin/misc.cpp index 1b650f0b8..39199e0eb 100644 --- a/SourceX/miniwin/misc.cpp +++ b/SourceX/miniwin/misc.cpp @@ -14,6 +14,22 @@ namespace dvl { DWORD last_error; +#if !defined(_MSC_VER) && defined(DEVILUTION_ENGINE) && !defined(__x86_64__) && !defined(__i386__) +unsigned int _rotl(unsigned int value, int shift) +{ + if ((shift &= 31) == 0) + return value; + return (value << shift) | (value >> (32 - shift)); +} + +unsigned int _rotr(unsigned int value, int shift) +{ + if ((shift &= 31) == 0) + return value; + return (value >> shift) | (value << (32 - shift)); +} +#endif + DWORD GetLastError() { return last_error;