Skip to content

Enforce inclusion ordering between cppwinrt & wil/cppwinrt #623

@jonwis

Description

@jonwis

We have code that uses these two together, but sometimes puts the inclusions in the wrong order. For the integration to work, #include <wil/cppwinrt.h> must come before any inclusions of WinRT headers.

  • wil/cppwinrt.h should detect being included after any WinRT headers, and issue an appropriate error.
  • wil/result_macros.h may need to help out, enabled by some compile-time validation?

The result is leaked exceptions - when the inclusion is in the wrong order, the cppwinrt ABI try/catch(...) failfasts on anything that's not std:: or winrt::.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions