… | |
… | |
27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
30 | */ |
30 | */ |
31 | |
31 | |
32 | #ifdef WIN32 |
32 | #ifdef _WIN32 |
33 | |
33 | |
34 | #include <sys/timeb.h> |
34 | #include <sys/timeb.h> |
35 | |
35 | |
36 | /* note: the comment below could not be substantiated, but what would I care */ |
36 | /* note: the comment below could not be substantiated, but what would I care */ |
37 | /* MSDN says this is required to handle SIGFPE */ |
37 | /* MSDN says this is required to handle SIGFPE */ |
… | |
… | |
71 | if ((sock[1] = accept (listener, 0, 0)) < 0) |
71 | if ((sock[1] = accept (listener, 0, 0)) < 0) |
72 | goto fail; |
72 | goto fail; |
73 | |
73 | |
74 | closesocket (listener); |
74 | closesocket (listener); |
75 | |
75 | |
|
|
76 | #if EV_SELECT_IS_WINSOCKET |
|
|
77 | filedes [0] = _open_osfhandle (sock [0], 0); |
|
|
78 | filedes [1] = _open_osfhandle (sock [1], 0); |
|
|
79 | #else |
|
|
80 | /* when select isn't winsocket, we also expect socket, connect, accept etc. |
|
|
81 | * to work on fds */ |
76 | filedes [0] = sock [0]; |
82 | filedes [0] = sock [0]; |
77 | filedes [1] = sock [1]; |
83 | filedes [1] = sock [1]; |
|
|
84 | #endif |
78 | |
85 | |
79 | return 0; |
86 | return 0; |
80 | |
87 | |
81 | fail: |
88 | fail: |
82 | closesocket (listener); |
89 | closesocket (listener); |
… | |
… | |
102 | |
109 | |
103 | return 0; |
110 | return 0; |
104 | } |
111 | } |
105 | |
112 | |
106 | #undef gettimeofday |
113 | #undef gettimeofday |
107 | #define gettimeofdy(tv,tz) ev_gettimeofday (tv, tz) |
114 | #define gettimeofday(tv,tz) ev_gettimeofday (tv, tz) |
108 | |
115 | |
109 | #endif |
116 | #endif |
|
|
117 | |