Hi,
I personally separate OS-specific implementations in modules with
the same name, in different directories. From the filesystem
perspective:
widget.d
linux/widgetimpl.d
windows/widgetimpl.d
From the code perspective, the *impl modules would present
homonymic types with the same public interface.
module widget;
class Widget
{
version(Windows)
{
import windows.widgetimpl;
}
version(linux)
{
import linux.widgetimpl;
}
void systemSpecificTask()
{
auto s = SystemSpecificStruct(); // defined in every
widgetimpl.d
s.execute();
}
}