Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
d5b937b2ce50329807fa31a2ce7a458932e5f1df
[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) 2003, 2004 Cherier Malek. All rights reserved.            */
8
9 /* This program is free software; you can redistribute it and/or modify it
10  * under the terms of the license (GNU LGPL) which comes with this package. */
11
12 /* 
13  * config selection. 
14 */
15 #include <win32/compiler/select_compiler_features.h>
16
17
18 #if defined(_XBT_BORLAND_COMPILER)
19 # include <win32/compiler/borland.h>
20 #elif defined(_XBT_VISUALC_COMPILER)
21 # include <win32/compiler/visualc.h>
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
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 EWOULDBLOCK
40         #define EWOULDBLOCK WSAEWOULDBLOCK
41 #endif
42
43 #ifndef EINPROGRESS
44         #define EINPROGRESS WSAEINPROGRESS
45 #endif
46
47 #ifndef ETIMEDOUT
48         #define ETIMEDOUT   WSAETIMEDOUT
49 #endif
50
51 #ifdef sock_errno
52         #undef  sock_errno
53 #endif
54
55 #define sock_errno         WSAGetLastError()
56
57 #ifdef sock_errstr
58         #undef  sock_errstr
59 #endif
60
61 #define sock_errstr(err)   gras_wsa_err2string(err)
62
63 const char *gras_wsa_err2string(int errcode);
64
65 #ifdef S_IRGRP
66         #undef S_IRGRP
67 #endif
68
69 #define S_IRGRP 0
70
71 #ifdef S_IWGRP
72         #undef S_IWGRP
73 #endif
74
75 #define S_IWGRP 0
76
77         
78
79 #endif /* #ifndef __XBT_WIN32_CONFIG_H__ */