summaryrefslogtreecommitdiffstats
path: root/tests/017/glob-carray.tl
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-05-21 15:53:52 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-05-21 15:53:52 -0700
commit6621bf2c4ad3969638cab8a35091ce70de1d1260 (patch)
tree08cb2d7f3fae0fb8694702b8d96737bf421e7c06 /tests/017/glob-carray.tl
parentb580e0f60eab4b23e782b0f2970823a51e5000bd (diff)
downloadtxr-6621bf2c4ad3969638cab8a35091ce70de1d1260.tar.gz
txr-6621bf2c4ad3969638cab8a35091ce70de1d1260.tar.bz2
txr-6621bf2c4ad3969638cab8a35091ce70de1d1260.zip
ffi: glob test: struct size on Linux and Cygwin.
* tests/017/glob-carray.tl (glob-t): Restructure to case statement. Add padding to struct based on looking at the glibc definition. Add FFI definition based on Cygwin header. * tests/017/glob-zarray.tl (glob-t): Likewise.
Diffstat (limited to 'tests/017/glob-carray.tl')
-rw-r--r--tests/017/glob-carray.tl31
1 files changed, 20 insertions, 11 deletions
diff --git a/tests/017/glob-carray.tl b/tests/017/glob-carray.tl
index f98359a8..d40dfdad 100644
--- a/tests/017/glob-carray.tl
+++ b/tests/017/glob-carray.tl
@@ -3,21 +3,30 @@
(defstruct glob-t nil
pathc pathv (reserve 0))
-(cond
- ((eq (os-symbol) :macos)
- (deffi-type glob-t (struct glob-t
- (pathc size-t)
- (nil int)
- (nil size-t)
- (nil int)
- (pathv (carray str-d))
- (nil (array 4 cptr)))))
+(caseq (os-symbol)
+ (:macos
+ (deffi-type glob-t (struct glob-t
+ (pathc size-t)
+ (nil int)
+ (nil size-t)
+ (nil int)
+ (pathv (carray str-d))
+ (nil (array 4 cptr)))))
+ ((:cygnal :cygwin)
+ (deffi-type glob-t (struct glob-t
+ (pathc size-t)
+ (nil size-t)
+ (nil size-t)
+ (nil int)
+ (pathv (carray str-d))
+ (nil (array 6 cptr)))))
(t (deffi-type glob-t (struct glob-t
(pathc size-t)
(pathv (carray str-d))
- (reserve size-t)))))
+ (reserve size-t)
+ (nil (array 5 cptr))))))
-(with-dyn-lib nil
+(with-dyn-lib (libc)
(deffi globb "glob" int (str int closure (ptr-out glob-t)))
(deffi globfree "globfree" void ((ptr-in glob-t)))
(deffi-cb glob-cb int (str int) -1))