lwip-devel
[Top][All Lists]
Advanced

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

[lwip-devel] [patch #6481] sio.h minor fix


From: Simon Goldschmidt
Subject: [lwip-devel] [patch #6481] sio.h minor fix
Date: Thu, 27 Mar 2008 17:57:13 +0000
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12

Follow-up Comment #4, patch #6481 (project lwip):

> Follow-up Comment #3, patch #6481 (project lwip):
>
>> What is missing is a global #ifndef _SIO_H_.
>
> Yes. This is definetely right. After I added it I no 
> longer need the missing "#define __sio_fd_t_defined"
>
> It would be good if this was possible:
>
> #ifndef  sio_fd_t /* instead of __sio_fd_t_defined  */
> typedef void * sio_fd_t; 
> #endif 
>
> Unfortunately my compiler does not understand it.

That doesn't work: the typedef can't be checked with a preprocessor
directive. Thus you can't test it like this.

>> ...the function prototypes also don't define the macro...
>
> For the functions in sio.h I do not need to define anywhere anything. I
just
> write (for example) this in sio.c :
>
> void sio_send(u8_t ch, sio_fd_t psio)
> { 
>   WriteRS1(ch); /* send char over UART1 */
> }

Of course, that's what it's meant like. The #ifndef's around the function
prototypes are included to be able to include a define in cc.h that defines
them to some other function. That way, sio_send can be a define _or_ a
function. But if it is a function, it _must_ have the signature like defined
in sio.h. Also, sio_fd_t is the only problem here because functions can be
prototyped more than once while a second typedef gives an error.

But the global #ifndef __SIO_H__ is the cleaner solution anyway. It just
happened that (as far as I know) no current developer is using this file:
slipif is currently not very much used.

>
> If I understand you right, anyone who has this type already defined by the
> system  should add this:
> #define __sio_fd_t_defined
> in his cc.h. Right?

Exactly.

    _______________________________________________________

Reply to this item at:

  <http://savannah.nongnu.org/patch/?6481>

_______________________________________________
  Nachricht geschickt von/durch Savannah
  http://savannah.nongnu.org/





reply via email to

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