Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
978 B

  1. //
  2. // Macros that create storage for vars
  3. //
  4. //
  5. // Clear any previous definitions of the macros.
  6. //
  7. #undef DC_DATA
  8. #undef DC_DATA_VAL
  9. #undef DC_CONST_DATA
  10. #undef DC_DATA_ARRAY
  11. #undef DC_CONST_DATA_ARRAY
  12. #undef DC_DATA_2D_ARRAY
  13. #undef DC_CONST_DATA_2D_ARRAY
  14. // This is for structs that can't use the DC_DATA macros; they can switch on it
  15. #define DC_DEFINE_DATA
  16. //
  17. // Allocate Storage
  18. //
  19. #define DC_DATA(TYPE, Name) \
  20. TYPE Name
  21. #define DC_DATA_VAL(TYPE, Name, Value) \
  22. TYPE Name = Value
  23. #define DC_CONST_DATA(TYPE, Name, Value) \
  24. const TYPE Name = Value
  25. #define DC_DATA_ARRAY(TYPE, Name, Size) \
  26. TYPE Name[Size]
  27. #define DC_CONST_DATA_ARRAY(TYPE, Name, Size, Value) \
  28. const TYPE Name[Size] = Value
  29. #define DC_DATA_2D_ARRAY(TYPE, Name, Size1, Size2) \
  30. TYPE Name[Size1][Size2]
  31. #define DC_CONST_DATA_2D_ARRAY(TYPE, Name, Size1, Size2, Value) \
  32. const TYPE Name[Size1][Size2] = Value