Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12745 Discussions

NIOS2 compiler defined macros

Altera_Forum
Honored Contributor II
1,226 Views

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, 

--tim
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
427 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
427 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
427 Views

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
0 Kudos
Reply