Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
oups! forgot to rest some parts ...
[simgrid.git] / src / win32 / config.h
1 #ifndef __XBT_WIN32_CONFIG_H__
2 #define __XBT_WIN32_CONFIG_H__
3
4
5 /* config.h - simgrid config selection for windows platforms. */
6
7 /* Copyright (c) 2006, 2007, 2008, 2010. The SimGrid Team.
8  * All rights reserved.                                                     */
9
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. */
12
13 /* 
14  * config selection. 
15 */
16 #if defined(__GNUC__)
17         /* data comes from autoconf when using gnuc (cross-compiling?) */
18   # include "internal_config.h"
19   #ifndef _XBT_WIN32
20     typedef unsigned int uint32_t;
21   #endif
22 # else
23   # error "Unknown compiler - please report the problems to the main simgrid mailing list (http://gforge.inria.fr/mail/?group_id=12)"
24 #endif
25
26 typedef int socklen_t;
27 #define tcp_read( s, buf, len )    recv( s, buf, len, 0 )
28 #define tcp_write( s, buf, len )  send( s, buf, len, 0 )
29 #define ioctl( s, c, a )          ioctlsocket( (s), (c), (a) )
30 #define ioctl_t            u_long
31 #define AC_SOCKET_INVALID          ((unsigned int) ~0)
32
33 #ifdef SD_BOTH
34 #define tcp_close(s)  (shutdown( s, SD_BOTH ), closesocket(s))
35 #else
36 #define tcp_close( s )  closesocket( s )
37 #endif
38
39 #ifndef _XBT_VISUALC_COMPILER
40   #ifndef EWOULDBLOCK
41   #define EWOULDBLOCK WSAEWOULDBLOCK
42   #endif
43
44   #ifndef EINPROGRESS
45   #define EINPROGRESS WSAEINPROGRESS
46   #endif
47
48   #ifndef ETIMEDOUT
49   #define ETIMEDOUT   WSAETIMEDOUT
50   #endif
51 #endif
52
53
54
55 #ifdef sock_errno
56   #undef  sock_errno
57 #endif
58
59 #define sock_errno         WSAGetLastError()
60
61 #ifdef sock_errstr
62   #undef  sock_errstr
63 #endif
64
65 #define sock_errstr(err)   xbt_wsa_err2string(err)
66
67 const char *xbt_wsa_err2string(int errcode);
68
69 #ifdef S_IRGRP
70   #undef S_IRGRP
71 #endif
72
73 #define S_IRGRP 0
74
75 #ifdef S_IWGRP
76   #undef S_IWGRP
77 #endif
78
79 #define S_IWGRP 0
80
81 #endif                          /* #ifndef __XBT_WIN32_CONFIG_H__ */