public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* Re: [ECOS] Macro declarations
@ 2004-08-30 21:39 Samie Hassan Ghauri
  0 siblings, 0 replies; 4+ messages in thread
From: Samie Hassan Ghauri @ 2004-08-30 21:39 UTC (permalink / raw)
  To: andrew; +Cc: ecos-discuss

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Macro declarations
@ 2004-08-31 13:41 Samie Hassan Ghauri
  0 siblings, 0 replies; 4+ messages in thread
From: Samie Hassan Ghauri @ 2004-08-31 13:41 UTC (permalink / raw)
  To: andrew; +Cc: ecos-discuss

Sorry, the error is not before " ' " but before "," on line 87 in code.

Regards
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
>

_________________________________________________________________
Protect your PC - get McAfee.com VirusScan Online 
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ECOS] Macro declarations
  2004-08-30 17:59 Samie Hassan Ghauri
@ 2004-08-30 18:33 ` Andrew Lunn
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2004-08-30 18:33 UTC (permalink / raw)
  To: Samie Hassan Ghauri; +Cc: ecos-discuss

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


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [ECOS] Macro declarations
@ 2004-08-30 17:59 Samie Hassan Ghauri
  2004-08-30 18:33 ` Andrew Lunn
  0 siblings, 1 reply; 4+ messages in thread
From: Samie Hassan Ghauri @ 2004-08-30 17:59 UTC (permalink / raw)
  To: ecos-discuss

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
	  );

VIEW_INFO (nec_view_info,    //label
	   nec_lcd_funs
	  );

On compilation, it gives parse error on line 87. Any idea?
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?

Thanks
Samie

_________________________________________________________________
On the road to retirement? Check out MSN Life Events for advice on how to 
get there! http://lifeevents.msn.com/category.aspx?cid=Retirement


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

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-08-31 13:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-30 21:39 [ECOS] Macro declarations Samie Hassan Ghauri
  -- strict thread matches above, loose matches on Subject: below --
2004-08-31 13:41 Samie Hassan Ghauri
2004-08-30 17:59 Samie Hassan Ghauri
2004-08-30 18:33 ` Andrew Lunn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).