HALDLS
bitfield.h
Go to the documentation of this file.
1 #pragma once
2 #include <boost/preprocessor/seq/for_each.hpp>
3 #include <boost/preprocessor/seq/reverse.hpp>
4 
5 #define BITFIELD_ORDER_IDENTITY(r, data, elem) elem
6 
7 /* Unroll bitfield structs: PPC and x86 use different element orders (due to
8  * different endianess); choose one (x86) and reverse for the other
9  * architecture! */
10 #ifdef __ppu__
11 #define EXPAND_BITFIELD_ELEMENTS(x) \
12  BOOST_PP_SEQ_FOR_EACH(BITFIELD_ORDER_IDENTITY, _, BOOST_PP_SEQ_REVERSE(x))
13 #else
14 #define EXPAND_BITFIELD_ELEMENTS(x) BOOST_PP_SEQ_FOR_EACH(BITFIELD_ORDER_IDENTITY, _, x)
15 #endif