Diff for /rpl/src/rplexternals.h between versions 1.50 and 1.51

version 1.50, 2013/04/02 11:56:33 version 1.51, 2013/04/03 09:40:31
Line 228 Line 228
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
 */  */
   
 #define declareInternalFunction(type, name, ...) \  #define CONCAT(a, b) __CONCAT(a, b)
     type __internal_##name(struct_rpl_arguments *rpl_arguments, __VA_ARGS__) { \  #define __CONCAT(a, b) a##b
   #define FIRST(...) FIRST_HELPER(__VA_ARGS__, throwaway)
   #define FIRST_HELPER(first, ...) first
   #define REST(...) REST_HELPER(NUM(__VA_ARGS__), __VA_ARGS__)
   #define REST_HELPER(qty, ...) REST_HELPER2(qty, __VA_ARGS__)
   #define REST_HELPER2(qty, ...) REST_HELPER_##qty(__VA_ARGS__)
   #define REST_HELPER_ONE(first)
   #define REST_HELPER_TWOORMORE(first, ...) , __VA_ARGS__
   #define NUM(...) \
           SELECT_10TH(__VA_ARGS__, TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE,\
           TWOORMORE, TWOORMORE, TWOORMORE, TWOORMORE, ONE, throwaway)
   #define SELECT_10TH(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, ...) a10
   
   #define declareInternalFunction(type, ...) \
       type CONCAT(__internal_, FIRST(__VA_ARGS__)) \
               (struct_rpl_arguments *rpl_arguments REST(__VA_ARGS__)) { \
       type __internal_return; __internal_return = 0; int __type; \
       DISABLE_SET_BUT_NOT_USED_WARNING(__type);
   
   #define endInternalFunction return(__internal_return); }
   
   #define useInternalFunction(type, ...) \
       type CONCAT(__internal_, FIRST(__VA_ARGS__)) \
               (struct_rpl_arguments *rpl_arguments REST(__VA_ARGS__))
   
 #define endInternalFunction leave; }  #define callInternalFunction(...) \
       CONCAT(__internal_, FIRST(__VA_ARGS__))(rpl_arguments REST(__VA_ARGS__))
 #define useInternalFunction(type, name, ...) \  
     type __internal_##name(struct_rpl_arguments *rpl_arguments, __VA_ARGS__)  
   
 #define callInternalFunction(name, ...) \  
     __internal_##name(rpl_arguments, __VA_ARGS__)  
   
 /*  /*
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------
Line 246 Line 264
 */  */
   
 #define declareCFunction(type, name, ...) \  #define declareCFunction(type, name, ...) \
         type name(__VA_ARGS__) { __RPL__          type name(__VA_ARGS__) { __RPL__ type __c_return;
 #define endCFunction leave; }  #define endCFunction return(__c_return); }
   
 /*  /*
 --------------------------------------------------------------------------------  --------------------------------------------------------------------------------

Removed from v.1.50  
changed lines
  Added in v.1.51


CVSweb interface <joel.bertrand@systella.fr>