Revision 7322c4248cf8e8d29da37f1f475b62047780b125 authored by Stefan Karpinski on 21 January 2018, 16:01:01 UTC, committed by GitHub on 21 January 2018, 16:01:01 UTC
2 parent s 324dc49 + 9d937c2
Raw File
uv_constants.h
// This file is a part of Julia. License is MIT: https://julialang.org/license

#include "uv.h"
#define XX(uc,lc) :UV_##uc,
#define YY(uc,lc) (:UV_##uc,UV__##uc),
const uv_handle_types = [UV_HANDLE_TYPE_MAP(XX) :UV_FILE]
const uv_req_types = [UV_REQ_TYPE_MAP(XX)]
const uv_err_vals = [UV_ERRNO_MAP(YY)]
let
    handles = [:UV_UNKNOWN_HANDLE; uv_handle_types; :UV_HANDLE_TYPE_MAX; :UV_RAW_FD; :UV_RAW_HANDLE]
    reqs = [:UV_UNKNOWN_REQ; uv_req_types; :UV_REQ_TYPE_PRIVATE; :UV_REQ_TYPE_MAX]
    for i=0:(length(handles)-1)
    @eval const $(handles[i+1]) = $i
    end
    for i=0:(length(reqs)-1)
    @eval const $(reqs[i+1]) = $i
    end
    for (v,val) in uv_err_vals
    @eval const $v = $val
    end
end
back to top