Repository navigation
fix(headers): rename the None members X11's <X11/X.h> macro breaks - #589
Merged
Merged
Conversation
X11's <X11/X.h> does `#define None 0L`, so two public declarations stopped compiling in any translation unit that had an X11 header in scope first -- cvcGL apps on Linux get X11 through VTK's X11 render window: - cvc::ariadne::BorderShow::None -> BorderShow::Off (inc/cvc/ariadne/widget.h; the default for Layout::borders). The .ari loader never spelled it, so the DSL is unchanged. - cvc::gl::Switch::None -> Switch::Off (inc/cvc/gl/nodes.h), next to Switch::All; the Inventor "no child" value (-1) is unchanged. Source-level rename only (same values); nothing in the bindings or in the downstream repos uses either name. An audit of every public header against all 3,228 macros from <X11/X.h>, <X11/Xlib.h>, <X11/Xutil.h> and <X11/keysym.h> finds no other collision (NULL aside). Regression tests: - x11_macro_headers_test: <X11/X.h> first, then <cvc/ariadne/widget.h>. - cvcgl_x11_macros (headless): VTK headers, then <X11/X.h>, then <cvc/gl/nodes.h> -- the order VTK's X11 render window produces (X11 before VTK breaks VTK's own vtksys/Status.hxx on `Success`). Both skip the X11 include where X11 headers are unavailable.
googletest declares its own `struct None` (gtest/internal/gtest-type-util.h), so with <X11/X.h> first the macro broke gtest itself -- the Linux Debug lanes failed compiling gtest-type-util.h / gtest-internal.h, not libcvc. Parse gtest before X11; the test is about libcvc's headers, which still come after the macro. (The earlier local check used a gtest stub, which has no `None`.)
transfix
added a commit
that referenced
this pull request
Oct 9, 2026
Patch release carrying the fixes since 3.5.0: the cvcGL M_PI build fix (#582), CameraController Map mode holding its pose (#584), the tag-release / publish workflow fixes (#585, #586), macro-safe public headers after <signal.h> / <sys/param.h> (#588), and the X11 `None` renames (#589: ariadne::BorderShow::None -> Off, gl::Switch::None -> Off). Bumps project(VERSION) 3.5.0 -> 3.5.1 and every cvcpkg recipe's upstream_version to match (cvc_revision stays 1, per the recipe-version gate).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
X11's
<X11/X.h>does#define None 0L. Two public declarations namedNonetherefore fail to compile in any translation unit that has an X11 header in scope first. cvcGL apps on Linux are exposed to this, because they get X11 through VTK's X11 render window.cvc::ariadne::BorderShow::NoneBorderShow::Offinc/cvc/ariadne/widget.h(theLayout::bordersdefault)cvc::gl::Switch::None(-1)Switch::Off(-1)inc/cvc/gl/nodes.h, next toSwitch::AllThis renames names only; the values are unchanged. Nothing in
bindings/, the.ariDSL (the loader never spellsBorderShow::None), or the downstream repos (cvcdbg, volrover, cyos, txwtf, cvcpkg) uses either name. Follows up #588, which flagged this collision and left it out of scope.Audit: I checked every public header against all 3,228 macros from
<X11/X.h>,<X11/Xlib.h>,<X11/Xutil.h>and<X11/keysym.h>.Noneis the only collision;NULLhits are intended uses. Private.cpp-local enums such asGesture::Noneand the examples'Capture::Noneare not public API and are untouched.Regression tests
x11_macro_headers_testincludes<X11/X.h>first, then<cvc/ariadne/widget.h>, and checks thatLayout::bordersdefaults toBorderShow::Off.cvcgl_x11_macros(headless) includes VTK headers, then<X11/X.h>, then<cvc/gl/nodes.h>. That's the order VTK's X11 render window produces. Putting X11 before VTK breaks VTK's ownvtksys/Status.hxxon X11'sSuccessmacro, which is outside libcvc. Itstatic_assertsSwitch::Off == -1/Switch::All == -3.Both skip the X11 include where X11 headers aren't available, so on Windows and macOS they compile without the macro.
Verification
Built locally with g++ 11 against an installed libcvc 3.5.0 prefix (VTK 9.5, X11 headers):
widget.h/nodes.h): both test files fail withX11/X.h: expected identifier before numeric constant.x11_macro_headers_testpasses (1/1).cvcgl_x11_macrosbuilds against VTK and runs (ok). Both build cleanly under-Wall -Wextra.ftxui_backend.cpp,cvcGL/nodes.cppandcvcgl_traversal.cppcompile against the new headers.check_test_targets.pypasses (161). The changed lines and both new files are clang-format clean.Release note (source-level rename, no ABI change):
ariadne::BorderShow::None→BorderShow::Off,gl::Switch::None→Switch::Off.