I think ifdef can be used to check if SO_REUSEPORT is defined, on macos:
``` /usr/include/sys/socket.h:136:#define SO_REUSEPORT 0x0200 /* allow local address & port reuse */ ```
On Linux:
``` /usr/include/asm-generic/socket.h:25:#define SO_REUSEPORT 15 ```
So it appears it is a define when available.
The two use cases you listed are also important, I haven't thought of them, so I think that if we can get it enabled at compile time based on availability (can be a follow up commit), the PR can be merged.