chore: add macros so we can swap implementations

This commit is contained in:
Andrew Johnston 2026-02-16 23:51:15 +00:00
parent 50ed2fd7bd
commit 350f735786

View File

@ -450,6 +450,22 @@ int uv__iou_fs_unlink(uv_loop_t* loop, uv_fs_t* req);
#if defined(__APPLE__) #if defined(__APPLE__)
int uv___stream_fd(const uv_stream_t* handle); int uv___stream_fd(const uv_stream_t* handle);
#define uv__stream_fd(handle) (uv___stream_fd((const uv_stream_t*) (handle))) #define uv__stream_fd(handle) (uv___stream_fd((const uv_stream_t*) (handle)))
#ifdef EV64
#define SET_EVENT(a, b, c, d, e) EV_SET64(a, b, c, d, e, 0, 0, 0, 0)
#define KEVENT(a, b, c, d, e, f, g) kevent64(a, b, c, d, e, f, g)
#define KEVENT_S struct kevent64_s
#else
#define SET_EVENT(a, b, c, d, e) EV_SET(a, b, c, d, e, 0, 0)
#define KEVENT(a, b, c, d, e, f, g) kevent(a, b, c, d, e, g)
#define KEVENT_S struct kevent
#endif
#ifndef KEVENT_FLAG_IMMEDIATE
#define KEVENT_FLAG_IMMEDIATE 1
#endif
#ifndef KEVENT_FLAG_NONE
#define KEVENT_FLAG_NONE 0
#endif
#else #else
#define uv__stream_fd(handle) ((handle)->io_watcher.fd) #define uv__stream_fd(handle) ((handle)->io_watcher.fd)
#endif /* defined(__APPLE__) */ #endif /* defined(__APPLE__) */