diff options
author | Ken Raeburn <raeburn@raeburn.org> | 2012-05-21 00:30:45 -0400 |
---|---|---|
committer | Ken Raeburn <raeburn@raeburn.org> | 2012-05-21 01:13:13 -0400 |
commit | cff1d39b2003470b5dcdab988e279587ae2eed8c (patch) | |
tree | 4b9cda9c33e5b87bab1c50c58f5d15f2ea5174a8 /test-suite/tests/foreign.test | |
parent | a722bcaa13acd3185e8e7b84f64cb614a46f3532 (diff) | |
download | guile-cff1d39b2003470b5dcdab988e279587ae2eed8c.tar.gz |
Fix FFI struct sizing to account for trailing padding.
* libguile/foreign.c (scm_sizeof): Make sure the overall size is a
multiple of the alignment of the structure.
* test-suite/tests/foreign.test: Test size of { double, int8 }.
Diffstat (limited to 'test-suite/tests/foreign.test')
-rw-r--r-- | test-suite/tests/foreign.test | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test-suite/tests/foreign.test b/test-suite/tests/foreign.test index 6eafe954a..47686eebd 100644 --- a/test-suite/tests/foreign.test +++ b/test-suite/tests/foreign.test @@ -303,6 +303,10 @@ (= (sizeof (list int8 double)) (+ (alignof double) (sizeof double)))) + (pass-if "sizeof { double, int8 }" + (= (sizeof (list double int8)) + (+ (alignof double) (sizeof double)))) + (pass-if "sizeof { short, int, long, pointer }" (let ((layout (list short int long '*))) (>= (sizeof layout) |