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

Re: [MiNT] GCC: identify target at compile time



On Monday 24 December 2012 15:30:54 Vincent Rivière wrote:
> On 24/12/2012 15:24, Jean-François Lemaire wrote:
> > I'm looking for a way to identify the target of GCC builds at compile time
> > so that I can identify if the version of the program I'm compiling is
> > m68k or v4e.
> 
> The easiest solution is to do that:
> 
> const char* get_target(void)
> {
> #ifdef __mcoldfire__
>      return "ColdFire";
> #else
>      return "m68k";
> #endif
> }

Thanks for the very quick response. This is exactly what I wanted! It works 
perfectly.

Cheers,
JFL
-- 
Jean-François Lemaire