Logo AND Algorithmique Numérique Distribuée

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