Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Actions/Action_impl_python.hpp

    rd628da r6ba9ba  
    1818#include <boost/preprocessor/facilities/expand.hpp>
    1919#include <boost/preprocessor/iteration/local.hpp>
     20#include <boost/preprocessor/list/adt.hpp>
    2021#include <boost/preprocessor/punctuation/comma_if.hpp>
    21 
    22 #define NODEFAULT ""
     22#include <boost/preprocessor/punctuation/paren.hpp>
    2323
    2424// some derived names: if CATEGORY is not given, we don't prefix with it
     
    3232#define PARAMS BOOST_PP_CAT(ACTIONNAME, Parameters)
    3333#endif
     34
     35// for paramdefaults entries
     36#define PARAM_DEFAULT(x) \
     37    (x, BOOST_PP_NIL)
    3438
    3539// check if no lists given
     
    6165  BOOST_PP_SEQ_ELEM(n, STRINGLIST) \
    6266  ) \
    63   = BOOST_PP_SEQ_ELEM(n, DEFAULTLIST)
     67  = \
     68  BOOST_PP_IF( \
     69      BOOST_PP_NOT( BOOST_PP_LIST_IS_NIL( BOOST_PP_SEQ_ELEM(n, paramdefaults) ) ), \
     70      toString BOOST_PP_LPAREN() \
     71          BOOST_PP_LIST_FIRST( BOOST_PP_SEQ_ELEM(n, DEFAULTLIST) ) \
     72      BOOST_PP_RPAREN(), \
     73      std::string("") \
     74  )
    6475
    6576// print a list of comma-separated list, i.e. (,)arg("Action")
     
    142153#undef PARAMS
    143154#undef MAXPARAMTYPES
     155#undef PARAM_DEFAULT
    144156
    145157#undef help_print
Note: See TracChangeset for help on using the changeset viewer.