Skip to content

Commit b2936a1

Browse files
Infer bitfied order from architecture instead of checking it at configure time.
1 parent 0d8d9f7 commit b2936a1

File tree

3 files changed

+9
-64
lines changed

3 files changed

+9
-64
lines changed

config/qthread_check_bitfield_order.m4

Lines changed: 0 additions & 58 deletions
This file was deleted.

configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,6 @@ esac
614614
AS_IF([test "x$enable_hardware_atomics" != xno],
615615
[QTHREAD_CHECK_ATOMICS($sizeof_aligned_t)])
616616
QTHREAD_VAMACROS
617-
QTHREAD_CHECK_BITFIELDS
618617

619618
QTHREAD_MALLOC_ATTRIBUTE
620619
QTHREAD_UNUSED_ATTRIBUTE

include/qthread/common.h.in

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,15 @@
2929
/* Allow functions to be inlined */
3030
#undef QINLINE
3131

32-
/* Define if bitfields are in forward order */
33-
#undef BITFIELD_ORDER_FORWARD
34-
35-
/* Define if bitfields are in reverse order */
36-
#undef BITFIELD_ORDER_REVERSE
32+
#ifndef __powerpc
33+
#define BITFIELD_ORDER_REVERSE
34+
#else
35+
// ARM processors can technically change modes between
36+
// big-endian and little-endian which also reverses the
37+
// bitfield order. The overwhelming majority of the time
38+
// they're run in little-endian mode though.
39+
#define BITFIELD_ORDER_FORWARD
40+
#endif
3741

3842
/* The size of `void*', as computed by sizeof. */
3943
#undef SIZEOF_VOIDP

0 commit comments

Comments
 (0)