Skip to content

Bus::get_pollfd generate doc for both unix & windows

François Laignel requested to merge fengalin:1.14 into 1.14

There are different implementations and signatures for get_pollfd depending on whether the target platform is unix or windows. When generating the doc, we need both implementations to appear regardless of the target platform. This commit is inspired by the way Rust std library deals with process::Command OS dependent variants.

Documentation can't be accurate though as we can't use thestd::os::windows on unix and vice versa. As a workaround a fake fd class matching the other platform is declared.

This could be further enhanced once #[doc(cfg(...))] is stabilized by declaring #[doc(cfg(unix))] or #[doc(cfg(windows))] instead of the hard coded comments This is supported on **Windows/Unix** only. Unfortunately, these comments disappear when generating with --all-features because they are not part of the documentation in the gir file. Is there a way to prevent them from being removed?

Merge request reports