add support for GCC 4.0

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1407 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
bushing 2008-12-06 03:17:42 +00:00
parent 5c805163bf
commit 14ff55d13b
1 changed files with 6 additions and 2 deletions

View File

@ -390,8 +390,12 @@ LONG SyncInterlockedExchange(LONG *Dest, LONG Val)
#if defined(__GNUC__) && defined (__GNUC_MINOR__) && ((4 < __GNUC__) || (4 == __GNUC__ && 1 <= __GNUC_MINOR__))
return __sync_lock_test_and_set(Dest, Val);
#else
// TODO:
#error Implement support older GCC Versions
register int result;
__asm__ __volatile__("lock; xchg %0,%1"
: "=r" (result), "=m" (*Dest)
: "0" (Val), "m" (*Dest)
: "memory");
return result;
#endif
}