From 4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Mon, 13 Feb 2012 21:47:03 +0000 Subject: Rewritten most of the code for multithreading; still not 100%, but getting there. If this commit proves to be too problematic, we can always undo it. git-svn-id: http://mc-server.googlecode.com/svn/trunk@251 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/MCSocket.h | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 source/MCSocket.h (limited to 'source/MCSocket.h') diff --git a/source/MCSocket.h b/source/MCSocket.h deleted file mode 100644 index 30aa20bdd..000000000 --- a/source/MCSocket.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#ifndef _WIN32 - // Linux threads http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html - #include - #include - #include - #include - #include - - // TODO: We shouldn't need these! Use the OS support objects instead - #define SOCKET int - typedef void *HANDLE; - #define CRITICAL_SECTION pthread_mutex_t - #define SD_BOTH (2) - #define closesocket(x) (shutdown(x, SD_BOTH), close(x)) - #define SOCKET_ERROR SO_ERROR - #define EnterCriticalSection(x) pthread_mutex_lock(x) - #define LeaveCriticalSection(x) pthread_mutex_unlock(x) - #define InitializeCriticalSection(x) pthread_mutex_init(x, NULL) - #define DeleteCriticalSection(x) (x) -#endif - - - - - -inline bool IsSocketError( int a_ReturnedValue ) -{ - #ifdef _WIN32 - return (a_ReturnedValue == SOCKET_ERROR || a_ReturnedValue == 0); - #else - return (a_ReturnedValue <= 0); - #endif -} -- cgit v1.2.3