_wrap: llgo_check (to be continued)

This commit is contained in:
xushiwei
2024-07-13 19:53:55 +08:00
parent a3ea4798bc
commit 767a0cc1fd
6 changed files with 44 additions and 1 deletions

View File

@@ -0,0 +1,7 @@
#include <stdio.h>
#include <INIReader.h>
int main() {
printf("sizeof(Reader) = %lu\n", sizeof(INIReader));
return 0;
}

View File

@@ -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{}))
}

View File

@@ -27,7 +27,7 @@ import (
// llgo:type C
type Reader struct {
Unused [24]byte
Unused [32]byte
}
// llgo:link (*Reader).InitFromBuffer C._ZN9INIReaderC1EPKcm

View File

@@ -0,0 +1,7 @@
#include <stdio.h>
#include <string>
int main() {
printf("sizeof(std::string) = %lu\n", sizeof(std::string));
return 0;
}

View File

@@ -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{}))
}

View File

@@ -1,4 +1,5 @@
#include <string>
#include <new>
extern "C" {