21.c 429 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /* accept 'defined' as result of substitution */
  2. ----- 1 ------
  3. #define AAA 2
  4. #define BBB
  5. #define CCC (defined ( AAA ) && AAA > 1 && !defined BBB)
  6. #if !CCC
  7. OK
  8. #else
  9. NOT OK
  10. #endif
  11. ----- 2 ------
  12. #undef BBB
  13. #if CCC
  14. OK
  15. #else
  16. NOT OK
  17. #endif
  18. ----- 3 ------
  19. #define DEFINED defined
  20. #define DDD (DEFINED ( AAA ) && AAA > 1 && !DEFINED BBB)
  21. #if (DDD)
  22. OK
  23. #else
  24. NOT OK
  25. #endif
  26. ----- 4 ------
  27. #undef AAA
  28. #if !(DDD)
  29. OK
  30. #else
  31. NOT OK
  32. #endif