# Clang.jl ignoring #define starting with underscore

**URL:** <https://discourse.julialang.org/t/clang-jl-ignoring-define-starting-with-underscore/38426>\
**Category:** General Usage\
**Tags:** c, clang\
**Created:** [April 29, 2020, 2:13pm UTC](https://discourse.julialang.org/t/clang-jl-ignoring-define-starting-with-underscore/38426 "2020-04-29T14:13:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Post date:** [April 29, 2020, 2:13pm UTC](https://discourse.julialang.org/t/clang-jl-ignoring-define-starting-with-underscore/38426/1 "2020-04-29T14:13:15Z")

</div>

I have some header files which I’d like to wrap with [Clang.jl](https://github.com/JuliaInterop/Clang.jl).  
Why does it ignore definitions starting with underscore such as:  
`#define _VAR (1)`  
If I remove the underscore, it works fine:  
`#define VAR (1)`  
`const VAR = 1`

The code used:

```julia
using Clang

const INCLUDE_PATH = pwd()
const HEADERS_PATH = [joinpath(INCLUDE_PATH, header) for header in readdir(INCLUDE_PATH) if endswith(header, ".h")]

wc = init(; headers = HEADERS_PATH,
            output_file = joinpath(@ __DIR__ , "test_api.jl"),
            common_file = joinpath(@ __DIR__ , "test_common.jl"),
            clang_includes = vcat(INCLUDE_PATH, CLANG_INCLUDE),
            clang_args = ["-I", joinpath(INCLUDE_PATH, "..")],
            header_wrapped = (root, current)->root == current,
            header_library = x->"libtest",
            clang_diagnostics = true,
            )

run(wc)

```

One can test by simply creating a .h file with `#define _VAR (1)`

---

<div class="post-metadata">

**Author:** ![Gnimuc](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gnimuc/32/2194_2.png) [@Gnimuc](https://discourse.julialang.org/u/Gnimuc)\
**Post date:** [April 30, 2020, 1:55am UTC](https://discourse.julialang.org/t/clang-jl-ignoring-define-starting-with-underscore/38426/2 "2020-04-30T01:55:37Z")

</div>

Identifiers with a leading underscore are reserved, so we ignore them intentionally: [Clang.jl/wrap\_c.jl at 5971591cd4bf0d8b128da3d8cb7a2649f6c2e665 · JuliaInterop/Clang.jl · GitHub](https://github.com/JuliaInterop/Clang.jl/blob/5971591cd4bf0d8b128da3d8cb7a2649f6c2e665/src/wrap_c.jl#L395)

---

<div class="post-metadata">

**Author:** ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Post date:** [April 30, 2020, 7:04am UTC](https://discourse.julialang.org/t/clang-jl-ignoring-define-starting-with-underscore/38426/3 "2020-04-30T07:04:00Z")

</div>

Thank you for the quick reply and explanation! I managed to solve this by a small manual edit of the file. It was used as a constant which was added to other constants in the header (error codes)
