Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix GCC 4.8 compiling. GCC 4.8 now defines _rotl/_rotr/_lrotl/_lrotr.
  • Loading branch information
Sonicadvance1 committed Apr 3, 2013
1 parent 3fdc468 commit b5676fe
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Source/Core/Common/Src/CommonFuncs.h
Expand Up @@ -66,7 +66,11 @@ _mm_shuffle_epi8(__m128i a, __m128i mask)
#define Crash() {asm ("int $3");}
#endif
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))

// GCC 4.8 defines all the rotate functions now
#ifdef _rotl
#define _rotl64 _lrotl
#define _rotr64 _lrotr
#else
inline u32 _rotl(u32 x, int shift) {
shift &= 31;
if (!shift) return x;
Expand All @@ -88,6 +92,7 @@ inline u64 _rotr64(u64 x, unsigned int shift){
unsigned int n = shift % 64;
return (x >> n) | (x << (64 - n));
}
#endif

#else // WIN32
// Function Cross-Compatibility
Expand Down

0 comments on commit b5676fe

Please sign in to comment.