lwip-users
[Top][All Lists]
Advanced

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

[lwip-users] LWIP_COMPAT_SOCKETS in sockets.h


From: Frédéric BERNON
Subject: [lwip-users] LWIP_COMPAT_SOCKETS in sockets.h
Date: Wed, 6 Sep 2006 16:30:52 +0200

I have got some problems with "read", "write" and "close" defines in the "#if 
LWIP_COMPAT_SOCKETS" in sockets.h. These defines cause a compiler error due to 
same names than my "real" OS calls (in this OS - tmOsal/pSOS - there is a layer 
which wrap calls to the correct "IO driver"). I simply comment them, but 
wouldn't it be nicer to add a #define like "LWIP_IO_SOCKETS" in opt.h to 
include or not include these defines?

More, to simplify my application porting, I add this line (I know, its not BSD, 
but it help to avoid problems):

#define closesocket(s)        lwip_close(s)

What do you think about :

#if LWIP_COMPAT_SOCKETS
#define accept(a,b,c)         lwip_accept(a,b,c)
#define bind(a,b,c)           lwip_bind(a,b,c)
#define shutdown(a,b)         lwip_shutdown(a,b)
#define closesocket(s)        lwip_close(s)
#define connect(a,b,c)        lwip_connect(a,b,c)
#define getsockname(a,b,c)    lwip_getsockname(a,b,c)
#define getpeername(a,b,c)    lwip_getpeername(a,b,c)
#define setsockopt(a,b,c,d,e) lwip_setsockopt(a,b,c,d,e)
#define getsockopt(a,b,c,d,e) lwip_getsockopt(a,b,c,d,e)
#define listen(a,b)           lwip_listen(a,b)
#define recv(a,b,c,d)         lwip_recv(a,b,c,d)
#define recvfrom(a,b,c,d,e,f) lwip_recvfrom(a,b,c,d,e,f)
#define send(a,b,c,d)         lwip_send(a,b,c,d)
#define sendto(a,b,c,d,e,f)   lwip_sendto(a,b,c,d,e,f)
#define socket(a,b,c)         lwip_socket(a,b,c)
#define select(a,b,c,d,e)     lwip_select(a,b,c,d,e)
#define ioctlsocket(a,b,c)    lwip_ioctl(a,b,c)

#if LWIP_IO_SOCKETS
#define close(s)              lwip_close(s)
#define read(a,b,c)           lwip_read(a,b,c)
#define write(a,b,c)          lwip_write(a,b,c)
#endif /* LWIP_IO_SOCKETS */

#endif /* LWIP_COMPAT_SOCKETS */
  
====================================
Frédéric BERNON 
HYMATOM SA 
Chef de projet informatique 
Microsoft Certified Professional 
Tél. : +33 (0)4-67-87-61-10 
Fax. : +33 (0)4-67-70-85-44 
Email : address@hidden 
Web Site : http://www.hymatom.fr 
====================================




reply via email to

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