diff --git a/cpp/inih/_wrap/llgo_check.cpp b/cpp/inih/_wrap/llgo_check.cpp new file mode 100644 index 00000000..2a1a5bf7 --- /dev/null +++ b/cpp/inih/_wrap/llgo_check.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + printf("sizeof(Reader) = %lu\n", sizeof(INIReader)); + return 0; +} diff --git a/cpp/inih/_wrap/llgo_check.go b/cpp/inih/_wrap/llgo_check.go new file mode 100644 index 00000000..a5ae28ec --- /dev/null +++ b/cpp/inih/_wrap/llgo_check.go @@ -0,0 +1,16 @@ +package main + +import ( + "unsafe" + + "github.com/goplus/llgo/c" + "github.com/goplus/llgo/cpp/inih" +) + +const ( + LLGoCFlags = "$(pkg-config --cflags INIReader)" +) + +func main() { + c.Printf(c.Str("sizeof(Reader) = %lu\n"), unsafe.Sizeof(inih.Reader{})) +} diff --git a/cpp/inih/reader.go b/cpp/inih/reader.go index ee194e77..6f0a1638 100644 --- a/cpp/inih/reader.go +++ b/cpp/inih/reader.go @@ -27,7 +27,7 @@ import ( // llgo:type C type Reader struct { - Unused [24]byte + Unused [32]byte } // llgo:link (*Reader).InitFromBuffer C._ZN9INIReaderC1EPKcm diff --git a/cpp/std/_wrap/llgo_check.cpp b/cpp/std/_wrap/llgo_check.cpp new file mode 100644 index 00000000..1149cec3 --- /dev/null +++ b/cpp/std/_wrap/llgo_check.cpp @@ -0,0 +1,7 @@ +#include +#include + +int main() { + printf("sizeof(std::string) = %lu\n", sizeof(std::string)); + return 0; +} diff --git a/cpp/std/_wrap/llgo_check.go b/cpp/std/_wrap/llgo_check.go new file mode 100644 index 00000000..1a0f0e13 --- /dev/null +++ b/cpp/std/_wrap/llgo_check.go @@ -0,0 +1,12 @@ +package main + +import ( + "unsafe" + + "github.com/goplus/llgo/c" + "github.com/goplus/llgo/cpp/std" +) + +func main() { + c.Printf(c.Str("sizeof(std::string) = %lu\n"), unsafe.Sizeof(std.String{})) +} diff --git a/cpp/std/_wrap/string.cpp b/cpp/std/_wrap/string.cpp index 94f73508..ba17a915 100644 --- a/cpp/std/_wrap/string.cpp +++ b/cpp/std/_wrap/string.cpp @@ -1,4 +1,5 @@ #include +#include extern "C" {