Browse Source

Add basic support for non x86 based CPU's

pull/93/head
Anders Jenbo 7 years ago
parent
commit
0cdb99eadf
  1. 5
      SourceS/miniwin.h
  2. 16
      SourceX/miniwin/misc.cpp

5
SourceS/miniwin.h

@ -15,7 +15,12 @@
#include <time.h>
// For _rotr()
#if !defined(_MSC_VER) && defined(DEVILUTION_ENGINE)
#if defined(__x86_64__) || defined(__i386__)
#include <x86intrin.h>
#else
unsigned int _rotl(unsigned int value, int shift);
unsigned int _rotr(unsigned int value, int shift);
#endif
#endif
#ifndef _WIN32

16
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;

Loading…
Cancel
Save