Closed mklefrancois closed 2 months ago
An alternative might be changing whatever you're including before that is using a preprocessor macro to make None
a numeric constant. Is it possible to use a const
value, or differently named macro like PROJECTNAME_NONE
or NONE
? Or #undef NONE
before including slang.h?
In fact, we do exactly this because of these being defined in xlib headers apparently: https://github.com/shader-slang/slang/blob/8fd9e5d89b04020ff65e7ce9e0b43c1081580347/tools/gfx/vulkan/vk-module.h#L22-L28
As does Firefox: https://bugzilla.mozilla.org/show_bug.cgi?id=1288686
I don't think we should change our code just because some other library out there is being silly.
As @expipiplus1 suggested, there are solutions there to workaround the mess caused by X11.h, and it is widely used in many projects. I am closing this issue as won't fix, but if this workaround doesn't work for you, feel free to reopen.
Depending on the order of includes, compiling on Linux, I see this error for all
None
enum.Example of the error:
I think it would be better to have a different name than
None
to avoid this issue.