From 3cd62994c76986a2a6becb9024a4e96acc0d0449 Mon Sep 17 00:00:00 2001 From: hackerchai Date: Wed, 7 Aug 2024 12:03:28 +0800 Subject: [PATCH] Revert "refactor(c/libuv): Use cgo alias replace struct assertion in fs" This reverts commit 45ba5b8dc50a13223e05ad673f4e57d7277d3f24. # Conflicts: # c/libuv/net.go --- c/libuv/fs.go | 8 +++----- c/libuv/net.go | 5 +++++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/c/libuv/fs.go b/c/libuv/fs.go index 7c67fd73..71a78e85 100644 --- a/c/libuv/fs.go +++ b/c/libuv/fs.go @@ -1,9 +1,5 @@ package libuv -//#cgo pkg-config: libuv -//#include -import "C" - import ( _ "unsafe" @@ -72,7 +68,9 @@ type File c.Int /* Handle types. */ -type Fs C.uv_fs_t +type Fs struct { + Unused [440]byte +} type FsEvent struct { Unused [0]byte diff --git a/c/libuv/net.go b/c/libuv/net.go index 7dbfa403..80e8f186 100644 --- a/c/libuv/net.go +++ b/c/libuv/net.go @@ -117,6 +117,10 @@ type GetNameInfo struct { Unused [0]byte } +type Shutdown struct { + Unused [0]byte +} + // ---------------------------------------------- /* Function type */ @@ -144,6 +148,7 @@ type ConnectionCb func(server *Stream, status c.Int) // llgo:type C type ShutdownCb func(req *Shutdown, status c.Int) + // ---------------------------------------------- /* Handle related function and method */