Conditional compilation?

BlitzMax Forums/BlitzMax Programming/Conditional compilation?

Who was John Galt?(Posted 2005) [#1]
How can you identify if the code is compiling on a Mac or PC and include different code for each?


rdodson41(Posted 2005) [#2]
Im not sure but i think you can do something like
?MacOS
   Print("You are using MacOS!")
?

?Win32
   Print("You are using Win32!")
?

?Linux
   Print("You are using Linux!")
?

If you are using MacOS then it will only compile what is between the ?MacOS and ? and same for win32 and Iinux.


N(Posted 2005) [#3]
Or, just
Print "On platform.. "

?MacOS
Print "Mac"
' You don't need to add a blank ? per item
?Win32
Print "Win32"
?Linux
Print "Linux"
?

Print "OMGSUCCESS"


But, it would be nicer if you could do stuff like
?Define PREPROCDEF

?PREPROCDEF
?


<sarcasm>But then I think simple preprocessing like this is so difficult.</sarcasm>


Who was John Galt?(Posted 2005) [#4]
Cheers, fellows.

Some preprocessing stuff would be nice, but I won't hold my breath.