summaryrefslogtreecommitdiffstats
path: root/src/core/network/network.h
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2020-08-31 16:20:44 +0200
committercomex <comexk@gmail.com>2020-12-07 01:14:42 +0100
commit0791082b435371837bbecd50575911ce0ba16dc9 (patch)
tree363be86931fe14b0ddc33be3b4119ae21c9a1543 /src/core/network/network.h
parentMerge pull request #5155 from comex/xx-default (diff)
downloadyuzu-0791082b435371837bbecd50575911ce0ba16dc9.tar
yuzu-0791082b435371837bbecd50575911ce0ba16dc9.tar.gz
yuzu-0791082b435371837bbecd50575911ce0ba16dc9.tar.bz2
yuzu-0791082b435371837bbecd50575911ce0ba16dc9.tar.lz
yuzu-0791082b435371837bbecd50575911ce0ba16dc9.tar.xz
yuzu-0791082b435371837bbecd50575911ce0ba16dc9.tar.zst
yuzu-0791082b435371837bbecd50575911ce0ba16dc9.zip
Diffstat (limited to 'src/core/network/network.h')
-rw-r--r--src/core/network/network.h24
1 files changed, 15 insertions, 9 deletions
diff --git a/src/core/network/network.h b/src/core/network/network.h
index 0622e4593..76b2821f2 100644
--- a/src/core/network/network.h
+++ b/src/core/network/network.h
@@ -61,19 +61,25 @@ struct SockAddrIn {
};
/// Cross-platform poll fd structure
+
+enum class PollEvents : u16 {
+ // Using Pascal case because IN is a macro on Windows.
+ In = 1 << 0,
+ Pri = 1 << 1,
+ Out = 1 << 2,
+ Err = 1 << 3,
+ Hup = 1 << 4,
+ Nval = 1 << 5,
+};
+
+DECLARE_ENUM_FLAG_OPERATORS(PollEvents);
+
struct PollFD {
Socket* socket;
- u16 events;
- u16 revents;
+ PollEvents events;
+ PollEvents revents;
};
-constexpr u16 POLL_IN = 1 << 0;
-constexpr u16 POLL_PRI = 1 << 1;
-constexpr u16 POLL_OUT = 1 << 2;
-constexpr u16 POLL_ERR = 1 << 3;
-constexpr u16 POLL_HUP = 1 << 4;
-constexpr u16 POLL_NVAL = 1 << 5;
-
class NetworkInstance {
public:
explicit NetworkInstance();