Repository navigation
fix(headers): compile after <signal.h> / <sys/param.h> -- rename world_units' si_value, macro-proof MIN/MAX - #588
Merged
Conversation
…d_units' si_value, macro-proof MIN/MAX glibc's <signal.h> defines `#define si_value _sifields._rt.si_sigval`, so any TU that includes it before <cvc/core/world_units.h> fails: world_units.h:147:28: error: expected ',' or '...' before '.' token Seen building volrover3's GeometryDialog/IsosurfaceDialog/ ProceduralGeometryDialog/SDFDialog against the installed 3.5.0 prefix (transfix/volrover#48). - world_units::to_display/format: rename the `si_value` parameter to `canonical_value` (pairs with from_display's `display_value`; no si_* prefix, which glibc/musl reserve for siginfo_t accessor macros). Parameter names only, so no ABI/API change; docs updated to match. - utility.h: an audit of every identifier in inc/ against the macros defined by ~50 glibc/POSIX headers found one more clash: the cvc::MIN / cvc::MAX templates break after <sys/param.h> (also macOS, GLib), whose function-like MIN(a,b)/MAX(a,b) expand the declarations. Parenthesize the declarator names; existing callers are unchanged. - New system_macro_headers_test: includes <signal.h>, <sys/param.h>, <sys/stat.h>, <sys/types.h> (POSIX) or <windows.h> (the repo's WIN32_LEAN_AND_MEAN + NOMINMAX pattern) before a representative public header from every cvc module, so a regression fails the build.
This was referenced Oct 9, 2026
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.
Problem
glibc's
<signal.h>(bits/types/siginfo_t.h) definesso any TU that includes
<signal.h>before<cvc/core/world_units.h>fails to compile:Found building volrover3's
GeometryDialog.cpp,IsosurfaceDialog.cpp,ProceduralGeometryDialog.cppandSDFDialog.cppagainst the installed 3.5.0 prefix (transfix/volrover#48).Changes
world_units::to_display/world_units::format: renamed thesi_valueparameter tocanonical_valuein the header,world_units.cppanddocs/WORLD_UNITS_API.md. The name pairs withfrom_display'sdisplay_valueand drops thesi_*prefix, which glibc and musl use forsiginfo_taccessor macros. Only parameter names change, so there is no API or ABI change.cvc/utility/utility.h: the audit below found one more real clash. glibc's (and macOS's)<sys/param.h>and GLib define function-likeMIN(a,b)/MAX(a,b)macros, which expand the declarations of thecvc::MIN/cvc::MAXtemplates. The declarator names are now parenthesized (const T &(MIN)(...)). Existing callers are unchanged:cvc::MIN(a, b), unqualifiedMIN(a, b),MIN<int>(...)and&cvc::MAX<long>all still compile.system_macro_headers_test(C++20, registered in all five places): the TU includes<signal.h>,<sys/param.h>,<sys/stat.h>and<sys/types.h>on POSIX, or<windows.h>behind the repo's usualWIN32_LEAN_AND_MEAN+NOMINMAXguards, before a representative public header from every module in thecvctarget. It leaves outcvc/gl/*(cvcGL, needs VTK/GL),hdf5_utils.h,project_verts.h(CGAL) and the CUDA headers. If a header regresses, this test stops compiling. Its two smallTESTs callworld_unitsand(cvc::MIN)/(cvc::MAX).Macro-name audit of
inc/Every identifier token in all 262 public headers (comments and strings stripped) was checked against:
signal.h,sys/{stat,types,sysmacros,param,wait,socket,...}.h,errno.h,stdio.h,unistd.h,netinet/*, ...)si_valueandMIN/MAX(both fixed). The other hits are intentional uses (NULL,UINT32_MAX,std::isfinite, ...).<windows.h>, full and withWIN32_LEAN_AND_MEAN+NOMINMAXRGB, which appears only as the enumeratorpixel_format::RGBand is never followed by(, so the function-like macro can't expand.si_value si_pid si_uid si_addr si_status si_band si_code si_errno sa_handler sa_sigaction st_atime st_mtime st_ctime errno stdin stdout stderr major minor makedev unix linux min max small near far interface ERROR DELETE IN OUT OPTIONAL TRUE FALSE, plus common Win32 A/W names and BSDsys/param.hhelpersmin/max(about 70 uses, e.g.voxels::min(),std::numeric_limits<>::max()) only clash with<windows.h>withoutNOMINMAX, which the repo already handles by convention (config.h,magick_io.cpp,(max)()inasync_lane.h).Xlib.h,Xutil.h,glx.h), informational#define None 0Lcollides withgl::Switch::Noneandariadne::BorderShow::None. Not changed here: the only fix is renaming public enumerators/constants, an API change that deserves its own PR.Verification
Tested locally with g++ 11,
-std=c++20, against this tree'sinc/plus the installed 3.5.0 SDK's headers and defines; gtest was a local stub, not committed.#include <signal.h>then#include <cvc/core/world_units.h>fails on master and compiles with this branch.world_units.h:147/163andutility.h:77/78errors. On this branch: compiles with no warnings under-Wall -Wextra, also under-std=gnu++20. Linked against libcvc 3.5.0, both TESTs pass.world_units.cpp: compiles, including with-include signal.h.check_test_targets.py:OK: all 161 test executables reach TEST_TARGETS.git clang-format --diff origin/masterreports 0 files to reformat, and the new file is also clean when checked in full. The system headers sit in their own#ifndef _WIN32block, so include regrouping can't move them after the libcvc headers.<cvc/...>includes in the test resolve ininc/and are installed viainstall(DIRECTORY inc/cvc/).