Merge pull request #506 from xushiwei/q
_wrap: llgo_check (to be continued)
This commit is contained in:
7
cpp/inih/_wrap/llgo_check.cpp
Normal file
7
cpp/inih/_wrap/llgo_check.cpp
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <INIReader.h>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
printf("sizeof(Reader) = %lu\n", sizeof(INIReader));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
16
cpp/inih/_wrap/llgo_check.go
Normal file
16
cpp/inih/_wrap/llgo_check.go
Normal 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{}))
|
||||||
|
}
|
||||||
@@ -27,7 +27,7 @@ import (
|
|||||||
|
|
||||||
// llgo:type C
|
// llgo:type C
|
||||||
type Reader struct {
|
type Reader struct {
|
||||||
Unused [24]byte
|
Unused [32]byte
|
||||||
}
|
}
|
||||||
|
|
||||||
// llgo:link (*Reader).InitFromBuffer C._ZN9INIReaderC1EPKcm
|
// llgo:link (*Reader).InitFromBuffer C._ZN9INIReaderC1EPKcm
|
||||||
|
|||||||
7
cpp/std/_wrap/llgo_check.cpp
Normal file
7
cpp/std/_wrap/llgo_check.cpp
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
printf("sizeof(std::string) = %lu\n", sizeof(std::string));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
12
cpp/std/_wrap/llgo_check.go
Normal file
12
cpp/std/_wrap/llgo_check.go
Normal 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{}))
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
|
#include <new>
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user