A 'lazy' compilation mode to make writting multiplatform code easier without having to clutter the project

ryuukk_ ryuukk.dev at gmail.com
Wed Feb 22 14:51:41 UTC 2023


On Wednesday, 22 February 2023 at 14:39:49 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> Alternative approach:
>
> ```d
> module rt.event;
>
> version(Windows)
> 	public import ... : poll;
> else version(...)
> 	public import ... : poll;
> else
> 	static assert(0, "I don't know how to handle event loop here");
> ```
>
> ```d
> module ...;
> version(Windows):
>
> void poll() {
>
> }
> ```

static assert is the problem here, it won't compile on wasm target


More information about the Digitalmars-d mailing list