Skip to content

Fix violation of the one definition rule in ext/com_dotnet #15327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 10, 2024

Conversation

cmb69
Copy link
Member

@cmb69 cmb69 commented Aug 10, 2024

The definition of the class entries in the internal header file is not correct, since that file is included several times, and even the comment above the definition hints at com_extension.c where the actual definition is. We fix this by declaring these variables as extern.


Note that I found this when compiling with clang, which fails with LNK2005; I have no idea why MSVC compiles do not trigger this error.

The definition of the class entries in the internal header file is not
correct, since that file is included several times, and even the
comment above the definition hints at com_extension.c where the actual
definition is.  We fix this by declaring these variables as `extern`.
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch

@cmb69 cmb69 merged commit ee02e4b into php:master Aug 10, 2024
10 checks passed
@cmb69 cmb69 deleted the cmb/com-dotnet-extern branch August 10, 2024 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants