[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] GCC platform specific identification?

From: Julius Luukko
Subject: Re: [avr-gcc-list] GCC platform specific identification?
Date: Tue, 31 Jul 2007 13:04:26 +0300
User-agent: KMail/1.9.7

On Tuesday 31 July 2007, Schwichtenberg, Knut wrote:
> Hi,
> is there a cpp-macro / definition to distiguish between the different
> gcc platform implementations? I read the cpp-man describing "__xxx__"
> macros like __GNUC__ and did not find any. But there may be one not
> officially documented. At least I want to know within my source code if
> the file is compiled for an AVR or a PC, etc. Of course I can do this be
> a self created definition, but a pre-defined solution is preferable.
> Knut

Hello Knut,

At least __AVR__ is defined as well as AVR variant specific (__AVR_ATmega8__ 
etc.). With any gcc, there is an easy way to find predefined constants

$ cpp -dM /dev/null

With windows replace /dev/null with NUL. You might also have to append the 
same command line parameters as your project needs.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]