The following works for me:

$ sdcc -mpic16 -p18F25J50 -E -Wp,-dM t.c
#define STACK_MODEL_SMALL 1
#define __pic16 1
#define __STDC_HOSTED__ 0
#define pic18f25j50 1
#define SDCC 312
#define SDCC_REVISION 7243
#define __18f25j50 1
#define SDCC_pic16 1
#define __STDC__ 1

So you should use #ifdef __18f25j50 or #ifdef pic18f25j50.

Borut


On 01. 02. 2012 17:55, Raphael Neider wrote:
> Dear Tamas,
>
>> I need to know which compiler directives are set. Can be they dumped during 
>> the compilation process? I'd like to check if __18F25J50 is in the list.
> You should be able to use 'sdcc -Wp,-dM [more options] source.c' to
> obtain a list of defined preprocessor makros (inherited from GNU CPP,
> see info gcc) -- actually, that does not work: the preprocessor bails
> out with 'ISO forbids empty source file' -- there is probably some
> empty argument passed along, not sure.
> As a workaround, you can call 'sdcc -V [more options] source.c' to see
> how the preprocessor is invoked, copy that and add -dM to its
> arguments.
>
> Alternatively you believe me that the desired makro is not defined
> (sdcc does not generate it, the included header file (if any)
> apparently does not define it, so where would it come from?), but you
> can easily add -D__18F25J50 to the sdcc command line to achieve the
> desired effect.
> You may also want to add --use-non-free to gain access to the device
> headers and libraries ...
>
> Raphael
>

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to