summaryrefslogtreecommitdiff
path: root/source/net_common.c
diff options
context:
space:
mode:
authorAndrey Nazarov <skuller@skuller.net>2008-11-13 18:58:41 +0000
committerAndrey Nazarov <skuller@skuller.net>2008-11-13 18:58:41 +0000
commitbbefa87db18f5b76dc67efa00b7cc798361480f3 (patch)
treeefc130fe3b4fe22f111154a8720491b756daa7bd /source/net_common.c
parentd65e02496cd9873f5bb0297661b19762b44ddfec (diff)
Hacked the source to get it compile on Windows Mobile using CeGCC toolchain.
Fixed nasty memory corruption bug in UI scripts loading code. Fixed software refresh compilation issues on Windows. Inactive MVD channels are now completely destroyed and recreated once they are active again, and they are no longer allowed to stay in waiting state forever. Fixed delay buffer overflow resulting in fatal connection error. Preserve MVD stream flags in demos recorded on GTV server, and handle `inuse' flag correctly on players when writing gamestate. Updated documentation and Debian package descriptions.
Diffstat (limited to 'source/net_common.c')
-rw-r--r--source/net_common.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/net_common.c b/source/net_common.c
index 249c02b..0266172 100644
--- a/source/net_common.c
+++ b/source/net_common.c
@@ -32,13 +32,17 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "sys_public.h"
#include "sv_public.h"
-#if defined( _WIN32 )
+#if( defined _WIN32 )
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <winsock2.h>
#define socklen_t int
+#ifdef _WIN32_WCE
+#define NET_GET_ERROR() ( net_error = GetLastError() )
+#else
#define NET_GET_ERROR() ( net_error = WSAGetLastError() )
-#elif defined( __unix__ )
+#endif
+#elif( defined __unix__ )
#include <unistd.h>
#include <sys/socket.h>
#include <sys/time.h>
@@ -523,8 +527,8 @@ neterr_t NET_GetPacket( netsrc_t sock ) {
memset( &from, 0, sizeof( from ) );
fromlen = sizeof( from );
- ret = recvfrom( udp_sockets[sock], msg_read_buffer, MAX_PACKETLEN, 0,
- ( struct sockaddr * )&from, &fromlen );
+ ret = recvfrom( udp_sockets[sock], ( void * )msg_read_buffer,
+ MAX_PACKETLEN, 0, ( struct sockaddr * )&from, &fromlen );
if( !ret ) {
return NET_AGAIN;
@@ -1128,7 +1132,7 @@ neterr_t NET_RunStream( netstream_t *s ) {
fd_set rfd, wfd;
int ret;
size_t len;
- byte *data;
+ void *data;
neterr_t result = NET_AGAIN;
if( s->state != NS_CONNECTED ) {
@@ -1371,7 +1375,9 @@ static void NET_Restart_f( void ) {
NET_Listen( qtrue );
}
+#if USE_SYSCON
SV_SetConsoleTitle();
+#endif
}
/*