Combining Compiler Conditions

BlitzMax Forums/BlitzMax Programming/Combining Compiler Conditions

beanage(Posted 2010) [#1]
Hey,

I was actually just extremely disappointed when this gave me an error:
?Threaded
'stuff in here is only to be compiled in threaded mode
?Win32 And Threaded 'does not work?!
'compile whatever here only in threaded mode on a win32 os!

Now, I am running out of ideas.. the following do not work either:
- ?Win32, Threaded
- ?Threaded Win32 '<= that would rock :P

I need to combine those conditions! But how?


Brucey(Posted 2010) [#2]
Yeah... that's unfortunate.

It's "bcc" which deals with this. Perhaps you can raise it as a bug, because it does somewhat limit what you can do.


beanage(Posted 2010) [#3]
Though I found my workaround, it is pretty ugly and I appreciate better ideas. Here I go:
File "ROOT.BMX" =============================================
?Threaded
Include "ROOT_THREADED_WIN32.bmx"

File "ROOT_THREADED_WIN32".BMX" =============================
?Win32
Print "You are running threaded mode on Win32!"


Ineffectice and ugly, as I said. But at least it works.


plash(Posted 2010) [#4]
Shouldn't this work?:
?Threaded
?Win32
' ...
?
?



beanage(Posted 2010) [#5]
@Plash: That was my first assumption actually, but the conditions are not being nested, and it's not working either. Unfortunately :(

Please consider my post above yours (we posted at the same time)!


jkrankie(Posted 2010) [#6]
I've always wondered why we can't do this.

Cheers
Charlie


ImaginaryHuman(Posted 2010) [#7]
What if you put your threaded stuff in a separate file and just change the name of the Include when you want to compile different versions, which is not often?


beanage(Posted 2010) [#8]
@IH: Well, a similar kind of include-file-workaround is what I already posted right after Brucey ;)
..different versions, which is not often?

Rather unfortunately, in my case it is pretty often.