__macro.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef VIRTUALMATH___MACRO_H
  2. #define VIRTUALMATH___MACRO_H
  3. #include <stdio.h>
  4. #include <string.h>
  5. #include <stdlib.h>
  6. #include <stdarg.h>
  7. #include <getopt.h>
  8. #define bool int
  9. #define true 1
  10. #define false 0
  11. #define PASS do{}while(0)
  12. #define NUMBER_TYPE long int
  13. #define HASH_INDEX unsigned int
  14. #define INTER_FUNCTIONSIG_CORE struct Inter *inter, struct VarList *var_list
  15. #define INTER_FUNCTIONSIG Statement *st, INTER_FUNCTIONSIG_CORE
  16. #define CALL_INTER_FUNCTIONSIG_CORE(var_list) inter, var_list
  17. #define CALL_INTER_FUNCTIONSIG(st, var_list) st, CALL_INTER_FUNCTIONSIG_CORE(var_list)
  18. #define freeBase(element, return_) do{ \
  19. if (element == NULL){ \
  20. goto return_; \
  21. } \
  22. }while(0) \
  23. #define run_continue(result) (result.type == not_return || result.type == operation_return)
  24. #define run_continue_(result) (result->type == not_return || result->type == operation_return)
  25. #define is_error(result) (result.type == error_return)
  26. #define checkResult(check_result) do{ \
  27. if (is_error(check_result)){ \
  28. return check_result; \
  29. } \
  30. }while(0) \
  31. #endif //VIRTUALMATH___MACRO_H