Rantanen / intercom

Object based cross-language FFI for Rust
MIT License
63 stars 7 forks source link

Support for `com_module!(..)` #145

Closed Rantanen closed 4 years ago

Rantanen commented 4 years ago

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!(..):

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