# std.net.listen: fix Windows API use · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/12a9e0f4150f0d30c851727f4dc2354fa6c90682)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 12a9e0f4150f0d30c851727f4dc2354fa6c90682

Requested commit: 12a9e0f4150f0d30c851727f4dc2354fa6c90682

Commit: 12a9e0f4150f0d30c851727f4dc2354fa6c90682

Tree: c22f047d48dd4a9a71a2dbe96504d444bbd97eeb

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std.net.listen: fix Windows API use

In a previous commit I removed a load-bearing use of `@hasDecl` to
detect whether the SO.REUSEPORT option should be set. `@hasDecl` should
not be used for OS feature detection because it can hide bugs.

The new logic checks for the operating system specifically and then does
the thing that is supposed to be done on that operating system directly.

```

## Parents

- [6395ba852a88f0e0b2a2f0659f1daf9d08e90157](https://git.cafe/gitcafe/zig/commit/6395ba852a88f0e0b2a2f0659f1daf9d08e90157?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/12a9e0f4150f0d30c851727f4dc2354fa6c90682?format=markdown)
