News for hackers. Stuff that matters.
Re:Show HN: Yupp, yet another C preprocessor by in4lio on Tuesday September 15, 2015 @06:36PM (#10223583)
Yes, you are right. Since yupp is a third layer, yupp is able to generate C macros, for example:

  ($define,,assert_bit_mask( value, mask, op ),,($do ]
      bool test = ((( value ) & ( mask )) == ( mask ));
      if ( !test ) {
          ut_fault( "expected mask to be set", __FILE__,  __FUNCTION__, __LINE__ );
          op;
      }
  [ ))
will result in:

  #define assert_bit_mask( value, mask, op ) do { \
      bool test = ((( value ) & ( mask )) == ( mask )); \
      if ( !test ) { \
          ut_fault( "expected mask to be set", __FILE__,  __FUNCTION__, __LINE__ ); \
          op; \
      } \
  } while ( 0 )
but you don't need to think about backslashes)

There are no comments on this comment yet.