Trying to apply a default value in my code when compiling the file.
I need to set a defined key word to a certain value in my code.
So when I compile the code and it doesn't receive any definition in the arguments of the compiler it will use my default value.
I'm not to sure on how to do this, but I got a little idea:
#ifndef MAXWORKLOAD
#define MAXWORKLOAD 10
#endif
So if I put this in the code and I use this command line in the argument:
gcc -W -Wall
It will use 10 has default?
And if I use this command line on the compilation:
gcc -W -Wall -DMAXWORKLOAD=5
It will use the 5 as its new setting?
I'm not too clear from reading the documentation on this.