summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
Diffstat (limited to 'src/common')
-rw-r--r--src/common/common_funcs.h38
1 files changed, 0 insertions, 38 deletions
diff --git a/src/common/common_funcs.h b/src/common/common_funcs.h
index 995938d0b..c8a032eba 100644
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@ -36,40 +36,6 @@
36#define Crash() exit(1) 36#define Crash() exit(1)
37#endif 37#endif
38 38
39// GCC 4.8 defines all the rotate functions now
40// Small issue with GCC's lrotl/lrotr intrinsics is they are still 32bit while we require 64bit
41#ifdef _rotl
42#define rotl _rotl
43#else
44inline u32 rotl(u32 x, int shift) {
45 shift &= 31;
46 if (!shift)
47 return x;
48 return (x << shift) | (x >> (32 - shift));
49}
50#endif
51
52#ifdef _rotr
53#define rotr _rotr
54#else
55inline u32 rotr(u32 x, int shift) {
56 shift &= 31;
57 if (!shift)
58 return x;
59 return (x >> shift) | (x << (32 - shift));
60}
61#endif
62
63inline u64 _rotl64(u64 x, unsigned int shift) {
64 unsigned int n = shift % 64;
65 return (x << n) | (x >> (64 - n));
66}
67
68inline u64 _rotr64(u64 x, unsigned int shift) {
69 unsigned int n = shift % 64;
70 return (x >> n) | (x << (64 - n));
71}
72
73#else // _MSC_VER 39#else // _MSC_VER
74 40
75// Locale Cross-Compatibility 41// Locale Cross-Compatibility
@@ -80,10 +46,6 @@ __declspec(dllimport) void __stdcall DebugBreak(void);
80} 46}
81#define Crash() DebugBreak() 47#define Crash() DebugBreak()
82 48
83// cstdlib provides these on MSVC
84#define rotr _rotr
85#define rotl _rotl
86
87#endif // _MSC_VER ndef 49#endif // _MSC_VER ndef
88 50
89// Generic function to get last error message. 51// Generic function to get last error message.