In a project where the __FILE__
and __DATE__
macros are used in one of the modules, I am trying to redefine the values of these macros to explicit values during build time. Trying to use the -D
option, like -D__TIME__=01:23:45
gave me a compilation error.
Compiling ./Console.c
In file included from <built-in>:324:
<command line>:41:9: error: redefining builtin macro [-Werror,-Wbuiltin-macro-redefined]
#define __TIME__ 01:23:45
^
1 error generated.
Is there a way to set these macros (and similar predefined macros) from the command line, w/o altering the source code itself?