This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Macro declarations


The macro is not invoked inside a function. It is done global.
The exact error is parse error before " ' ". It is quite strange for me, because normally these type of errors appear when there is some syntatical error. But in this regard, I am kind of unable to figure out, because the syntax seems alright to me.


Thanks
Samie


From: Andrew Lunn <andrew@lunn.ch>
To: Samie Hassan Ghauri <samiehg@hotmail.com>
CC: ecos-discuss@sources.redhat.com
Subject: Re: [ECOS] Macro declarations
Date: Mon, 30 Aug 2004 20:09:07 +0200

On Mon, Aug 30, 2004 at 05:44:42PM +0000, Samie Hassan Ghauri wrote:
> I have defined the macro as follows in my header file:
>
> typedef struct lcd_funs lcd_funs;
> struct lcd_funs {
>  void (*decode_image)(cyg_uint32 imageWidth,
> 		       cyg_uint32 imageHeight,
> 		       Palette_element *paletteData,
> 		       cyg_uint8  *imageData,
> 		       cyg_uint16 bitsPerPixel
> 		       );
> };
>
> #define LCD_FUNS (  _l,                       \
> 	              _decode_image)    \
> lcd_funs _l = {                                     \
>  _decode_image                                  \
> };
>
> struct view_info{
>  lcd_funs     *funs;
> }; //view_info
>
> #define VIEW_INFO  (_l,           \
>                    _funs )                \
> view_info _l = {                        \
>  &_funs                                   \
> };
>
> I include it in my code file like this:
>
> LCD_FUNS  (nec_lcd_funs,                     // line 87
> 	   nec_decode_image           //  line 88
> 	  );

Some compilers don't like comments inside macros invocations :-)

>
> VIEW_INFO (nec_view_info,    //label
> 	   nec_lcd_funs
> 	  );
>
> On compilation, it gives parse error on line 87. Any idea?

What is the exact error? The error message is trying to tell you what
i wrong, so use the information.

What context are you invoking the macro? Inside a function or for a
global variable?

> Also, when using eCos config tool, we just point to the folder where host
> and target compilers reside. Where can we change the make scripts that are
> used in compiling the code in the repository? Eg. to add the switch -E to
> gcc?


I don't use the gui tool so have another way of doing this.

cd down the work tree to the package directory for the package you want to compile.

make clean
make

Scroll back and find the gcc invocation for the file you want to compile -E.
Cut and paste the command.
Edit it and add -E


Andrew


_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! hthttp://messenger.msn.click-url.com/go/onm00200471ave/direct/01/



-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]