Feature Request: Preproc. Options
BlitzMax Forums/BlitzMax Programming/Feature Request: Preproc. Options
| ||
I just wanted to ask for more preprocessor options (listed below). ?Release (I can think of some practical uses for this, but I'd include it just for completeness's sake) Function Foo( ) ?Release Fail Silently ?Debug EXPLOSION ? End Function ?Define ?Define Bool Int Local foo:Bool = False ' Really an Int ?IfDef / ?Else / ?IfNDef / ?EndIf ?Define USE_DOUBLE ... ?IfDef USE_DOUBLE ?Define Number Double ?Else ?Define Number Float ?EndIf ?UnDefine ?IfDef Foo ?Undefine Foo ?Define Bar ?EndIf None of those are hard to do when preprocessing (I wrote one of the preprocessors for Blitz3D, and I know it isn't difficult). |
| ||
I secod the motion :) |
| ||
Motion.. PELVIC THRUST! |
| ||
Figure I'll bump this. |
| ||
Sounds like a step towards Macros! :-D |
| ||
This would be really nice! But you could also probably write a simple preprocessor with all these things. BPP 1.0 |
| ||
would it not be possible to just write your own preprosessor for max as a module and just plug its ass in ? |
| ||
would it not be possible to just write your own preprosessor for max as a module and just plug its ass in ? Thing is, it would have to run before the source is compiled. |
| ||
Actually, last night when I was trying to go to sleep and I couldn't because my brain wouldn't stop trying to think of stuff, I determined that with BlitzMax it would be more difficult than it sounds to have a preprocessor that shares macros across modules/files. As you should all know, a preprocessor works on the code before it is compiled, and because Import compiles code then links it (as far as I know, anyways), that would mean all preprocessor information (macros, definitions, etc.) would be lost upon import, so you'd basically have to either A. have an include file in all imported files or B. have to re-write macros in each and every file. Both are not-that-pleasant ways of dealing with the problem. So, as easy as it sounds, this isn't like writing a preprocessor for languages that merely include headers because sometimes you're importing already-compiled code and the compiled code shouldn't (it could in comments, but that would be a messy way to handle it because then you'd have to preprocess the compiled code as well and that just means more time spent building your application) have the preprocessor data saved in it. I pretty much lost where I was going with that, but I just woke up, so I -almost- have an excuse. |
| ||
Without a ?Release macro, there is no way to import a release static lib for release build, and a debug static lib for debug build. |
| ||
Isn't '?Release' just the same as '?not debug' |
| ||
Well that's convenient! |
| ||
Macros? Give 'em to me : D |
| ||
Are nested preprocessor statements not allowed?:?win32 ?debug ? ?not debug ? ? |