Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
melonedo committed Aug 28, 2021
1 parent 86f973d commit 3ab3d10
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/src/generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ build!(ctx, BUILDSTAGE_PRINTING_ONLY)
```

### Multi-platform configuration
Some headers may contain system-dependent symbols such as `long` or `char`, or system-indenpendent symbols may be resolved to system depent ones, for example, `int64_t` may be defined as `long`. You can skip these symbols and add them back manually as in [Skipping specific symbols](@ref). If the differences are two large to be manually fixed, you can generate wrappers for each platform as in [CImGUI.jl](https://github.com/JuliaImGui/LibCImGui.jl/blob/9af63ee69dc109000dabdb30ef86073d546738c3/gen/generator.jl).
Some headers may contain system-dependent symbols such as `long` or `char`, or system-indenpendent symbols may be resolved to system depent ones, for example, `time_t` is usually just a 64-bit unsigned integer, but implementations may conditionally implement it as `long` or `long long`, which is not portable. You can skip these symbols and add them back manually as in [Skipping specific symbols](@ref). If the differences are two large to be manually fixed, you can generate wrappers for each platform as in [LibClang.jl](https://github.com/Gnimuc/LibClang.jl/blob/v0.61.0/gen/generator.jl).

## Variadic Function
With the help of `@ccall` macro, variadic C functions can be from Julia, for example, `@ccall printf("%d\n"::Cstring; 123::Cint)::Cint` can be used to call the C function `printf`. Note that those arguments after the semicolon `;` are variadic arguments.
Expand Down
10 changes: 1 addition & 9 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,7 @@ ctx = create_context(headers, args, options)
# run generator
build!(ctx)
```
Note that it might complain about missing some std headers, e.g. `fatal error: 'time.h' file not found`,
which could be fixed by adding `-Istdlib/include/on/your/specific/platform` to `clang_args`, for example,
```
# on macOS
using Clang: find_std_headers
for header in find_std_headers()
push!(clang_args, "-I"*header)
end
```



!!! note "Compatibility"
Expand Down

0 comments on commit 3ab3d10

Please sign in to comment.