PDA

View Full Version : quick question on #else WIN32



nick2price
11-15-2008, 05:57 PM
I have compiled this project which i am learning from. One thing i am not too sure about is this segment of code which is grey. A little example is

#else /* !WIN32 */
/*
* Functions for reading and writing 16- and 32-bit little-endian integers.
*/

static unsigned short read_word(FILE *fp);
static unsigned int read_dword(FILE *fp);
static int read_long(FILE *fp);

static int write_word(FILE *fp, unsigned short w);
static int write_dword(FILE *fp, unsigned int dw);
static int write_long(FILE *fp, int l);

Now leaving it in, the project runs fine. But if i take it out, i get errors. What is this grey code?
Its exactly the same as some code which isnt grey, which is why i thought it wouldnt make a difference if i removed it.
cheers

satan
11-15-2008, 07:38 PM
There is a comment in the code explaining what it does:


Functions for reading and writing 16- and 32-bit little-endian integers.


This is clearly not an OpenGL related question. You should read about the C preprocessor, conditionals and big/little endian systems.