Skip to main content
2 of 2
Add note that the question was edited according to the answer, which makes everything confusing
per1234
  • 4.3k
  • 2
  • 24
  • 44

The code is working properly. You have mixed up your error messages. The code should be:

#if defined(TEST)
  #error "DEFINED"
#else
  #error "NOT DEFINED"
#endif

UPDATE: The question was edited after the time of this answer to correct the mixed up error messages.

per1234
  • 4.3k
  • 2
  • 24
  • 44