summaryrefslogtreecommitdiff
path: root/src/lj_def.h
diff options
context:
space:
mode:
authorMike Pall <mike>2012-06-10 01:38:44 +0200
committerMike Pall <mike>2012-06-10 02:01:25 +0200
commitb8f5727ab4ab5656b19cdb2c71a92611836b5458 (patch)
treeafff6234da61ae8d3a513359a68c88cdb7b6159c /src/lj_def.h
parent37be8a54785b893f531679adb0b479a426938504 (diff)
downloadluajit-b8f5727ab4ab5656b19cdb2c71a92611836b5458.tar.gz
luajit-b8f5727ab4ab5656b19cdb2c71a92611836b5458.tar.bz2
luajit-b8f5727ab4ab5656b19cdb2c71a92611836b5458.zip
CONSOLE: Fix PS3 build.
Diffstat (limited to 'src/lj_def.h')
-rw-r--r--src/lj_def.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lj_def.h b/src/lj_def.h
index 876ce95f..27b6d6b7 100644
--- a/src/lj_def.h
+++ b/src/lj_def.h
@@ -197,7 +197,16 @@ static LJ_AINLINE uint64_t lj_bswap64(uint64_t x)
197} 197}
198#endif 198#endif
199#else 199#else
200#error "missing define for lj_bswap()" 200static LJ_AINLINE uint32_t lj_bswap(uint32_t x)
201{
202 return (x << 24) | ((x & 0xff00) << 8) | ((x >> 8) & 0xff00) | (x >> 24);
203}
204
205static LJ_AINLINE uint64_t lj_bswap64(uint64_t x)
206{
207 return (uint64_t)lj_bswap((uint32_t)(x >> 32)) |
208 ((uint64_t)lj_bswap((uint32_t)x) << 32);
209}
201#endif 210#endif
202 211
203typedef union __attribute__((packed)) Unaligned16 { 212typedef union __attribute__((packed)) Unaligned16 {