Page 1 of 1

Do you use a type of define'd flag system for your projects?

Posted: Sun May 13, 2007 3:40 pm
by earlz
I have realized that I use a #define'd system for configuration, the thing that's weird, is I have two of these flags in common with nearly every project I make..
one is
"LOW_MEMORY" which when defined will attempt to conserve memory at all costs

and then I got "SPEED_UP" which when defined will use potentially unsafe optimizations; also, it will attempt to do more caching and will optimize for CPU time fastness...this bascially doesn't go along with LOW_MEMORY, but anyway...

does anyone else do things this way for every project?

Posted: Sun May 13, 2007 3:59 pm
by neon
I sometimes do. I useually create #defines to help portability,
and create different modes (Debug, release). I sometimes
define COMPACT, which is simular to your LOW_MEMORY directive.

Posted: Sun May 13, 2007 4:00 pm
by frank
I use a DEBUG define when I need the code to print out a lot of debugging information.

Posted: Sun May 13, 2007 4:33 pm
by Brynet-Inc
DEBUG is quite common, Using defines for portability is also helpful..

Notably being able to add OS specific patches.. or workarounds for compiler versions etc..

Here is a handy site to find some common defines 8)

http://predef.sourceforge.net/

Autoconf is one viable way to check what is and what is not available on a specific system..