1 #ifndef __XBT_WIN32_CONFIG_H__
2 #define __XBT_WIN32_CONFIG_H__
5 /* config.h - simgrid config selection for windows platforms. */
7 /* Copyright (c) 2006, 2007, 2008, 2010. The SimGrid Team.
8 * All rights reserved. */
10 /* This program is free software; you can redistribute it and/or modify it
11 * under the terms of the license (GNU LGPL) which comes with this package. */
16 #include <win32/compiler/select_compiler_features.h>
19 #if defined(_XBT_BORLAND_COMPILER)
20 # include <win32/compiler/borland.h>
21 #elif defined(__GNUC__)
22 /* data comes from autoconf when using gnuc (cross-compiling?) */
23 # include "gras_config.h"
25 typedef unsigned int uint32_t;
27 #elif defined(_XBT_VISUALC_COMPILER)
28 # include <win32/compiler/visualc.h>
30 # error "Unknown compiler - please report the problems to the main simgrid mailing list (http://gforge.inria.fr/mail/?group_id=12)"
33 typedef int socklen_t;
34 #define tcp_read( s, buf, len ) recv( s, buf, len, 0 )
35 #define tcp_write( s, buf, len ) send( s, buf, len, 0 )
36 #define ioctl( s, c, a ) ioctlsocket( (s), (c), (a) )
37 #define ioctl_t u_long
38 #define AC_SOCKET_INVALID ((unsigned int) ~0)
41 #define tcp_close(s) (shutdown( s, SD_BOTH ), closesocket(s))
43 #define tcp_close( s ) closesocket( s )
46 #ifndef _XBT_VISUALC_COMPILER
48 #define EWOULDBLOCK WSAEWOULDBLOCK
51 #define EINPROGRESS WSAEINPROGRESS
54 #define ETIMEDOUT WSAETIMEDOUT
64 #define sock_errno WSAGetLastError()
70 #define sock_errstr(err) gras_wsa_err2string(err)
72 const char *gras_wsa_err2string(int errcode);
88 #endif /* #ifndef __XBT_WIN32_CONFIG_H__ */