Skip to content
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

Move implementation out of interface headers #62

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

SchaichAlonso
Copy link
Contributor

@SchaichAlonso SchaichAlonso commented Nov 13, 2024

tkrzw has quite a bit of code that is implemented in header files that are supposed to be included by consuming projects.

This causes some technical issues with weak symbols inside the consumer's translation units (or .obj files), that might fail to be deduplicated if the consuming project uses compiler settings different from those used by the tkrzw build system.

More importantly, however, parts of the code, especially imlementations of non-virtual functions, might end up being embedded into consumer applications when an optimization phase eliminates the procedure calls, raising many concerns considering licensing.

This commit moves all implementations from header files documented for inclusion into third-party projects on https://dbmx.net/tkrzw/, as well as any header that implicitly gets included by including a tkrzw interface header into source files.
Further, inline declarations are removed as within tkrzw, the inlining happens on the discredition of the linker independed of the inline keyword, while cross-module inlining is what this commit is supposed to interdict.

Nothing can be done about the template code in tkrzw_lib_common.h, however, template code is whitelisted on GPLv3.

Closes: #61

tkrzw has quite a bit of code that is implemented in header files
that are supposed to be included by consuming projects.

This causes some technical issues with [weak symbols](https://en.wikipedia.org/wiki/Weak_symbol) inside
the consumer's translation units (or `.obj` files), that might fail
to be deduplicated if the consuming project uses compiler settings
different from those used by the tkrzw build system.

More importantly, however, parts of the code, especially imlementations
of non-virtual functions, might end up being embedded into consumer
applications when an optimization phase eliminates the procedure
calls, raising many concerns considering licensing.

This commit moves all implementations from header files documented
for inclusion into third-party projects on https://dbmx.net/tkrzw/,
as well as any header that implicitly gets included by including a
tkrzw interface header into source files.
Further, `inline` declarations are removed as within tkrzw, the
inlining happens on the discredition of the linker independed of
the `inline` keyword, while cross-module inlining is what this
commit is supposed to interdict.

Nothing can be done about template code in tkrzw_lib_common.h ,
however, template code is whitelisted on GPLv3.
@SchaichAlonso SchaichAlonso marked this pull request as ready for review November 13, 2024 16:39
SchaichAlonso added a commit to SchaichAlonso/tkrzw that referenced this pull request Nov 14, 2024
SchaichAlonso added a commit to SchaichAlonso/tkrzw that referenced this pull request Nov 14, 2024
SchaichAlonso added a commit to SchaichAlonso/tkrzw that referenced this pull request Nov 15, 2024
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.

Function implementations in the tkrzw module interface
1 participant