From f396b4880f4a674ce6043de6ef3dc7f7d9d29a24 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 17 Aug 2021 06:48:01 -0700 Subject: ffi: fix broken deffi support for variadic functions. * stdlib/ffi.c (sys:analyze-argtypes): Add missing fallback case in filtering loop. This wouldn't have happened if we had a ecaseql macro, and used it. Or if we had coverage of this in tests. * tests/017/variadic.tl, tests/017/variadic.expected: New files. --- tests/017/variadic.expected | 1 + tests/017/variadic.tl | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 tests/017/variadic.expected create mode 100644 tests/017/variadic.tl (limited to 'tests') diff --git a/tests/017/variadic.expected b/tests/017/variadic.expected new file mode 100644 index 00000000..8a918349 --- /dev/null +++ b/tests/017/variadic.expected @@ -0,0 +1 @@ +foo-123 = 4.560 diff --git a/tests/017/variadic.tl b/tests/017/variadic.tl new file mode 100644 index 00000000..6fa464e0 --- /dev/null +++ b/tests/017/variadic.tl @@ -0,0 +1,6 @@ +(load "../common") + +(with-dyn-lib (libc) + (deffi printf-int-double "printf" int (str : int double))) + +(printf-int-double "foo-%d = %4.3f\n" 123 4.56) -- cgit v1.2.3