Separate macro definitions from proxy.h? (C++20 named modules support) #292
Replies: 3 comments 6 replies
|
I think the include hierarchy would be somehow along the line of this:
|
|
Hi @SidneyCogdill, thank you for the feedback! Enabling |
|
https://github.com/microsoft/proxy/actions/runs/14962709999/job/42027708969?pr=293 What do we do with the failing CIs? Apparently older versions of GCC (and Clang?) don't have modules support. Neither does nvc++ or AppleClang. But I want to keep the docs example. Latest releases of MSVC, Clang and GCC all passed the CI. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
C++ module support is available starting with Proxy 4
#293
Latest version of clangd (21 from development branch) seems to have good-enough C++20 modules support now (no more random crashes; parses very fast; type inference and go-to-definition works) and I'm starting to adapt it and it's showing observable compilation time speedup. Most libraries that use header files can be wrapped with their interfaces manually exported in a standard module:
(yes, stdlib included, although fiddling with std namespace is technically undefined behavior)
However, modules can't export preprocessor macros, therefore the
PRO_DEF_MEM_DISPATCHand friends aren't usable when proxy is contained in a separate module, unlessproxy.his included.I see that with the latest commit, proxy changes from single-header-only to header-only.
It would be nice if the macro definitions are defined in a separate file. The
proxy.hwould still include the macro definitions, and a separateproxy_macros.hwould be also accessible (which is included byproxy.h), similar to Vulkan-Hpp with the<vulkan/vulkan_hpp_macros.hpp>. This would be enough for me to manually adapt proxy with module support.All reactions