test_call_site_size_conditional.c 610 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #define ZF_LOG_LEVEL ZF_LOG_INFO
  2. #include <zf_log.h>
  3. #include <time.h>
  4. #if TEST_CONDITION
  5. #define CONDITION 1 < 2
  6. #else
  7. #define CONDITION 1 > 2
  8. #endif
  9. #define LOG_SOME_ONCE \
  10. ZF_LOG_IF(CONDITION, ZF_LOGI("Lorem ipsum dolor sit amet")); \
  11. time(0); \
  12. static void log_some()
  13. {
  14. LOG_SOME_ONCE
  15. LOG_SOME_ONCE
  16. LOG_SOME_ONCE
  17. LOG_SOME_ONCE
  18. LOG_SOME_ONCE
  19. LOG_SOME_ONCE
  20. LOG_SOME_ONCE
  21. LOG_SOME_ONCE
  22. LOG_SOME_ONCE
  23. LOG_SOME_ONCE
  24. LOG_SOME_ONCE
  25. LOG_SOME_ONCE
  26. LOG_SOME_ONCE
  27. LOG_SOME_ONCE
  28. LOG_SOME_ONCE
  29. LOG_SOME_ONCE
  30. }
  31. int main(int argc, char *argv[])
  32. {
  33. (void)argc; (void)argv;
  34. log_some();
  35. return 0;
  36. }