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++
12603 Discussions

Macro Indicating NIOS Compilation?

Altera_Forum
Honored Contributor II
1,202 Views

In my code I can do something like: 

 

# ifdef _WIN32 .... # endif  

 

To only include code on a Windows target. Is there a similar symbol that is automatically defined by the NIOS IDE when compiling? I am making a library that I am debugging on Windows and would like to include both NIOS and Windows code separated in this manor, and I would prefer an automatic symbol over a custom made one.
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
290 Views

You can define any symbol you want in the build->preprocessor options. 

If you don't want to add extra symbols and use default project settings, I think you can exploit ALT_DEBUG and ALT_RELEASE.
0 Kudos
Altera_Forum
Honored Contributor II
290 Views

 

--- Quote Start ---  

You can define any symbol you want in the build->preprocessor options. 

If you don't want to add extra symbols and use default project settings, I think you can exploit ALT_DEBUG and ALT_RELEASE. 

--- Quote End ---  

 

 

Those might be good... for extra portability across projects I would rather it be something default as opposed to something we assigned.
0 Kudos
Altera_Forum
Honored Contributor II
291 Views

RTFM: 

 

Try: gcc -E -dM empty_file.c 

 

__NIOS2__
0 Kudos
Altera_Forum
Honored Contributor II
291 Views

 

--- Quote Start ---  

RTFM: 

 

Try: gcc -E -dM empty_file.c 

 

__NIOS2__ 

--- Quote End ---  

 

 

I RTFM, however this detail somehow managed to escape my memory (weird right?)... 

 

Anyways that's what I wanted so I'll let you're smugness slide... This time...
0 Kudos
Reply