[ENet-discuss] [patch] ENet win32 build fixes
Adam D. Moss
adam at gimp.org
Tue Nov 23 07:42:31 PST 2004
Hi!
This patch does two things:
1) Define ENET_API even when ENET_DLL is not set (i.e. building
statically).
2) Fix some pointer type mismatches against the winsock2 API.
CC:ing Lee because most of the mails I send to the enet list
never seem to turn up.
Thanks,
--Adam
-------------- next part --------------
Index: win32.c
===================================================================
--- win32.c (revision 3107)
+++ win32.c (working copy)
@@ -88,7 +88,7 @@
enet_socket_create (ENetSocketType type, const ENetAddress * address)
{
ENetSocket newSocket = socket (PF_INET, type == ENET_SOCKET_TYPE_DATAGRAM ? SOCK_DGRAM : SOCK_STREAM, 0);
- int nonBlocking = 1,
+ u_long nonBlocking = 1,
receiveBufferSize = ENET_HOST_RECEIVE_BUFFER_SIZE;
struct sockaddr_in sin;
@@ -216,8 +216,8 @@
ENetBuffer * buffers,
size_t bufferCount)
{
- DWORD sinLength = sizeof (struct sockaddr_in),
- flags = 0,
+ INT sinLength = sizeof (struct sockaddr_in);
+ DWORD flags = 0,
recvLength;
struct sockaddr_in sin;
Index: include/enet/win32.h
===================================================================
--- include/enet/win32.h (revision 3107)
+++ include/enet/win32.h (working copy)
@@ -35,6 +35,8 @@
#else
#define ENET_API __declspec( dllimport )
#endif /* ENET_BUILDING_LIB */
+#else
+#define ENET_API extern
#endif /* ENET_DLL */
#endif /* __ENET_WIN32_H__ */
More information about the ENet-discuss
mailing list