Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
now define the macro NEED_ASPRINTF
[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 # else
21 # error "Unknown compiler - please report the problems to the main simgrid mailing list (http://gforge.inria.fr/mail/?group_id=12)"
22 #endif
23
24
25 #define tcp_read( s, buf, len )         recv( s, buf, len, 0 )
26 #define tcp_write( s, buf, len )        send( s, buf, len, 0 )
27 #define ioctl( s, c, a )                ioctlsocket( (s), (c), (a) )
28 #define ioctl_t                                         u_long
29 #define AC_SOCKET_INVALID               ((unsigned int) ~0)
30
31 #ifdef SD_BOTH
32         #define tcp_close(s)    (shutdown( s, SD_BOTH ), closesocket(s))
33 #else
34         #define tcp_close( s )  closesocket( s )
35 #endif
36
37 #ifndef EWOULDBLOCK
38         #define EWOULDBLOCK WSAEWOULDBLOCK
39 #endif
40
41 #ifndef EINPROGRESS
42         #define EINPROGRESS WSAEINPROGRESS
43 #endif
44
45 #ifndef ETIMEDOUT
46         #define ETIMEDOUT   WSAETIMEDOUT
47 #endif
48
49 #ifdef sock_errno
50         #undef  sock_errno
51 #endif
52
53 #define sock_errno         WSAGetLastError()
54
55 #ifdef sock_errstr
56         #undef  sock_errstr
57 #endif
58
59 #define sock_errstr(err)   gras_wsa_err2string(err)
60
61 const char *gras_wsa_err2string(int errcode);
62
63 #ifdef S_IRGRP
64         #undef S_IRGRP
65 #endif
66
67 #define S_IRGRP 0
68
69 #ifdef S_IWGRP
70         #undef S_IWGRP
71 #endif
72
73 #define S_IWGRP 0
74
75         
76
77 #endif /* #ifndef __XBT_WIN32_CONFIG_H__ */