Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Load the result of configure on cross-compilation
[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 #else
24 # error "Unknown compiler - please report the problems to the main simgrid mailing list (http://gforge.inria.fr/mail/?group_id=12)"
25 #endif
26
27
28 #define tcp_read( s, buf, len )         recv( s, buf, len, 0 )
29 #define tcp_write( s, buf, len )        send( s, buf, len, 0 )
30 #define ioctl( s, c, a )                ioctlsocket( (s), (c), (a) )
31 #define ioctl_t                                         u_long
32 #define AC_SOCKET_INVALID               ((unsigned int) ~0)
33
34 #ifdef SD_BOTH
35         #define tcp_close(s)    (shutdown( s, SD_BOTH ), closesocket(s))
36 #else
37         #define tcp_close( s )  closesocket( s )
38 #endif
39
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
52 #ifdef sock_errno
53         #undef  sock_errno
54 #endif
55
56 #define sock_errno         WSAGetLastError()
57
58 #ifdef sock_errstr
59         #undef  sock_errstr
60 #endif
61
62 #define sock_errstr(err)   gras_wsa_err2string(err)
63
64 const char *gras_wsa_err2string(int errcode);
65
66 #ifdef S_IRGRP
67         #undef S_IRGRP
68 #endif
69
70 #define S_IRGRP 0
71
72 #ifdef S_IWGRP
73         #undef S_IWGRP
74 #endif
75
76 #define S_IWGRP 0
77
78         
79
80 #endif /* #ifndef __XBT_WIN32_CONFIG_H__ */