summaryrefslogtreecommitdiffstats
path: root/src/common/common_funcs.h
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2015-01-21 02:16:47 +0100
committerarchshift <admin@archshift.com>2015-02-11 03:30:31 +0100
commitef24e72b2618806f64345544fa46c84f3f494890 (patch)
treefca138e8377c4d66bd1fe026a3d2fef54a7f090c /src/common/common_funcs.h
parentGSP: Fixed typo in SignalInterrupt (diff)
downloadyuzu-ef24e72b2618806f64345544fa46c84f3f494890.tar
yuzu-ef24e72b2618806f64345544fa46c84f3f494890.tar.gz
yuzu-ef24e72b2618806f64345544fa46c84f3f494890.tar.bz2
yuzu-ef24e72b2618806f64345544fa46c84f3f494890.tar.lz
yuzu-ef24e72b2618806f64345544fa46c84f3f494890.tar.xz
yuzu-ef24e72b2618806f64345544fa46c84f3f494890.tar.zst
yuzu-ef24e72b2618806f64345544fa46c84f3f494890.zip
Diffstat (limited to 'src/common/common_funcs.h')
-rw-r--r--src/common/common_funcs.h35
1 files changed, 15 insertions, 20 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index 229eb74c9..44d8ae11f 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -44,15 +44,14 @@ template<> struct CompileTimeAssert<true> {};
#include <sys/endian.h>
#endif
-// go to debugger mode
- #ifdef GEKKO
- #define Crash()
- #elif defined _M_GENERIC
- #define Crash() { exit(1); }
- #else
- #define Crash() {asm ("int $3");}
- #endif
- #define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
+#if defined(__x86_64__) || defined(_M_X64)
+#define Crash() __asm__ __volatile__("int $3")
+#elif defined(_M_ARM)
+#define Crash() __asm__ __volatile__("trap")
+#else
+#define Crash() exit(1)
+#endif
+
// GCC 4.8 defines all the rotate functions now
// Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit
#ifndef _rotl
@@ -97,10 +96,10 @@ inline u64 _rotr64(u64 x, unsigned int shift){
#define LC_GLOBAL_LOCALE ((locale_t)-1)
#define LC_ALL_MASK LC_ALL
#define LC_COLLATE_MASK LC_COLLATE
- #define LC_CTYPE_MASK LC_CTYPE
- #define LC_MONETARY_MASK LC_MONETARY
+ #define LC_CTYPE_MASK LC_CTYPE
+ #define LC_MONETARY_MASK LC_MONETARY
#define LC_NUMERIC_MASK LC_NUMERIC
- #define LC_TIME_MASK LC_TIME
+ #define LC_TIME_MASK LC_TIME
inline locale_t uselocale(locale_t new_locale)
{
@@ -136,14 +135,10 @@ inline u64 _rotr64(u64 x, unsigned int shift){
#define fstat64 _fstat64
#define fileno _fileno
- #if _M_IX86
- #define Crash() {__asm int 3}
- #else
-extern "C" {
- __declspec(dllimport) void __stdcall DebugBreak(void);
-}
- #define Crash() {DebugBreak();}
- #endif // M_IX86
+ extern "C" {
+ __declspec(dllimport) void __stdcall DebugBreak(void);
+ }
+ #define Crash() {DebugBreak();}
#endif // _MSC_VER ndef
// Dolphin's min and max functions