__macro.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #define bool int
  8. #define true 1
  9. #define false 0
  10. #define PASS do{}while(0)
  11. #define NUMBER_TYPE long int
  12. #define HASH_INDEX unsigned int
  13. #define INTER_FUNCTIONSIG_CORE Inter *inter, VarList *var_list
  14. #define INTER_FUNCTIONSIG Statement *st, INTER_FUNCTIONSIG_CORE
  15. #define CALL_INTER_FUNCTIONSIG_CORE(var_list) inter, var_list
  16. #define CALL_INTER_FUNCTIONSIG(st, var_list) st, CALL_INTER_FUNCTIONSIG_CORE(var_list)
  17. #define freeBase(element, return_) do{ \
  18. if (element == NULL){ \
  19. goto return_; \
  20. } \
  21. }while(0) \
  22. #define runContinue(result) (result.type == not_return || result.type == operation_return)
  23. #define is_error(result) (result.type == error_return)
  24. #define safeIterStatement(new_result, sig) do{ \
  25. new_result = iterStatement(sig); \
  26. if (is_error(new_result)){ \
  27. return new_result; \
  28. } \
  29. } while(0)
  30. #define checkResult(check_result) do{ \
  31. if (is_error(check_result)){ \
  32. return check_result; \
  33. } \
  34. }while(0) \
  35. #endif //VIRTUALMATH___MACRO_H