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

CXX-20 MODULES - global module fragment support #1202

Merged
merged 1 commit into from
May 2, 2024
Merged

CXX-20 MODULES - global module fragment support #1202

merged 1 commit into from
May 2, 2024

Conversation

alexv-ds
Copy link
Contributor

@alexv-ds alexv-ds commented May 1, 2024

This PR is based on one sleepless night and a similar PR for entt.

The problem is that we get compilation errors when using the methods (when include flecs.h in global module fragment):

world.import<ModuleName>();
world.system<ComponentName>();
// And perhaps others that call some template functions, the corrections of which are given in this PR

The reason to be that certain function declarations that are implicitly required by the implementation aren't exported into the module interface since they are marked 'static' and have internal linkage.

And when compiling we get the following error (clang-18 ubuntu 24.04 package version 1:18.1.3-1):

# This is an incomplete output for readability purposes.
/home/alexv/Desktop/flecs/include/flecs/private/../addons/cpp/mixins/term/../../utils/signature.hpp:44:25: error: no matching function for call to 'type_to_inout'
   44 |             , inout ({ (type_to_inout<Components>())... })
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~

This pull request solves this problem. I also advise to look at the original pull request for entt (link at the beginning of the description)

@SanderMertens
Copy link
Owner

LGTM!

@SanderMertens SanderMertens merged commit e752c8e into SanderMertens:master May 2, 2024
68 checks passed
@alexv-ds alexv-ds deleted the cxx-modules-improvements branch May 13, 2024 11:06
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.

2 participants