Skip to content

trouble wraping glib #206

@bjarthur

Description

@bjarthur

the master branch (fa22244) of clang is choking on a #define with special characters in it:

#define G_URI_RESERVED_CHARS_SUBCOMPONENT_DELIMITERS "!$&'()*+,;="

the error is:

[ Info: Error thrown. Last cursor available in Clang.wrap_c.debug_cursors
ERROR: Base.Meta.ParseError("invalid interpolation syntax: \"\$&\"")
Stacktrace:
 [1] #parse#1(::Bool, ::Bool, ::Bool, ::Function, ::String, ::Int64) at ./meta.jl:129
 [2] #parse at ./none:0 [inlined]
 [3] #parse#4(::Bool, ::Bool, ::Function, ::String) at ./meta.jl:164
 [4] parse at ./meta.jl:164 [inlined]
 [5] wrap(::Clang.wrap_c.WrapContext, ::OrderedCollections.OrderedDict{Symbol,Clang.wrap_c.ExprUnit}, ::Clang.cindex.MacroDefinition) at /Users/arthurb/.julia/dev/Clang/src/wrap_c.jl:630
 [6] wrap_header(::Clang.wrap_c.WrapContext, ::Clang.cindex.TranslationUnit, ::String, ::Array{Any,1}) at /Users/arthurb/.julia/dev/Clang/src/wrap_c.jl:684
 [7] run(::Clang.wrap_c.WrapContext) at /Users/arthurb/.julia/dev/Clang/src/wrap_c.jl:801
 [8] top-level scope at none:0

to reproduce, first install Cairo.jl, which is how i got the glib header files, and how i'm hoping to wrap all of libpangocairo, and then:

using Clang

context = wrap_c.init(
  clang_includes=[
    "/Users/arthurb/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/pango/1.42.4/include/pango-1.0",
    "/Users/arthurb/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/glib/2.58.0_1/include/glib-2.0",
    "/Users/arthurb/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/glib/2.58.0_1/lib/glib-2.0/include",
    "/Users/arthurb/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/cairo/1.14.12/include/cairo"],
  headers=[
    "/Users/arthurb/.julia/packages/Homebrew/l8kUw/deps/usr/Cellar/pango/1.42.4/include/pango-1.0/pango/pangocairo.h"],
  common_file="pangocairo-constants.jl",
  header_library=x->"_jl_libpangocairo")

run(context)

it's worth nothing that simply using Clang results in the following warning:

WARNING: could not import Base.search into cindex

any ideas? i'd be happy with a work around. thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions