summaryrefslogtreecommitdiffstats
path: root/Utilities/cmlibuv/src/uv-common.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-05-15 14:43:50 (GMT)
committerBrad King <brad.king@kitware.com>2017-05-15 14:43:50 (GMT)
commited17516b31404dd42eab61c599c84933af485b34 (patch)
tree52538b48c172c7258117b1edcee4359dcf6c45e5 /Utilities/cmlibuv/src/uv-common.h
parent52fbae0a59d05f2724e77aff75c7761b685bae03 (diff)
parent12a78bc824655524d817508d6107ef4dcf8e3626 (diff)
downloadCMake-ed17516b31404dd42eab61c599c84933af485b34.zip
CMake-ed17516b31404dd42eab61c599c84933af485b34.tar.gz
CMake-ed17516b31404dd42eab61c599c84933af485b34.tar.bz2
Merge branch 'upstream-libuv' into update-libuv
* upstream-libuv: libuv 2017-05-09 (e11dcd43) Fixes: #16878
Diffstat (limited to 'Utilities/cmlibuv/src/uv-common.h')
-rw-r--r--Utilities/cmlibuv/src/uv-common.h35
1 files changed, 31 insertions, 4 deletions
diff --git a/Utilities/cmlibuv/src/uv-common.h b/Utilities/cmlibuv/src/uv-common.h
index 27902fd..781a855 100644
--- a/Utilities/cmlibuv/src/uv-common.h
+++ b/Utilities/cmlibuv/src/uv-common.h
@@ -55,16 +55,19 @@ extern int snprintf(char*, size_t, const char*, ...);
#ifndef _WIN32
enum {
+ UV__SIGNAL_ONE_SHOT = 0x80000, /* On signal reception remove sighandler */
UV__HANDLE_INTERNAL = 0x8000,
UV__HANDLE_ACTIVE = 0x4000,
UV__HANDLE_REF = 0x2000,
UV__HANDLE_CLOSING = 0 /* no-op on unix */
};
#else
-# define UV__HANDLE_INTERNAL 0x80
-# define UV__HANDLE_ACTIVE 0x40
-# define UV__HANDLE_REF 0x20
-# define UV__HANDLE_CLOSING 0x01
+# define UV__SIGNAL_ONE_SHOT_DISPATCHED 0x200
+# define UV__SIGNAL_ONE_SHOT 0x100
+# define UV__HANDLE_INTERNAL 0x80
+# define UV__HANDLE_ACTIVE 0x40
+# define UV__HANDLE_REF 0x20
+# define UV__HANDLE_CLOSING 0x01
#endif
int uv__loop_configure(uv_loop_t* loop, uv_loop_option option, va_list ap);
@@ -215,6 +218,30 @@ void uv__fs_scandir_cleanup(uv_fs_t* req);
} \
while (0)
+/* Note: uses an open-coded version of SET_REQ_SUCCESS() because of
+ * a circular dependency between src/uv-common.h and src/win/internal.h.
+ */
+#if defined(_WIN32)
+# define UV_REQ_INIT(req, typ) \
+ do { \
+ (req)->type = (typ); \
+ (req)->u.io.overlapped.Internal = 0; /* SET_REQ_SUCCESS() */ \
+ } \
+ while (0)
+#else
+# define UV_REQ_INIT(req, typ) \
+ do { \
+ (req)->type = (typ); \
+ } \
+ while (0)
+#endif
+
+#define uv__req_init(loop, req, typ) \
+ do { \
+ UV_REQ_INIT(req, typ); \
+ uv__req_register(loop, req); \
+ } \
+ while (0)
/* Allocator prototypes */
void *uv__calloc(size_t count, size_t size);