Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
14 years ago

NIOS2 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,

--tim

3 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored 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