Pre-Processor Directive question

What is the difference between…



#ifdef HAS_SH1T



and



#if defined(HAS_SH1t)



? Sorry for the stupid question… but I’m trying to figure out what the equiv of say…



#if defined(HAS_SH1T)



#elif defined(HAS_OTHERSH1T)



#endif



is if your using #ifdef



Anyone?

@t0neg0d said:
What is the difference between...

#ifdef HAS_SH1T

and

#if defined(HAS_SH1t)

? Sorry for the stupid question... but I'm trying to figure out what the equiv of say...

#if defined(HAS_SH1T)

#elif defined(HAS_OTHERSH1T)

#endif

is if your using #ifdef

Anyone?

Not 100%sure but from my experience :
#ifdef SOME_DEFINE can't have multiple conditions
#if defined(conditions) can have (SOME_DEFINE1 || SOME_DEFINE2 && SOME_DEFINE3) type conditions

not sue about the #elif statement though but you can always use
#ifdef BLAH
#else
#ifdef BLAHBLAH
#endif
#endif

#ifdef STUFF

becomes

#if defined(STUFF)

that’s it.



Both of them are if statements except the first one is a shorthand for the second one.