lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] what is "defined() " ???


From: Kieran Mansley
Subject: Re: [lwip-users] what is "defined() " ???
Date: Wed, 23 Jan 2008 16:33:09 +0000

On Wed, 2008-01-23 at 17:19 +0100, Piero 74 wrote:
> Hi all
> 
> in file socket .h i found this:
> 
> #if !defined(FIONREAD) || !defined(FIONBIO)
> 
> what is "defined" macro? have i to define in cc.h using compiler
> pragma?

I suggest reading an introduction to the C preprocessor - this sort of
question is probably better answered by getting the necessary background
knowledge, and isn't really specific to lwIP.

The line in question is saying "if whoever is using this file has
already defined a lot of the constants that we need, then skip this bit,
otherwise define all these constants that we need".  It allows the
sockets.h header to both be included where these values have been pre-
defined (e.g. in an OS that has its own sockets API) or in one where
they have not.

Kieran





reply via email to

[Prev in Thread] Current Thread [Next in Thread]