Title says it all.
I'd like to be able to pass version numbers in as command-line defines,
then do some magic such that they can appear both in strings and in
numbers.
So, I call something like:
g++ -DMAJOR_VERSION=3 -DMINOR_VERSION=10 version.cpp
and in the code I do one thing in one place:
unsigned int major = MAJOR_VERSION;
unsigned int minor = MINOR_VERSION;
and in another I end up with a string that says
"blah tee blah tee blah version 3.10"
But -- how do I make the blasted string?
At worst, I can make everything strings and use str2long, but I prefer to
do as much during the compilation step as possible.
--
My liberal friends think I'm a conservative kook.
My conservative friends think I'm a liberal kook.
Why am I not happy that they have found common ground?
Tim Wescott, Communications, Control, Circuits & Software
http://www.wescottdesign.com