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

Support for com_module!(..) #145

Merged
merged 7 commits into from
Nov 7, 2019
Merged

Support for com_module!(..) #145

merged 7 commits into from
Nov 7, 2019

Conversation

Rantanen
Copy link
Owner

@Rantanen Rantanen commented Nov 6, 2019

In addition to a com_library!(..) this PR introduces com_module!(..). This is the little brother of the original library macro. The com_module!(..) does more or less everything com_library!(..) does except for introducing any global extern functions.

Both of these also support specifying other modules as exportable items. These modules are then recursively gathered for export in the final com_library!(..):

  • Each COM library must have exactly one com_library!(..) specification.
  • COM libraries and even other crates can have any number of com_module!(..) specifications.
    • Intercom itself now has a com_library!(..) where it defines all exported built-in types (Allocator and ErrorStore). This removes the need to hard-code these in the attributes for creation.
  • The syntax for specifying exported items now includes the item type:
mod some_module {
    com_module!(
        class ClassA,
        class ClassB,
        class ClassC,
    );
    // ...
}

com_library!(
    module some_module,
    class Another,
)

The actual module hierarchy is not maintained in the type info and will thus be ignored in IDL/C++ generation. Currently all classes must be globally unique within a COM library.

Closes #143

@Rantanen Rantanen merged commit 710f50a into master Nov 7, 2019
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.

Implement clsid!(..) attribute
1 participant