那位高手帮我看看,这样的C代码转换成Delphi怎么转,谢谢了。
#defineUV_ERRNO_MAP(XX)\XX(E2BIG,"argumentlisttoolong")\XX(EACCES,"permissiondenied")...
#define UV_ERRNO_MAP(XX) \
XX(E2BIG, "argument list too long") \
XX(EACCES, "permission denied") \
XX(EADDRINUSE, "address already in use") \
.... (这里还有类似的,就省略了)
#define UV_HANDLE_TYPE_MAP(XX) \
XX(ASYNC, async) \
XX(CHECK, check) \
.... (这里还有类似的,就省略了)
#define UV_REQ_TYPE_MAP(XX) \
XX(REQ, req) \
.... (这里还有类似的,就省略了)
typedef enum {
#define XX(code, _) UV_ ## code = UV__ ## code,
UV_ERRNO_MAP(XX)
#undef XX
UV_ERRNO_MAX = UV__EOF - 1
} uv_errno_t;
typedef enum {
UV_UNKNOWN_HANDLE = 0,
#define XX(uc, lc) UV_##uc,
UV_HANDLE_TYPE_MAP(XX)
#undef XX
UV_FILE,
UV_HANDLE_TYPE_MAX
} uv_handle_type; *)
typedef enum {
UV_UNKNOWN_REQ = 0,
#define XX(uc, lc) UV_##uc,
UV_REQ_TYPE_MAP(XX)
#undef XX
UV_REQ_TYPE_PRIVATE
UV_REQ_TYPE_MAX
} uv_req_type; 展开
XX(E2BIG, "argument list too long") \
XX(EACCES, "permission denied") \
XX(EADDRINUSE, "address already in use") \
.... (这里还有类似的,就省略了)
#define UV_HANDLE_TYPE_MAP(XX) \
XX(ASYNC, async) \
XX(CHECK, check) \
.... (这里还有类似的,就省略了)
#define UV_REQ_TYPE_MAP(XX) \
XX(REQ, req) \
.... (这里还有类似的,就省略了)
typedef enum {
#define XX(code, _) UV_ ## code = UV__ ## code,
UV_ERRNO_MAP(XX)
#undef XX
UV_ERRNO_MAX = UV__EOF - 1
} uv_errno_t;
typedef enum {
UV_UNKNOWN_HANDLE = 0,
#define XX(uc, lc) UV_##uc,
UV_HANDLE_TYPE_MAP(XX)
#undef XX
UV_FILE,
UV_HANDLE_TYPE_MAX
} uv_handle_type; *)
typedef enum {
UV_UNKNOWN_REQ = 0,
#define XX(uc, lc) UV_##uc,
UV_REQ_TYPE_MAP(XX)
#undef XX
UV_REQ_TYPE_PRIVATE
UV_REQ_TYPE_MAX
} uv_req_type; 展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励10(财富值+成长值)+提问者悬赏20(财富值+成长值)
1个回答
展开全部
#define UV_ERRNO_MAP(XX) \
XX(E2BIG, "argument list too long") \
XX(EACCES, "permission denied") \
XX(EADDRINUSE, "address already in use") \
.... (这里还有类似的,就省略了)
=====>
type
TXXProc = procedure(_exception: TException; _info: string);
procedure UV_ERRNO_MAP(XX: TXXProc);
begin
XX(E2BIG, "argument list too long");
XX(EACCES, "permission denied");
XX(EADDRINUSE, "address already in use");
.... (这里还有类似的,就省略了)
end;
XX(E2BIG, "argument list too long") \
XX(EACCES, "permission denied") \
XX(EADDRINUSE, "address already in use") \
.... (这里还有类似的,就省略了)
=====>
type
TXXProc = procedure(_exception: TException; _info: string);
procedure UV_ERRNO_MAP(XX: TXXProc);
begin
XX(E2BIG, "argument list too long");
XX(EACCES, "permission denied");
XX(EADDRINUSE, "address already in use");
.... (这里还有类似的,就省略了)
end;
追问
那下面的枚举怎么转呢?
追答
汗一个!水平有限,没看明白C代码。
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询