As far as I can tell, the “#if defined()” has been part of the C
standard since the 1980’s; it appears to have been added at the same time as “#elif”
and “#error”… If your compiler really does not support this identifier, then I
suspect you will have much bigger problems trying to compile this code – or any
other code written in the last 20 years!
Jared
From:
address@hidden
[mailto:address@hidden On Behalf Of Piero
74
Sent: Wednesday, January 23, 2008 09:11
To: Mailing list for lwIP users
Subject: Re: [lwip-users] what is "defined() " ???
i know preprocessing....
i have not defined() pre-processing directive in my compiler.
in general i use #ifndef SYMBOL
so.. i don't know how implement this macro...
suggests?
2008/1/23, Kieran Mansley <address@hidden>:
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
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users