Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old August 19th, 2005, 10:05 AM
Michael Sgier
Guest
 
Posts: n/a
Default ifndef

Hello
I get the error below. But why and what does ifndef? Well what
is ifndef?
Many thanks and regards
Michael
error: syntax error before `(' token


#ifndef MD2SwapInt
static __inline__ Uint32 MD2SwapInt(Uint32 D) {
return((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000F F00)|(D>>24));
}
#endif
  #2  
Old August 19th, 2005, 10:35 AM
benben
Guest
 
Posts: n/a
Default Re: ifndef

> Hello[color=blue]
> I get the error below. But why and what does ifndef? Well what
> is ifndef?
> Many thanks and regards
> Michael
> error: syntax error before `(' token
>
>
> #ifndef MD2SwapInt
> static __inline__ Uint32 MD2SwapInt(Uint32 D) {
> return((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000F F00)|(D>>24));
> }
> #endif[/color]

I don't get a syntax error. What compiler are you using?

Ben


  #3  
Old August 19th, 2005, 11:25 AM
glen stark
Guest
 
Posts: n/a
Default Re: ifndef


"Michael Sgier" <sgier@nospam.ch> wrote in message
news:43059fb4$0$1153$5402220f@news.sunrise.ch...[color=blue]
> Hello
> I get the error below. But why and what does ifndef? Well what
> is ifndef?
> Many thanks and regards
> Michael
> error: syntax error before `(' token
>
>
> #ifndef MD2SwapInt
> static __inline__ Uint32 MD2SwapInt(Uint32 D) {
> return((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000F F00)|(D>>24));
> }
> #endif[/color]
I don't know why you get the syntax error. I would suggest looking for a
missing a ; or a close parenthisis or some such from a previously included
header.

as for what is ifndef:

#ifndef is a directive that tell is the compiler "if MD2SwapInt is not
defned, then include the following code:" (if not defined).

Since you are getting an error from your code, MD2SwapInt has clearly not
been defined.


  #4  
Old August 19th, 2005, 12:25 PM
Gianni Mariani
Guest
 
Posts: n/a
Default Re: ifndef

Michael Sgier wrote:[color=blue]
> Hello
> I get the error below. But why and what does ifndef? Well what
> is ifndef?
> Many thanks and regards
> Michael
> error: syntax error before `(' token
>
>
> #ifndef MD2SwapInt
> static __inline__ Uint32 MD2SwapInt(Uint32 D) {
> return((D<<24)|((D<<8)&0x00FF0000)|((D>>8)&0x0000F F00)|(D>>24));
> }
> #endif[/color]


What do you think the compiler would do with the following code:

int x;

#ifndef x
float x;
#endif

?

It should give an error.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles