magic_func.h 465 B

123456789101112131415161718192021
  1. /*
  2. * 文件名: magic_func.h
  3. * 目标: 定义魔法函数的名字
  4. */
  5. #ifndef AFUN_MAGIC_FUNC_H
  6. #define AFUN_MAGIC_FUNC_H
  7. /* 魔法函数 */
  8. #define MAGIC_NAME_BASE(type) "magic-" #type ":"
  9. #define MAGIC_NAME(type, job) (MAGIC_NAME_BASE(type) #job)
  10. /* gc模块 */
  11. #define mg_gc_destruct MAGIC_NAME(gc, destruct)
  12. /* 内置环境变量 */
  13. #define SYS_NAME(job) ("sys-" #job)
  14. /* gc模块 */
  15. #define ev_sys_prefix SYS_NAME(prefix)
  16. #endif //AFUN_MAGIC_FUNC_H