What compiler directives exists?

BlitzMax Forums/BlitzMax Beginners Area/What compiler directives exists?

fredborg(Posted 2004) [#1]
Just a small question, about what the different compiler directives/conditional compile options exists.

I know the following:
?Win32
?MacOS
?Linux
?Debug (<- a really nice one)

Are there more? Like ?IDE/?Executable or others?
And is it possible to add your own? Like ?DemoVersion/?FullVersion


Bot Builder(Posted 2004) [#2]
Great question. Something I'd like to know. Good thing I searched before posting a topic :) I was gonna post this example:

Global Debug=0

?Mac
Print "On mac"
?

?win32
Print "On"
Print "Windows"
?

?linux
Print "On linux"
?

?debug
Print "In debug mode"
Global Debug=1
?

If Debug=0 Then Print "In release mode"


I've sortof made my own Release mode handler above, I'd like to know what the "?" thing for it is though. Since, Release is also a keyword so you cant use it. This stuff really should be documented


Hotcakes(Posted 2004) [#3]
Browsing thru module sources, I have also witnessed the following:
?PPC
?x86
?BigEndian
?LittleEndian


Bot Builder(Posted 2004) [#4]
This might be asking a bit much, but howbout in modules if it comes across "?strict" (or ?notstrict if its not declared strict) it will only compile the code if the program using it is in strict mode, or "?harsh" and "?notharsh".

Of course, ?Release would be great to have.


The Caffeine Kid(Posted 2005) [#5]
I would really love to know if there is something like this:-

"And is it possible to add your own? Like ?DemoVersion/?FullVersion"

I want to only incbin certain files on a condition such as whether im building a demo or a full game version, rather than duplicating the source and making changes.

Also this would be good for building versions for different languages...

I want to incbin different graphics for different language versions but I dont think this is possible? :(


Dreamora(Posted 2005) [#6]
You could modify the BMK according to your wishes ie extend it with the needed preprocessor capabilities