[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Ctypesgen failure: /usr/include/lber.h:71: Syntax error at '\n'

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Mon, 01 Nov 2010 10:13:28 +0000

When I try to build Subversion's ctypes-python bindings, I get this

$ (cd obj-dir && make ctypes-python)
[...]/build/run_ctypesgen.sh [...very long line...]
Status: Preprocessing /tmp/tmpejFJ1B.h
Status: i486-linux-gnu-gcc -E -DLINUX=2 [...] /tmp/tmpejFJ1B.h
Status: Parsing /tmp/tmpejFJ1B.h
Error: /usr/include/lber.h:71: Syntax error at '\n'
Status: Processing description list.
Warning: Member "in" of Struct "apr_proc_t" has been renamed to "_in"
because it has the same name as a Python keyword.
Status: Writing to subversion/bindings/ctypes-python/svn_all.py.
Status: Wrapping complete.

I tried Google("ctypesgen lber") and ("ctypesgen \"Syntax error at\""),
and found no solutions, just
<http://svn.haxx.se/dev/archive-2008-07/0048.shtml> in which Arfrever
saw the same error.

ctypesgen.py is an up-to-date trunk checkout:

The root cause is twofold:

First, line 71-72 of </usr/include/lber.h> defines a macro with
mismatched parentheses in its expansion text:

#define LBER_INVALID(t) (((t) & (ber_tag_t) 0x080UL) \
        && (((t) & (ber_tag_t) ~ 0x0FF))

That was fixed (the macro was removed) in a later version of lber.h:
20Bugs?id=6402;usearchives=1>, but my system's packaging does not yet
use the later version.

Second, ctypesgen chokes on parsing this macro. I haven't investigated
trying to make ctypesgen parse this macro correctly, I just thought I'd
bring it up.

I am working around the issue by hand-editing my copy of "lber.h" to
remove that macro definition.

- Julian
Received on 2010-11-01 11:14:07 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.