Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#define a data type #103

Closed
bjarthur opened this issue Sep 10, 2014 · 0 comments · Fixed by #277
Closed

#define a data type #103

bjarthur opened this issue Sep 10, 2014 · 0 comments · Fixed by #277
Labels

Comments

@bjarthur
Copy link

given define.h with just:

#define FOO int
#define BAR void

i get the following error:

julia> using Clang

julia> context = wrap_c.init()
WrapContext(Ptr{Void} @0x00007fb0543a7740,ASCIIString[],"","",ASCIIString[],ASCIIString[],(anonymous function),(anonymous function),(anonymous function),(anonymous function),OrderedDict{Symbol,ExprUnit}(),Set{ASCIIString}({}),DefaultOrderedDict{ASCIIString,Array{Any,N},Function}(),InternalOptions(true,false),0,(anonymous function))

julia> context.common_file="common.jl"
"common.jl"

julia> wrap_c.wrap_c_headers(context, {"define.h"})
WARNING: wrap_c_headers: deprecated
WRAPPING HEADER: define.h
ERROR: ParseError("end of input")
 in __parse#7__ at ./string.jl:1242
 in __parse#7__ at /Users/arthurb/src/julia/usr/lib/julia/sys.dylib
 in parse at /Users/arthurb/src/julia/usr/lib/julia/sys.dylib (repeats 2 times)
 in parse at string.jl:1246
 in wrap at /Users/arthurb/.julia/v0.4/Clang/src/wrap_c.jl:568
 in wrap_header at /Users/arthurb/.julia/v0.4/Clang/src/wrap_c.jl:630
 in run at /Users/arthurb/.julia/v0.4/Clang/src/wrap_c.jl:747
 in wrap_c_headers at /Users/arthurb/.julia/v0.4/Clang/src/wrap_c.jl:777

all is good though if i simply delete one (either) of those define statements, OR exchange int AND void with numbers:

shell> cat define.h
#define FOO int

julia> wrap_c.wrap_c_headers(context, {"define.h"})
WARNING: wrap_c_headers: deprecated
WRAPPING HEADER: define.h
writing define.jl
1-element Array{Any,1}:
 nothing
shell> cat define.h
#define FOO 8
#define BAR 9

julia> wrap_c.wrap_c_headers(context, {"define.h"})
WARNING: wrap_c_headers: deprecated
WRAPPING HEADER: define.h
writing define.jl
1-element Array{Any,1}:
 nothing

is this the expected / desired behavior? this is with clang 0.0.2 and Julia Version 0.4.0-dev+512
Commit 3b2269d* (2014-09-08 14:32 UTC) on OS X.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants