Skip to content

(test) fix: rename SIZEOF_LONG to SENTRY_SIZEOF_LONG#1812

Draft
JoshuaMoelans wants to merge 1 commit into
masterfrom
joshua/fix/prefix_symbol
Draft

(test) fix: rename SIZEOF_LONG to SENTRY_SIZEOF_LONG#1812
JoshuaMoelans wants to merge 1 commit into
masterfrom
joshua/fix/prefix_symbol

Conversation

@JoshuaMoelans

Copy link
Copy Markdown
Member

Fixes #1810

#skip-changelog

…jects

Rename SIZEOF_LONG to SENTRY_SIZEOF_LONG to prevent conflicts when
sentry-native is included as a subdirectory and the parent project
leaks its own SIZEOF_LONG define via add_definitions().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@JoshuaMoelans JoshuaMoelans force-pushed the joshua/fix/prefix_symbol branch from f1baba3 to 3b55a7c Compare June 22, 2026 11:16
@jpnurmi

jpnurmi commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

The problem is that ansel sets CMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY globally, which breaks CheckTypeSize so renaming the output variable doesn't help:

In file included from C:/msys64/home/jpnurmi/ansel/src/external/sentry-native/src/sentry_core.c:22:
C:/msys64/home/jpnurmi/ansel/src/external/sentry-native/src/sentry_sync.h:376:28: error: invalid token at start of a preprocessor expression
  376 | #    if SENTRY_SIZEOF_LONG == 8
      |                            ^
C:/msys64/home/jpnurmi/ansel/src/external/sentry-native/src/sentry_sync.h:390:28: error: invalid token at start of a preprocessor expression
  390 | #    if SENTRY_SIZEOF_LONG == 8
      |                            ^
C:/msys64/home/jpnurmi/ansel/src/external/sentry-native/src/sentry_sync.h:421:28: error: invalid token at start of a preprocessor expression
  421 | #    if SENTRY_SIZEOF_LONG == 8
      |                            ^
3 errors generated.

I think we should not have a workaround in sentry-native because it would break any other project relying on CheckTypeSize. I sent a proposal to fix on their side instead:

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.

Build of sentry-native fails on Windows UCRT64 + LLVM 22

2 participants