Some improvements towards successful build with netplay on MinGW.

Proabaly not completely there yet.


git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2464 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
meep-eep
2006-10-27 01:20:13 +00:00
parent 620c00c52c
commit c243c3a73f
15 changed files with 92 additions and 20 deletions
+5 -1
View File
@@ -128,9 +128,13 @@ typedef unsigned short wchar_t;
typedef unsigned int wint_t;
#endif
#if defined (_MSC_VER) || defined(__MINGW32__)
# define USE_WINSOCK
#endif
// errno error numbers. The values used don't matter, as long as they
// don't conflict with existing errno error numbers.
#if defined (PORT_WANT_ERRNO) && defined (_MSC_VER)
#if defined (PORT_WANT_ERRNO) && defined (USE_WINSOCK)
# include <errno.h>
# ifndef E2BIG
# define E2BIG 0x01000001
+6 -1
View File
@@ -1,3 +1,8 @@
uqm_SUBDIRS="connect netmanager socket"
uqm_CFILES="netport.c network_bsd.c"
uqm_CFILES="netport.c"
if [ -n "$MACRO___MINGW32__" ]; then
uqm_CFILES="$uqm_CFILES network_win.c"
else
uqm_CFILES="$uqm_CFILES network_bsd.c"
fi
@@ -33,7 +33,7 @@
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#ifdef _MSC_VER
#ifdef USE_WINSOCK
# include <winsock2.h>
# include <ws2tcpip.h>
# include <wspiapi.h>
@@ -32,14 +32,14 @@
#include <assert.h>
#include <errno.h>
#ifdef _MSC_VER
#ifdef USE_WINSOCK
# include <winsock2.h>
# include <ws2tcpip.h>
#else
# include <netdb.h>
#endif
#ifdef DEBUG
# ifdef _MSC_VER
# ifdef USE_WINSOCK
# include <wspiapi.h>
# endif
#endif
@@ -28,7 +28,9 @@ typedef enum {
typedef struct ListenError ListenError;
typedef struct ListenState ListenState;
#ifdef _MSC_VER
#include "port.h"
#ifdef USE_WINSOCK
// I do not want to include winsock2.h, because of possible conflicts with
// code that includes this file.
// Note that listen.c itself includes winsock2.h; SOCKLEN_T is used there
@@ -28,9 +28,10 @@ typedef enum {
} ResolveStateState;
typedef struct ResolveState ResolveState;
#include "port.h"
// For addrinfo.
#ifdef _MSC_VER
#ifdef USE_WINSOCK
// Not including <winsock2.h> because of possible conflicts with files
// including this file.
struct addrinfo;
@@ -63,13 +64,13 @@ typedef void (*ResolveErrorCallback)(ResolveState *resolveState,
const ResolveError *error);
#ifdef RESOLVE_INTERNAL
#ifdef _MSC_VER
#ifdef USE_WINSOCK
# include <winsock2.h>
# include <ws2tcpip.h>
# include <wspiapi.h>
#else /* !defined(_MSC_VER) */
#else /* !defined(USE_WINSOCK) */
# include <netdb.h>
#endif /* !defined(_MSC_VER) */
#endif /* !defined(USE_WINSOCK) */
struct ResolveState {
RefCount refCount;
@@ -1,2 +1,8 @@
uqm_CFILES="ndesc.c netmanager_bsd.c"
uqm_CFILES="ndesc.c"
if [ -n "$MACRO___MINGW32__" ]; then
uqm_CFILES="$uqm_CFILES netmanager_win.c"
else
uqm_CFILES="$uqm_CFILES netmanager_bsd.c"
fi
@@ -19,9 +19,10 @@
#ifndef _NETMANAGER_H
#define _NETMANAGER_H
#include "port.h"
#include "types.h"
#ifdef WIN32
#ifdef USE_WINSOCK
# include "netmanager_win.h"
#else
# include "netmanager_bsd.h"
+2 -2
View File
@@ -20,7 +20,7 @@
#include "port.h"
#include "netport.h"
#ifdef _MSC_VER
#ifdef USE_WINSOCK
# include <winsock2.h>
int
@@ -87,5 +87,5 @@ int
getWinsockErrno(void) {
return winsockErrorToErrno(WSAGetLastError());
}
#endif /* defined (_MSC_VER) */
#endif /* defined (USE_WINSOCK) */
+3 -1
View File
@@ -19,7 +19,9 @@
#ifndef _NETPORT_H
#define _NETPORT_H
#if defined (_MSC_VER)
#include "port.h"
#if defined (USE_WINSOCK)
int winsockErrorToErrno(int winsockError);
int getWinsockErrno(void);
# define EAI_SYSTEM 0x02000001
+3 -1
View File
@@ -16,10 +16,12 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "port.h"
#define SOCKET_INTERNAL
#include "socket.h"
#ifdef _MSC_VER
#ifdef USE_WINSOCK
# include <winsock2.h>
#else
# include <sys/socket.h>
+1 -1
View File
@@ -24,7 +24,7 @@ typedef struct Socket Socket;
#include "port.h"
#ifdef WIN32
#ifdef USE_WINSOCK
# include "socket_win.h"
#else
# include "socket_bsd.h"