From 5b45be4e83c7e0d62fb949dba32bb9f832c1df5b Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 15 Jan 2019 13:47:26 +0100 Subject: Add support for multiline C definitions in NK_C_API + test Signed-off-by: Szczepan Zalega --- unittest/conftest.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'unittest/conftest.py') diff --git a/unittest/conftest.py b/unittest/conftest.py index 253e1d8..669dc23 100644 --- a/unittest/conftest.py +++ b/unittest/conftest.py @@ -44,13 +44,13 @@ def C(request=None): cnt = 0 a = iter(declarations) for declaration in a: - if declaration.strip().startswith('NK_C_API'): + if declaration.strip().startswith('NK_C_API') \ + or declaration.strip().startswith('struct'): declaration = declaration.replace('NK_C_API', '').strip() - while ';' not in declaration: - declaration += (next(a)).strip() - # print(declaration) + while ');' not in declaration and '};' not in declaration: + declaration += (next(a)).strip()+'\n' ffi.cdef(declaration, override=True) - cnt +=1 + cnt += 1 print('Imported {} declarations'.format(cnt)) C = None -- cgit v1.2.1