那位高手帮我看看,这样的C代码转换成Delphi怎么转,谢谢了。
#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;
#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;