Fixed and simplified.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@4616 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -15,26 +15,24 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef BFS_LITTLE_ENDIAN_ONLY
|
#if defined(BFS_LITTLE_ENDIAN_ONLY) && B_HOST_IS_LENDIAN \
|
||||||
# if B_HOST_IS_LENDIAN
|
|| defined(BFS_BIG_ENDIAN_ONLY) && B_HOST_IS_BENDIAN
|
||||||
# define BFS_ENDIAN_TO_HOST_INT16(value) value
|
/* host is BFS endian */
|
||||||
# define BFS_ENDIAN_TO_HOST_INT32(value) value
|
# define BFS_ENDIAN_TO_HOST_INT16(value) value
|
||||||
# define BFS_ENDIAN_TO_HOST_INT64(value) value
|
# define BFS_ENDIAN_TO_HOST_INT32(value) value
|
||||||
# else
|
# define BFS_ENDIAN_TO_HOST_INT64(value) value
|
||||||
# define BFS_ENDIAN_TO_HOST_INT16(value) __swap_int16(value)
|
# define HOST_ENDIAN_TO_BFS_INT16(value) value
|
||||||
# define BFS_ENDIAN_TO_HOST_INT16(value) __swap_int32(value)
|
# define HOST_ENDIAN_TO_BFS_INT32(value) value
|
||||||
# define BFS_ENDIAN_TO_HOST_INT16(value) __swap_int64(value)
|
# define HOST_ENDIAN_TO_BFS_INT64(value) value
|
||||||
# endif
|
#elif defined(BFS_LITTLE_ENDIAN_ONLY) && B_HOST_IS_BENDIAN \
|
||||||
#elif BFS_BIG_ENDIAN_ONLY
|
|| defined(BFS_BIG_ENDIAN_ONLY) && B_HOST_IS_LENDIAN
|
||||||
# if B_HOST_IS_BENDIAN
|
/* host is big endian, BFS is little endian or vice versa */
|
||||||
# define BFS_ENDIAN_TO_HOST_INT16(value) value
|
# define BFS_ENDIAN_TO_HOST_INT16(value) __swap_int16(value)
|
||||||
# define BFS_ENDIAN_TO_HOST_INT32(value) value
|
# define BFS_ENDIAN_TO_HOST_INT32(value) __swap_int32(value)
|
||||||
# define BFS_ENDIAN_TO_HOST_INT64(value) value
|
# define BFS_ENDIAN_TO_HOST_INT64(value) __swap_int64(value)
|
||||||
# else
|
# define HOST_ENDIAN_TO_BFS_INT16(value) __swap_int16(value)
|
||||||
# define BFS_ENDIAN_TO_HOST_INT16(value) __swap_int16(value)
|
# define HOST_ENDIAN_TO_BFS_INT32(value) __swap_int32(value)
|
||||||
# define BFS_ENDIAN_TO_HOST_INT16(value) __swap_int32(value)
|
# define HOST_ENDIAN_TO_BFS_INT64(value) __swap_int64(value)
|
||||||
# define BFS_ENDIAN_TO_HOST_INT16(value) __swap_int64(value)
|
|
||||||
# endif
|
|
||||||
#else
|
#else
|
||||||
// ToDo: maybe build a version that supports both, big & little endian?
|
// ToDo: maybe build a version that supports both, big & little endian?
|
||||||
// But since that will need some kind of global data (to
|
// But since that will need some kind of global data (to
|
||||||
|
|||||||
Reference in New Issue
Block a user