Skip to content

[BUILD] Update vendored TraceLoggingDynamic.h to compile with msvc's conformant preprocessor#3822

Merged
marcalff merged 3 commits intoopen-telemetry:mainfrom
cgettys-microsoft:main
Jan 21, 2026
Merged

[BUILD] Update vendored TraceLoggingDynamic.h to compile with msvc's conformant preprocessor#3822
marcalff merged 3 commits intoopen-telemetry:mainfrom
cgettys-microsoft:main

Conversation

@cgettys-microsoft
Copy link
Contributor

Fixes #3809

Changes

Update vendored copy of TraceLoggingDynamic.h to 62163825ca08a33188a8e006cd0d56d498a90e73. Or in other words, picks up my PR Fix: TraceLoggingDynamic.h failing under /Zc:preprocessor on msvc into the upstream tracelogging repo.

The motivating reason to pick up this version is this backwards-compatible fix:

#define _tld_ASSERT(exp, str) ((void)(!(exp) ? (__annotation(L"Debug", L"AssertFail", L"TraceLogging: " #exp L" : " str), DbgRaiseAssertionFailure(), 0) : 0))

Which relied on non-conformant preprocessor behavior. This fix avoids warnings and errors from the newer, conformant msvc preprocessor, while still compiling with the traditional, non-conformant msvc preprocessor as well (which as of 2025, remains the default even in the latest msvc version).

I preserved the block comment at the top since I'm assuming you've got SPDX parsing automation that cares about the format of that top header.

There appeared to be a number of other non-functional changes missing from this vendored copy. - updated comments, renamed arguments, and some reordered enum entries (but the actual enum values were explicitly assigned, so there's no functional change), and so on.

I brought those in as well to bring it fully up to date.

  • CHANGELOG.md updated for non-trivial changes - happy to add a line if this change is considered non-trivial.
  • Unit tests have been added - no unit tests added, no functional change. Could add a build configuration to CI to cover /Zc:preprocessor in addition to existing coverage if desired.
  • Changes in public API reviewed - no changes to public API.

@cgettys-microsoft cgettys-microsoft requested a review from a team as a code owner January 20, 2026 20:40
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 20, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: marcalff / name: Marc Alff (88693c5)

@marcalff marcalff added the pr:waiting-on-cla Waiting on CLA label Jan 20, 2026
@cgettys-microsoft
Copy link
Contributor Author

/easycla

@codecov
Copy link

codecov bot commented Jan 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 89.96%. Comparing base (0be9320) to head (88693c5).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3822      +/-   ##
==========================================
+ Coverage   89.95%   89.96%   +0.02%     
==========================================
  Files         225      225              
  Lines        7170     7170              
==========================================
+ Hits         6449     6450       +1     
+ Misses        721      720       -1     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cgettys-microsoft cgettys-microsoft changed the title Pick up contents as of 62163825ca08a33188a8e006cd0d56d498a90e73 Update vendored TraceLoggingDynamic.h to compile with msvc's conformant preprocessor Jan 20, 2026
@lalitb lalitb removed the pr:waiting-on-cla Waiting on CLA label Jan 20, 2026
@marcalff
Copy link
Member

CI should be clean after #3823 is merged.

@marcalff
Copy link
Member

/easycla

@marcalff marcalff merged commit ff5f07a into open-telemetry:main Jan 21, 2026
67 checks passed
@marcalff marcalff changed the title Update vendored TraceLoggingDynamic.h to compile with msvc's conformant preprocessor [BUILD] Update vendored TraceLoggingDynamic.h to compile with msvc's conformant preprocessor Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compilation failure when including vendored TraceLoggingDynamic.h on msvc with /Zc:preprocessor

4 participants