conditional compile else?
BlitzMax Forums/BlitzMax Programming/conditional compile else? Const PLATFORM = "Win32"
If PLATFORM = "Win32"
...
End if
That should work? AFAIK, it will only compile if the parts of the if statement that evaluate to true.
If PLATFORM = "Win32"
...
End if
That should work? AFAIK, it will only compile if the parts of the if statement that evaluate to true.
well, yes, but I was hoping that the ? compiler directive had this functionality.
The code from zeedoktor achieves the same thing.
No, that's not, but the more code you want to conditionally compile, the more annoying it becomes.
*EDIT*
And let's imagine for a moment that BMax gets ported to WinCE and PalmOS and heck, the gameboy.
you'd then have 6 os's to do instead of 3.
*EDIT*
And let's imagine for a moment that BMax gets ported to WinCE and PalmOS and heck, the gameboy.
you'd then have 6 os's to do instead of 3.
A little off topic here:
i recon someone gets it working on a Gamecube sometime (it uses the PPC processor, no? and they just managed to get linux working on a GC....)
Hey.. thats another question.. would bmax run on linux running on a mac? :S
i recon someone gets it working on a Gamecube sometime (it uses the PPC processor, no? and they just managed to get linux working on a GC....)
Hey.. thats another question.. would bmax run on linux running on a mac? :S
Hi,
You're all assuming that we're going to have full access to the other machines.
Consider Perturbatio's point another way.
What if you only had a win32 pc and had friends with registered bmax to compile for linux/mac ? it would be nice to have a command that returns the id or something.
It's not essential but nice all the same.
You're all assuming that we're going to have full access to the other machines.
Consider Perturbatio's point another way.
What if you only had a win32 pc and had friends with registered bmax to compile for linux/mac ? it would be nice to have a command that returns the id or something.
It's not essential but nice all the same.
Silly question, but what does the ? do?
Const PLATFORM = "Win32"
If PLATFORM = "Win32"
...
End if
That should work? AFAIK, it will only compile if the parts of the if statement that evaluate to true.
If PLATFORM = "Win32"
...
End if
That should work? AFAIK, it will only compile if the parts of the if statement that evaluate to true.
(And all variations)
Normally, you want to call different functions and import different libraries etc on different platforms, and ? is a preprocessor directive so anything thrown out the compiler will never see. Blocks of code wrapped in If <0> will still be parsed. ? will allow you to import different source files depending on the platform. If <Const> will not.
Hey.. thats another question.. would bmax run on linux running on a mac? :S
I believe the exes are x86 exes not ppc ones, so probably not. You might get mac exes running under mac linux? But then you may as well just run macos ;]
? will allow you to import different source files depending on the platform. If <Const> will not.
Why not? I still don't understand the difference. If 0=1 doesn't get compiled... Or does it? It shouldn't.
It isn't added to the EXE (AFAIK), but it IS parsed. Try to compile this:
Further, Import must appear at the top of a source file, so:
Will not work. You can use Include in this way, though.
If 0 Then (*&%*$#&%(#^#$%#$%
Further, Import must appear at the top of a source file, so:
If Win32 Import "Win32Code.bmx" ElseIf Linux Import "LinuxCode.bmx" Else Import "MacOSCode.bmx" Endif
Will not work. You can use Include in this way, though.
It isn't added to the EXE (AFAIK), but it IS parsed.
Fascinating. That seems totally illogical to me =]