From ed64a88301cd8498766b2afe284ed18e5dc7ef0c Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sun, 4 Oct 2026 05:59:51 +0800 Subject: [PATCH 1/2] c: wchar_t (Windows only), char8_t, char16_t, char32_t --- c/c.go | 13 ++++++++++--- c/ctypes_windows.go | 4 ++++ c/llcppg.pub | 4 ++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/c/c.go b/c/c.go index 9cb38db..ce4cf09 100644 --- a/c/c.go +++ b/c/c.go @@ -21,12 +21,19 @@ import ( ) type ( - Void = [0]byte + Void = [0]byte + Char = int8 - Float = float32 - Double = float64 + Char8T = uint8 + Char16T = uint16 + Char32T = uint32 + + Float = float32 + Double = float64 + Pointer = unsafe.Pointer VaList = Pointer + FilePtr = *FILE Int = int32 diff --git a/c/ctypes_windows.go b/c/ctypes_windows.go index 1ca0749..f4897db 100644 --- a/c/ctypes_windows.go +++ b/c/ctypes_windows.go @@ -24,3 +24,7 @@ type ( Long = int32 Ulong = uint32 ) + +type ( + WcharT = uint16 +) diff --git a/c/llcppg.pub b/c/llcppg.pub index 66f8ef8..0c53833 100644 --- a/c/llcppg.pub +++ b/c/llcppg.pub @@ -1,6 +1,10 @@ D github.com/goplus/lib/c/os D github.com/goplus/lib/c/time T FILE FILE +T wchar_t WcharT +T char8_t Char8T +T char16_t Char16T +T char32_t Char32T T size_t SizeT T ssize_t SsizeT T ptrdiff_t PtrdiffT From c7a14ab01bb5e4dcf0391ddd8d74b7078f7cb7ff Mon Sep 17 00:00:00 2001 From: xushiwei Date: Sun, 4 Oct 2026 06:06:16 +0800 Subject: [PATCH 2/2] wchar_t for non Windows --- c/ctypes_32bit.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/c/ctypes_32bit.go b/c/ctypes_32bit.go index 7d64ca5..d9ba12f 100644 --- a/c/ctypes_32bit.go +++ b/c/ctypes_32bit.go @@ -25,3 +25,7 @@ type ( Long = int32 Ulong = uint32 ) + +type ( + WcharT = int32 +)