diff options
Diffstat (limited to 'misc/cgo')
-rw-r--r-- | misc/cgo/testcdefs/cdefstest.go | 3 | ||||
-rw-r--r-- | misc/cgo/testcdefs/main.c | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/misc/cgo/testcdefs/cdefstest.go b/misc/cgo/testcdefs/cdefstest.go index 0804083a0..5e613c79e 100644 --- a/misc/cgo/testcdefs/cdefstest.go +++ b/misc/cgo/testcdefs/cdefstest.go @@ -56,4 +56,5 @@ typedef struct timespec { import "C" type CdefsTest C.struct_cdefsTest -type PackedTest C.struct_packedTest + +//type PackedTest C.struct_packedTest diff --git a/misc/cgo/testcdefs/main.c b/misc/cgo/testcdefs/main.c index c13a80430..594a43167 100644 --- a/misc/cgo/testcdefs/main.c +++ b/misc/cgo/testcdefs/main.c @@ -17,6 +17,8 @@ struct CdefsOrig { int8 **array5[20][20]; }; +// Packed structs are no longer supported for -cdefs. +/* typedef struct PackedOrig PackedOrig; #pragma pack on struct PackedOrig { @@ -25,14 +27,15 @@ struct PackedOrig { int64 third; }; #pragma pack off +*/ void main·test(int32 ret) { CdefsOrig o; CdefsTest t; - PackedOrig po; - PackedTest pt; + // PackedOrig po; + // PackedTest pt; ret = 0; if(sizeof(t.array1) != sizeof(o.array1) || offsetof(CdefsTest, array1[0]) != offsetof(CdefsOrig, array1[0])) { @@ -55,6 +58,7 @@ main·test(int32 ret) runtime·printf("array5: size, offset = %d, %d, want %d, %d\n", sizeof(t.array5), offsetof(CdefsTest, array5[0][0]), sizeof(o.array5), offsetof(CdefsOrig, array5[0][0])); ret = 1; } +/* if(sizeof(pt.first) != sizeof(po.first) || offsetof(PackedTest, first) != offsetof(PackedOrig, first)) { runtime·printf("first: size, offset = %d, %d, want %d, %d\n", sizeof(pt.first), offsetof(PackedTest, first), sizeof(po.first), offsetof(PackedOrig, first)); ret = 1; @@ -67,5 +71,6 @@ main·test(int32 ret) runtime·printf("third: size, offset = %d, %d, want %d, %d\n", sizeof(pt.third), offsetof(PackedTest, third), sizeof(po.third), offsetof(PackedOrig, third)); ret = 1; } +*/ FLUSH(&ret); // flush return value } |