Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@robUx4
Copy link
Contributor

@robUx4 robUx4 commented Mar 18, 2025

The method may be inlined in parent classes, in external code. That results in needing to DLL export the private method so it can be called by the external code, even if it's not supposed to know about it.

Moving the inline code into a the C++ file ensures the call is never inlined by the caller, thus not needing to export AllInstances::Instance().get().

The method may be inlined in parent classes, in external code.
That results in needing to export the private method so it can
be called by the external code, even if it's not supposed to
know about it.
@lelegard
Copy link
Member

I have implemented a slightly different solution. Instead of de-inlining the method, I added a TSCOREDLL attribute on the private inner class which is referenced in the method. This preserves the benefit of inlining while (hopefully) fixing the export issue.

Please check if it works for you with clang on Windows. If it does, please close this PR.

@robUx4
Copy link
Contributor Author

robUx4 commented Mar 19, 2025

Yes it seems to be working fine.

@robUx4 robUx4 closed this Mar 19, 2025
@robUx4 robUx4 deleted the inline-static branch March 19, 2025 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants