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 Diskussionen

Macro Indicating NIOS Compilation?

Altera_Forum
Geehrter Beitragender II
1.443Aufrufe

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 Antworten
Altera_Forum
Geehrter Beitragender II
531Aufrufe

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.
Altera_Forum
Geehrter Beitragender II
531Aufrufe

 

--- 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.
Altera_Forum
Geehrter Beitragender II
532Aufrufe

RTFM: 

 

Try: gcc -E -dM empty_file.c 

 

__NIOS2__
Altera_Forum
Geehrter Beitragender II
532Aufrufe

 

--- 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...
Antworten