I want to pass a version string in the compile command:
$ g++ -Wall -D VERSION=\"2013-12-03 02:15:21, commit cb060df\" -o
You can write the TOSTR_ macro to take variable arguments:
TOSTR_
#define TOSTR_(x...) #x #define STRINGIFY(x) TOSTR_(x) #define VERSION_STR STRINGIFY(VERSION)
This code has been tested and works on Apple LLVM version 5.0.