__macro.h 994 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef VIRTUALMATH___MACRO_H
  2. #define VIRTUALMATH___MACRO_H
  3. #include "macro.h"
  4. // PASS语句的定义
  5. #define PASS do{}while(0)
  6. #define NUMBER_TYPE long int
  7. #define NUMBER_FORMAT "ld"
  8. #define HASH_INDEX unsigned int
  9. #define INTER_FUNCTIONSIG_CORE struct Inter *inter, struct VarList *var_list
  10. #define INTER_FUNCTIONSIG Statement *st, INTER_FUNCTIONSIG_CORE
  11. #define CALL_INTER_FUNCTIONSIG_CORE(var_list) inter, var_list
  12. #define CALL_INTER_FUNCTIONSIG(st, var_list) st, CALL_INTER_FUNCTIONSIG_CORE(var_list)
  13. #define run_continue(result) (result.type == not_return || result.type == operation_return)
  14. #define run_continue_(result) (result->type == not_return || result->type == operation_return)
  15. #define is_error(result) (result.type == error_return)
  16. #define freeBase(element, return_) do{ \
  17. if (element == NULL){ \
  18. goto return_; \
  19. } \
  20. }while(0) \
  21. #define checkResult(check_result) do{ \
  22. if (is_error(check_result)){ \
  23. return check_result; \
  24. } \
  25. }while(0) \
  26. #endif //VIRTUALMATH___MACRO_H