There was an error fetching the commit references. Please try again later.
network, sockets: Replace `POLL_IN`, `POLL_OUT`, etc. constants with an `enum class PollEvents`
Actually, two enum classes, since for some reason there are two separate yet identical `PollFD` types used in the codebase. I get that one is ABI-compatible with the Switch while the other is an abstract type used for the host, but why not use `WSAPOLLFD` directly for the latter? Anyway, why make this change? Because on Apple platforms, `POLL_IN`, `POLL_OUT`, etc. (with an underscore) are defined as macros in <sys/signal.h>. (This is inherited from FreeBSD.) So defining a variable with the same name causes a compile error. I could just rename the variables, but while I was at it I thought I might as well switch to an enum for stronger typing. Also, change the type used for values copied directly to/from the `events` and `revents` fields of the host *native* `pollfd`/`WSASPOLLFD`, from `u32` to `short`, as `short` is the correct canonical type on both Unix and Windows.
Showing
- src/core/hle/service/sockets/bsd.cpp 4 additions, 4 deletionssrc/core/hle/service/sockets/bsd.cpp
- src/core/hle/service/sockets/sockets.h 14 additions, 9 deletionssrc/core/hle/service/sockets/sockets.h
- src/core/hle/service/sockets/sockets_translate.cpp 25 additions, 25 deletionssrc/core/hle/service/sockets/sockets_translate.cpp
- src/core/hle/service/sockets/sockets_translate.h 2 additions, 2 deletionssrc/core/hle/service/sockets/sockets_translate.h
- src/core/network/network.cpp 22 additions, 22 deletionssrc/core/network/network.cpp
- src/core/network/network.h 15 additions, 9 deletionssrc/core/network/network.h
Loading
Please register or sign in to comment