Logo AND Algorithmique Numérique Distribuée

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