Forum Discussion
Altera_Forum
Honored Contributor
15 years agoNIOS2 compiler defined macros
Can someone point me to a list of compiler defined macros that are present for NIOS2? I was hoping to use something like gcc's __TIMESTAMP__, but that doesn't work and I'm not sure if something similar exists that I can use.
Much thanks, --tim3 Replies
- Altera_Forum
Honored Contributor
The compiler is gcc, there is a 'magic' incantation to get the predefined macros preinted (but I can't remember off hand what it is).
You might be looking for __DATE__ and __TIME__ which are part of the C standard. - Altera_Forum
Honored Contributor
The expansions generated by the C pre-processor are output by:
cpp -dM /dev/null but this seems to exclude __DATE__ __TIME__ __FILE__ __FUNCTION__ etc. - Altera_Forum
Honored Contributor
dsl,
Thanks a bunch for the pointer. I guess I should have just tried __DATE__ and __TIME__ in the first place. I was kinda hoping if they were documented I'd find some other useful tidbits that I might be able to use as well. Thanks again, --tim