Skip to content

Conversation

@mikomikotaishi
Copy link
Contributor

@mikomikotaishi mikomikotaishi commented Oct 24, 2025

I made a similar pull request here on RtMidi, and am just applying the same edits here.

This pull request adds support for C++20 modules, as well as puts all symbols in the inlined namespace rt::audio (it is broken into nested namespace to emphasise the relation with RtMidi, which also shares namespace rt). This change does not break any existing code, but allows symbols to be optionally accessed through the namespace rt::audio in addition to the global namespace. The module itself is imported using import rt.audio; and is enabled with the build macro RTAUDIO_BUILD_MODULES. Enabling RTAUDIO_USE_NAMESPACE will make namespaces mandatory in the module.

Introducing modules to the project will not break any code, but is a benefit to users of C++20 and later who may wish to consume the library using modules rather than headers.

@mikomikotaishi
Copy link
Contributor Author

Ah, so it seems including the inline namespaces in RtAudio.cpp was not only unnecessary but even directly preventing it from compiling.

@garyscavone garyscavone merged commit 62f8024 into thestk:master Nov 1, 2025
12 checks passed
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