Guest User

Untitled

a guest
Jan 16th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. #define COMMAND(__COMMAND__, __FORMAT__, ...)
  2. void __COMMAND__ ( __VA_ARGS__ ) {
  3. printf( __FORMAT__, ##__VA_ARGS__ );
  4. }
  5.  
  6. COMMAND( Start, "m start %cr", (char) unit )
  7. COMMAND( Home, "m homer" )
  8. COMMAND( Add_To_Chart, "cv 0 %d %dr", (int) ch1, (int) ch2 )
  9. // literally hundreds of additional COMMANDs needed here.
  10.  
  11. COMMAND( A, "cv 0 %d %dr", (int)ch1, (int)ch2 )
  12. // error: expected declaration specifiers or ‘...’ before ‘(’ token
  13. // void A ( (int)ch1, (int)ch2 ) {
  14. // printf( "cv 0 %d %dr", (int)ch1, (int)ch2 );
  15. // }
  16.  
  17. COMMAND( B, "cv 0 %d %dr", int(ch1), int(ch2) )
  18. // error: expected expression before ‘int’
  19. // void B ( int(ch1), int(ch2) ) {
  20. // printf( "cv 0 %d %dr", int(ch1), int(ch2) );
  21. // }
Add Comment
Please, Sign In to add comment