X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Packets%2FParseHelpers.ih;h=942281165245c5719dc517eb5ab8cbb4200d686a;hb=3593676775cfadb0094eb4f472c6ced0763e0068;hp=43f8b0f5502d5b3b04dbb66a34154ca104a7f8ec;hpb=43ebe17b77586542dff65f2535815a19812e4316;p=senf.git diff --git a/Packets/ParseHelpers.ih b/Packets/ParseHelpers.ih index 43f8b0f..9422811 100644 --- a/Packets/ParseHelpers.ih +++ b/Packets/ParseHelpers.ih @@ -150,10 +150,12 @@ size_type BOOST_PP_CAT(name,_offset)() const { \ return field_offset_(static_cast*>(0)); \ } \ - static size_type const BOOST_PP_CAT(name, _init_bytes) = SENF_MPL_SLOT_GET(init_bytes); + static size_type const BOOST_PP_CAT(name, _init_bytes) = \ + SENF_MPL_SLOT_GET(init_bytes); # # define SENF_PARSER_I_FIELD_OFS_fix(name, type, access) \ - static size_type const BOOST_PP_CAT(name, _offset) = SENF_MPL_SLOT_GET(offset); + static size_type const BOOST_PP_CAT(name, _offset) = \ + SENF_MPL_SLOT_GET(offset); # # //////////////////////////////////////// # // SENF_PARSER_I_ADVANCE_OFS_* @@ -287,12 +289,12 @@ return field_offset_(static_cast*>(0)) \ - SENF_MPL_SLOT_GET(bitfield_size); \ } \ - static size_type const BOOST_PP_CAT(name, _init_bytes) = SENF_MPL_SLOT_GET(init_bytes) \ - - SENF_MPL_SLOT_GET(bitfield_size); + static size_type const BOOST_PP_CAT(name, _init_bytes) = \ + SENF_MPL_SLOT_GET(init_bytes) - SENF_MPL_SLOT_GET(bitfield_size); # # define SENF_PARSER_I_BITFIELD_OFS_fix(name, type, access) \ - static size_type const BOOST_PP_CAT(name, _offset) = SENF_MPL_SLOT_GET(offset) \ - - SENF_MPL_SLOT_GET(bitfield_size); + static size_type const BOOST_PP_CAT(name, _offset) = \ + SENF_MPL_SLOT_GET(offset) - SENF_MPL_SLOT_GET(bitfield_size); # # //////////////////////////////////////// # // SENF_PARSER_I_BITFIELD_RESET @@ -327,7 +329,9 @@ # define SENF_PARSER_SKIP_BITS_fix(bits) SENF_PARSER_I_SKIP_BITS(bits, fix) # # define SENF_PARSER_I_SKIP_BITS(bits, ofstype) \ - SENF_MPL_SLOT_SET(bit, SENF_MPL_SLOT_GET(bit) + bits) + private: \ + SENF_MPL_SLOT_SET(bit, SENF_MPL_SLOT_GET(bit) + bits); \ + public: # # /////////////////////////////////////////////////////////////////////////// # // SENF_PARSER_GOTO_* @@ -462,6 +466,8 @@ # define SENF_CAT_RECURS1_I(a, b) a ## b # define SENF_CAT_RECURS2(a, b) SENF_CAT_RECURS2_I(a,b) # define SENF_CAT_RECURS2_I(a, b) a ## b +# define SENF_CAT_RECURS3(a, b) SENF_CAT_RECURS3_I(a,b) +# define SENF_CAT_RECURS3_I(a, b) a ## b # # define SENF_PARSER_COLLECTION_TAG_GOBBLE__transform(x,y) # define SENF_PARSER_COLLECTION_TAG__transform(x,y) \ @@ -490,6 +496,11 @@ # define SENF_PARSER_COLLECTION_HAS_KEYWORD(x) \ BOOST_PP_IS_EMPTY( SENF_CAT_RECURS1(SENF_PARSER_COLLECTION_TAG_GOBBLE__, x) ) # +# define SENF_PARSER_COLLECTION_GETAUX(aux) \ + BOOST_PP_IF( SENF_PARSER_COLLECTION_HAS_KEYWORD(aux), \ + SENF_CAT_RECURS2(SENF_PARSER_COLLECTION_TAG_GETAUX__, aux), \ + aux ) + # define SENF_PARSER_COLLECTION_I(access, name, aux, traits) \ BOOST_PP_EXPAND( \ SENF_PARSER_COLLECTION_II \