hce-node application  1.4.3
HCE Hierarchical Cluster Engine node application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
cf_errno.h
Go to the documentation of this file.
1 /*
2  * Copyright 2013 Aerospike. All rights reserved.
3  */
4 
5 #pragma once
6 
7 #ifndef CF_WINDOWS
8 //====================================================================
9 // Linux
10 //
11 
12 #include <errno.h>
13 
14 #define IS_CONNECTING() (errno == EINPROGRESS)
15 
16 
17 #else // CF_WINDOWS
18 //====================================================================
19 // Windows
20 //
21 
22 #include <WinSock2.h>
23 
24 #undef errno
25 
26 #undef EAGAIN
27 #undef EBADF
28 #undef ECONNREFUSED
29 #undef EINPROGRESS
30 #undef EWOULDBLOCK
31 
32 // If we ever use errno for other than socket operations, we may have to
33 // introduce new and different definitions for errno.
34 #define errno (WSAGetLastError())
35 
36 #define EAGAIN WSAEWOULDBLOCK
37 #define EBADF WSAEBADF
38 #define ECONNREFUSED WSAECONNREFUSED
39 #define EINPROGRESS WSAEINPROGRESS
40 #define EWOULDBLOCK WSAEWOULDBLOCK
41 
42 #define IS_CONNECTING() (errno == EWOULDBLOCK)
43 
44 
45 #endif // CF_WINDOWS