mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
MINGW64: Compilation fix
This commit is contained in:
parent
60dc4abc2b
commit
5f6caf33f0
35 changed files with 111 additions and 112 deletions
|
@ -3,6 +3,7 @@
|
|||
#include "File.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#define _WIN32_WINNT 0x0601
|
||||
#include <Windows.h>
|
||||
|
||||
#define GET_API_ERROR static_cast<u64>(GetLastError())
|
||||
|
|
|
@ -49,11 +49,3 @@ int clock_gettime(clockid_t clk_id, struct timespec *tp)
|
|||
return retval;
|
||||
}
|
||||
#endif /* __APPLE__ */
|
||||
#if defined(__GNUG__)
|
||||
|
||||
void * _aligned_malloc(size_t size, size_t alignment) {
|
||||
void *buffer;
|
||||
return (posix_memalign(&buffer, alignment, size) == 0) ? buffer : 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -41,23 +41,18 @@
|
|||
|
||||
#define _fpclass(x) std::fpclassify(x)
|
||||
#define _byteswap_ushort(x) __builtin_bswap16(x)
|
||||
#define _byteswap_ulong(x) __builtin_bswap32(x)
|
||||
#define _byteswap_uint64(x) __builtin_bswap64(x)
|
||||
#define INFINITE 0xFFFFFFFF
|
||||
|
||||
inline std::uint64_t __umulh(std::uint64_t a, std::uint64_t b)
|
||||
#if !defined(__MINGW32__)
|
||||
#define _byteswap_ulong(x) __builtin_bswap32(x)
|
||||
#else
|
||||
inline std::uint32_t _byteswap_ulong(std::uint32_t value)
|
||||
{
|
||||
std::uint64_t result;
|
||||
__asm__("mulq %[b]" : "=d" (result) : [a] "a" (a), [b] "rm" (b));
|
||||
return result;
|
||||
}
|
||||
|
||||
inline std::int64_t __mulh(std::int64_t a, std::int64_t b)
|
||||
{
|
||||
std::int64_t result;
|
||||
__asm__("imulq %[b]" : "=d" (result) : [a] "a" (a), [b] "rm" (b));
|
||||
return result;
|
||||
__asm__("bswap %0" : "+r"(value));
|
||||
return value;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __APPLE__
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue