mkalltypes.sed 451 B

123456789101112131415
  1. /^TYPEDEF/s/TYPEDEF \(.*\) \([^ ]*\);$/#if defined(__NEED_\2) \&\& !defined(__DEFINED_\2)\
  2. typedef \1 \2;\
  3. #define __DEFINED_\2\
  4. #endif\
  5. /
  6. /^STRUCT/s/STRUCT * \([^ ]*\) \(.*\);$/#if defined(__NEED_struct_\1) \&\& !defined(__DEFINED_struct_\1)\
  7. struct \1 \2;\
  8. #define __DEFINED_struct_\1\
  9. #endif\
  10. /
  11. /^UNION/s/UNION * \([^ ]*\) \(.*\);$/#if defined(__NEED_union_\1) \&\& !defined(__DEFINED_union_\1)\
  12. union \1 \2;\
  13. #define __DEFINED_union_\1\
  14. #endif\
  15. /