CONSOLE: Fix PS3 build.

This commit is contained in:
Mike Pall
2012-06-10 01:38:44 +02:00
parent 37be8a5478
commit b8f5727ab4
12 changed files with 73 additions and 29 deletions

View File

@@ -197,7 +197,16 @@ static LJ_AINLINE uint64_t lj_bswap64(uint64_t x)
}
#endif
#else
#error "missing define for lj_bswap()"
static LJ_AINLINE uint32_t lj_bswap(uint32_t x)
{
return (x << 24) | ((x & 0xff00) << 8) | ((x >> 8) & 0xff00) | (x >> 24);
}
static LJ_AINLINE uint64_t lj_bswap64(uint64_t x)
{
return (uint64_t)lj_bswap((uint32_t)(x >> 32)) |
((uint64_t)lj_bswap((uint32_t)x) << 32);
}
#endif
typedef union __attribute__((packed)) Unaligned16 {