Advertisement
Guest User

Untitled

a guest
Nov 14th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #define MACROTABLE(ID,NAME,...) \
  2. static const int COMMAND_##NAME = ID; \
  3. struct command_##NAME { \
  4. __VA_ARGS__ \
  5. }; \
  6. static const int COMMAND_##NAME##_sizeof = sizeof(command_##NAME);
  7.  
  8. //EXAMPLE
  9. MACROTABLE(1234, step,
  10. int kind;
  11. int size
  12. );
  13.  
  14. -->
  15.  
  16. static const int COMMAND_step = 1234;
  17. struct command_step {
  18. int kind;
  19. int size;
  20. };
  21. static const int COMMAND_step_sizeof = 8;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement