diff options
| author | 2015-05-07 11:45:45 -0700 | |
|---|---|---|
| committer | 2015-05-07 11:45:45 -0700 | |
| commit | 4f4d230dac936f32cceb8be35fe09822d85bb2b6 (patch) | |
| tree | a180a736708834708e0e5b95fd1720f37722b429 /src/common/platform.h | |
| parent | Merge pull request #695 from Subv/crash_f (diff) | |
| parent | Fix printf format warning (diff) | |
| download | yuzu-4f4d230dac936f32cceb8be35fe09822d85bb2b6.tar.gz yuzu-4f4d230dac936f32cceb8be35fe09822d85bb2b6.tar.xz yuzu-4f4d230dac936f32cceb8be35fe09822d85bb2b6.zip | |
Merge pull request #721 from yuriks/more-cleanups
More cleanups
Diffstat (limited to 'src/common/platform.h')
| -rw-r--r-- | src/common/platform.h | 57 |
1 files changed, 18 insertions, 39 deletions
diff --git a/src/common/platform.h b/src/common/platform.h index e27d6e31f..1516dc88a 100644 --- a/src/common/platform.h +++ b/src/common/platform.h | |||
| @@ -64,47 +64,26 @@ | |||
| 64 | #endif | 64 | #endif |
| 65 | 65 | ||
| 66 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 66 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 67 | // Compiler-Specific Definitions | 67 | // Feature detection |
| 68 | 68 | ||
| 69 | #if EMU_PLATFORM == PLATFORM_WINDOWS | 69 | #if defined _M_GENERIC |
| 70 | 70 | # define _M_SSE 0x0 | |
| 71 | #include <time.h> | 71 | #elif defined __GNUC__ |
| 72 | 72 | # if defined __SSE4_2__ | |
| 73 | #ifndef NOMINMAX | 73 | # define _M_SSE 0x402 |
| 74 | #define NOMINMAX | 74 | # elif defined __SSE4_1__ |
| 75 | # define _M_SSE 0x401 | ||
| 76 | # elif defined __SSSE3__ | ||
| 77 | # define _M_SSE 0x301 | ||
| 78 | # elif defined __SSE3__ | ||
| 79 | # define _M_SSE 0x300 | ||
| 80 | # endif | ||
| 81 | #elif (_MSC_VER >= 1500) || __INTEL_COMPILER // Visual Studio 2008 | ||
| 82 | # define _M_SSE 0x402 | ||
| 75 | #endif | 83 | #endif |
| 76 | #define EMU_FASTCALL __fastcall | ||
| 77 | |||
| 78 | #ifdef _MSC_VER | ||
| 79 | inline struct tm* localtime_r(const time_t *clock, struct tm *result) { | ||
| 80 | if (localtime_s(result, clock) == 0) | ||
| 81 | return result; | ||
| 82 | return nullptr; | ||
| 83 | } | ||
| 84 | #endif | ||
| 85 | |||
| 86 | #else // EMU_PLATFORM != PLATFORM_WINDOWS | ||
| 87 | |||
| 88 | #define EMU_FASTCALL __attribute__((fastcall)) | ||
| 89 | #define __stdcall | ||
| 90 | #define __cdecl | ||
| 91 | 84 | ||
| 92 | #define BOOL bool | 85 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 93 | #define DWORD u32 | 86 | // Compiler-Specific Definitions |
| 94 | |||
| 95 | // TODO: Hacks.. | ||
| 96 | #include <limits.h> | ||
| 97 | |||
| 98 | #include <strings.h> | ||
| 99 | #define stricmp(str1, str2) strcasecmp(str1, str2) | ||
| 100 | #define _stricmp(str1, str2) strcasecmp(str1, str2) | ||
| 101 | #define _snprintf snprintf | ||
| 102 | #define _getcwd getcwd | ||
| 103 | #define _tzset tzset | ||
| 104 | |||
| 105 | typedef void EXCEPTION_POINTERS; | ||
| 106 | |||
| 107 | #endif | ||
| 108 | 87 | ||
| 109 | #define GCC_VERSION_AVAILABLE(major, minor) (defined(__GNUC__) && (__GNUC__ > (major) || \ | 88 | #define GCC_VERSION_AVAILABLE(major, minor) (defined(__GNUC__) && (__GNUC__ > (major) || \ |
| 110 | (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))) | 89 | (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor)))) |