aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid <david@xagasoft.com>2009-01-21 03:51:50 +0000
committerDavid <david@xagasoft.com>2009-01-21 03:51:50 +0000
commitb94a6a42c1024c00fab7b678cccaecfaa7604d56 (patch)
treee6beea01ee74c35bd7dcc54313ea727e02b87b48
parente27a084118b8810b6bd442c560df46ce161a9a87 (diff)
downloadlibbu++-b94a6a42c1024c00fab7b678cccaecfaa7604d56.tar.gz
libbu++-b94a6a42c1024c00fab7b678cccaecfaa7604d56.tar.bz2
libbu++-b94a6a42c1024c00fab7b678cccaecfaa7604d56.tar.xz
libbu++-b94a6a42c1024c00fab7b678cccaecfaa7604d56.zip
david - needed to actually import the shutdown function from the winsock dll..
-rw-r--r--src/linux_compatibility.h1
-rw-r--r--src/socket.cpp2
-rw-r--r--src/win32_compatibility.cpp5
-rw-r--r--src/win32_compatibility.h2
4 files changed, 9 insertions, 1 deletions
diff --git a/src/linux_compatibility.h b/src/linux_compatibility.h
index 6d3d85e..5d2df1b 100644
--- a/src/linux_compatibility.h
+++ b/src/linux_compatibility.h
@@ -4,6 +4,7 @@
4#define bu_inet_addr inet_addr 4#define bu_inet_addr inet_addr
5#define bu_select select 5#define bu_select select
6#define bu_socket socket 6#define bu_socket socket
7#define bu_shutdown shutdown
7#define bu_htons htons 8#define bu_htons htons
8#define bu_htonl htonl 9#define bu_htonl htonl
9#define bu_gethostbyname gethostbyname 10#define bu_gethostbyname gethostbyname
diff --git a/src/socket.cpp b/src/socket.cpp
index 8937fd1..a660b30 100644
--- a/src/socket.cpp
+++ b/src/socket.cpp
@@ -136,7 +136,7 @@ void Bu::Socket::close()
136 #define SHUT_RDWR (SD_BOTH) 136 #define SHUT_RDWR (SD_BOTH)
137 #endif 137 #endif
138#endif 138#endif
139 shutdown( nSocket, SHUT_RDWR ); 139 bu_shutdown( nSocket, SHUT_RDWR );
140 ::close( nSocket ); 140 ::close( nSocket );
141 } 141 }
142 bActive = false; 142 bActive = false;
diff --git a/src/win32_compatibility.cpp b/src/win32_compatibility.cpp
index b85e869..c052e0b 100644
--- a/src/win32_compatibility.cpp
+++ b/src/win32_compatibility.cpp
@@ -14,6 +14,7 @@ deffunc( inet_ntoa );
14deffunc( inet_addr ); 14deffunc( inet_addr );
15deffunc( select ); 15deffunc( select );
16deffunc( socket ); 16deffunc( socket );
17deffunc( shutdown );
17deffunc( ioctlsocket ); 18deffunc( ioctlsocket );
18deffunc( htons ); 19deffunc( htons );
19deffunc( htonl ); 20deffunc( htonl );
@@ -49,6 +50,7 @@ Bu::Winsock2::Winsock2()
49 getfunc( inet_addr ); 50 getfunc( inet_addr );
50 getfunc( select ); 51 getfunc( select );
51 getfunc( socket ); 52 getfunc( socket );
53 getfunc( shutdown );
52 getfunc( ioctlsocket ); 54 getfunc( ioctlsocket );
53 getfunc( htons ); 55 getfunc( htons );
54 getfunc( htonl ); 56 getfunc( htonl );
@@ -102,6 +104,9 @@ int Bu::Winsock2::select( int a, fd_set *b, fd_set *c, fd_set *d,
102SOCKET Bu::Winsock2::socket( int domain, int type, int protocol ) { 104SOCKET Bu::Winsock2::socket( int domain, int type, int protocol ) {
103 return (*Bu::Winsock2::_fnptr_socket)( domain, type, protocol ); 105 return (*Bu::Winsock2::_fnptr_socket)( domain, type, protocol );
104} 106}
107int Bu::Winsock2::shutdown( SOCKET s, int how ) {
108 return (*Bu::Winsock2::_fnptr_shutdown)( s, how );
109}
105int Bu::Winsock2::ioctlsocket( SOCKET s, long cmd, u_long *argp ) { 110int Bu::Winsock2::ioctlsocket( SOCKET s, long cmd, u_long *argp ) {
106 return (*Bu::Winsock2::_fnptr_ioctlsocket)( s, cmd, argp ); 111 return (*Bu::Winsock2::_fnptr_ioctlsocket)( s, cmd, argp );
107} 112}
diff --git a/src/win32_compatibility.h b/src/win32_compatibility.h
index 36613d1..2cce888 100644
--- a/src/win32_compatibility.h
+++ b/src/win32_compatibility.h
@@ -63,6 +63,7 @@ namespace Bu
63 decltype( int, select, int nfds, fd_set *readfds, fd_set *writefds, 63 decltype( int, select, int nfds, fd_set *readfds, fd_set *writefds,
64 fd_set *exceptfds, const struct timeval *timeout ); 64 fd_set *exceptfds, const struct timeval *timeout );
65 decltype( SOCKET, socket, int domain, int type, int protocol ); 65 decltype( SOCKET, socket, int domain, int type, int protocol );
66 decltype( int, shutdown, SOCKET s, int how );
66 decltype( int, ioctlsocket, SOCKET s, long cmd, u_long *argp ); 67 decltype( int, ioctlsocket, SOCKET s, long cmd, u_long *argp );
67 decltype( u_short, htons, u_short in ); 68 decltype( u_short, htons, u_short in );
68 decltype( u_long, htonl, u_long in ); 69 decltype( u_long, htonl, u_long in );
@@ -101,6 +102,7 @@ namespace Bu
101#define bu_inet_addr (*Bu::Winsock2::inet_addr) 102#define bu_inet_addr (*Bu::Winsock2::inet_addr)
102#define bu_select (*Bu::Winsock2::select) 103#define bu_select (*Bu::Winsock2::select)
103#define bu_socket (*Bu::Winsock2::socket) 104#define bu_socket (*Bu::Winsock2::socket)
105#define bu_shutdown (*Bu::Winsock2::shutdown)
104#define bu_ioctlsocket (*Bu::Winsock2::ioctlsocket) 106#define bu_ioctlsocket (*Bu::Winsock2::ioctlsocket)
105#define bu_htons (*Bu::Winsock2::htons) 107#define bu_htons (*Bu::Winsock2::htons)
106#define bu_htonl (*Bu::Winsock2::htonl) 108#define bu_htonl (*Bu::Winsock2::htonl)