dgb: portable pi constant for MSVC Windows release lane (M_PI undeclared) - #697
Merged
Conversation
…e lane) MSVC does not define the non-standard M_PI macro without _USE_MATH_DEFINES. binomial_conf_interval.hpp:ierf() used std::sqrt(M_PI) in its Newton step, which built on Linux/macOS but failed the Windows/MSVC dgb release lane with C2065 (undeclared identifier). Replace with a namespace-scope constexpr kPi to avoid header-order-dependent _USE_MATH_DEFINES fragility. No numeric change on any platform.
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
Replace
std::sqrt(M_PI)indgb/coin/binomial_conf_interval.hpp:ierf()with a namespace-scopeconstexpr double kPi.Why
MSVC does not define the non-standard POSIX
M_PImacro unless_USE_MATH_DEFINESis set before<cmath>. The dgb release Windows lane (release.yml, self-hosted VM217/MSVC) fails atBuild c2pool-dgbwith:Linux/macOS and build.yml pass because build.yml does not compile dgb's main executable target. Confirmed on release-dispatch run 29307660687 (Linux+macOS green, Windows package red at this exact error).
A
constexpravoids header-order-dependent_USE_MATH_DEFINESfragility. No numeric change on any platform.Verification
Release-dispatch off this branch to confirm Windows dgb Build/Package non-hollow green (attached next).
Depends on nothing; independent of #696 (release.yml pwsh/em-dash shell heal). Signed 285EFE76. No self-merge.