diff options
| author | 2015-01-20 17:16:47 -0800 | |
|---|---|---|
| committer | 2015-02-10 18:30:31 -0800 | |
| commit | ef24e72b2618806f64345544fa46c84f3f494890 (patch) | |
| tree | fca138e8377c4d66bd1fe026a3d2fef54a7f090c /src/common/common_funcs.h | |
| parent | GSP: Fixed typo in SignalInterrupt (diff) | |
| download | yuzu-ef24e72b2618806f64345544fa46c84f3f494890.tar.gz yuzu-ef24e72b2618806f64345544fa46c84f3f494890.tar.xz yuzu-ef24e72b2618806f64345544fa46c84f3f494890.zip | |
Asserts: break/crash program, fit to style guide; log.h->assert.h
Involves making asserts use printf instead of the log functions (log functions are asynchronous and, as such, the log won't be printed in time)
As such, the log type argument was removed (printf obviously can't use it, and it's made obsolete by the file and line printing)
Also removed some GEKKO cruft.
Diffstat (limited to 'src/common/common_funcs.h')
| -rw-r--r-- | src/common/common_funcs.h | 35 |
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> {}; | |||
| 44 | #include <sys/endian.h> | 44 | #include <sys/endian.h> |
| 45 | #endif | 45 | #endif |
| 46 | 46 | ||
| 47 | // go to debugger mode | 47 | #if defined(__x86_64__) || defined(_M_X64) |
| 48 | #ifdef GEKKO | 48 | #define Crash() __asm__ __volatile__("int $3") |
| 49 | #define Crash() | 49 | #elif defined(_M_ARM) |
| 50 | #elif defined _M_GENERIC | 50 | #define Crash() __asm__ __volatile__("trap") |
| 51 | #define Crash() { exit(1); } | 51 | #else |
| 52 | #else | 52 | #define Crash() exit(1) |
| 53 | #define Crash() {asm ("int $3");} | 53 | #endif |
| 54 | #endif | 54 | |
| 55 | #define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0])) | ||
| 56 | // GCC 4.8 defines all the rotate functions now | 55 | // GCC 4.8 defines all the rotate functions now |
| 57 | // Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit | 56 | // Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit |
| 58 | #ifndef _rotl | 57 | #ifndef _rotl |
| @@ -97,10 +96,10 @@ inline u64 _rotr64(u64 x, unsigned int shift){ | |||
| 97 | #define LC_GLOBAL_LOCALE ((locale_t)-1) | 96 | #define LC_GLOBAL_LOCALE ((locale_t)-1) |
| 98 | #define LC_ALL_MASK LC_ALL | 97 | #define LC_ALL_MASK LC_ALL |
| 99 | #define LC_COLLATE_MASK LC_COLLATE | 98 | #define LC_COLLATE_MASK LC_COLLATE |
| 100 | #define LC_CTYPE_MASK LC_CTYPE | 99 | #define LC_CTYPE_MASK LC_CTYPE |
| 101 | #define LC_MONETARY_MASK LC_MONETARY | 100 | #define LC_MONETARY_MASK LC_MONETARY |
| 102 | #define LC_NUMERIC_MASK LC_NUMERIC | 101 | #define LC_NUMERIC_MASK LC_NUMERIC |
| 103 | #define LC_TIME_MASK LC_TIME | 102 | #define LC_TIME_MASK LC_TIME |
| 104 | 103 | ||
| 105 | inline locale_t uselocale(locale_t new_locale) | 104 | inline locale_t uselocale(locale_t new_locale) |
| 106 | { | 105 | { |
| @@ -136,14 +135,10 @@ inline u64 _rotr64(u64 x, unsigned int shift){ | |||
| 136 | #define fstat64 _fstat64 | 135 | #define fstat64 _fstat64 |
| 137 | #define fileno _fileno | 136 | #define fileno _fileno |
| 138 | 137 | ||
| 139 | #if _M_IX86 | 138 | extern "C" { |
| 140 | #define Crash() {__asm int 3} | 139 | __declspec(dllimport) void __stdcall DebugBreak(void); |
| 141 | #else | 140 | } |
| 142 | extern "C" { | 141 | #define Crash() {DebugBreak();} |
| 143 | __declspec(dllimport) void __stdcall DebugBreak(void); | ||
| 144 | } | ||
| 145 | #define Crash() {DebugBreak();} | ||
| 146 | #endif // M_IX86 | ||
| 147 | #endif // _MSC_VER ndef | 142 | #endif // _MSC_VER ndef |
| 148 | 143 | ||
| 149 | // Dolphin's min and max functions | 144 | // Dolphin's min and max functions |