JuliaLang/julia

cpp namespace pollution in julia.h

Open

#10,682 opened on Mar 30, 2015

View on GitHub
 (6 comments) (0 reactions) (0 assignees)Julia (5,773 forks)batch import
embeddinghelp wanted

Repository metrics

Stars
 (48,709 stars)
PR merge metrics
 (Avg merge 20d 6h) (157 merged PRs in 30d)

Description

The julia.h file #defines a bunch of symbols that could easily conflict with other header files if someone is embedding Julia: NWORDS, NORETURN, DLLEXPORT, MAX_ALIGN, STORE_ARRAY_LEN, ARRAY_INLINE_NBYTES, ENABLE_INFERENCE, COPY_STACKS, STDCALL, NBITS ... (tons of stuff via libsupport.h)

It seems like it would be better to

  • qualify all preprocessor symbols with JL_ in the julia.h file
  • include libsupport.h only in julia_internal.h.

Contributor guide