Commit Graph
6 Commits
Author SHA1 Message Date
Brad Arant 4082e82466 Fix Exception default file/line always reporting Exception.h itself
__FILE__/__LINE__ are preprocessor macros - as default argument values
in the header they expand once, at the header declaration site, not at
each call site. Every throw relying on the defaults (all but File.cpp,
which passed them explicitly) reported Exception.h itself instead of
the real error location.

Switched the defaults to std::source_location::current(), which the
C++20 standard specifically defines to evaluate at the call site when
used as a default argument - unlike macros. Kept the same 4-parameter
signature so every existing call site, including ones that pass
__FILE__/__LINE__ explicitly, is unaffected.

Verified two ways: full-repo compile pass (identical result to before,
13/20 clean, same pre-existing StreamReader.h-blocked failures, nothing
new broken); a real runtime test - a throw relying on defaults from a
known line correctly reported that exact file/line via the caught
exceptions .file/.line members. Test file not included in this commit.
2026-08-22 19:52:44 -07:00
Brad Arant 8a9c1c3bd7 Worked on ZString, MString and JString 2023-10-05 17:57:01 -07:00
Brad Arant b873bbf164 Updated exception 2023-03-10 12:55:08 -08:00
Brad Arant a37c4e6829 Updated and working. 2022-01-24 14:03:58 -08:00
barant 4286a7b449 Added mutex lock to log output. 2019-10-20 09:32:11 -07:00
barant 08169b1c3d Many additions and changes. 2019-09-13 10:29:36 -07:00