Author Topic: conditional ifdef, how to do OR statement?  (Read 6291 times)

0 Members and 1 Guest are viewing this topic.

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
conditional ifdef, how to do OR statement?
« on: October 15, 2009, 04:32:27 PM »
I can't figure out how to do an OR statement using ifdef.

My best guess:
Code: [Select]
     #ifdef MACRO1 || MACRO2
     
     controlled text
     
     #endif

but it doesn't work . . .
../file.h:156:18: warning: extra tokens at end of #ifdef directive

Anyone know?

Offline supernoob

  • Jr. Member
  • **
  • Posts: 12
  • Helpful? 1
Re: conditional ifdef, how to do OR statement?
« Reply #1 on: October 15, 2009, 05:01:25 PM »
Try
Code: [Select]
#if defined(TEST_1) || defined(TEST_2)
// do stuff
#endif
« Last Edit: October 15, 2009, 05:04:43 PM by supernoob »

Offline AdminTopic starter

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,703
  • Helpful? 173
    • Society of Robots
Re: conditional ifdef, how to do OR statement?
« Reply #2 on: October 20, 2009, 12:28:56 PM »
It works! Thanks!

 


Get Your Ad Here