diff options
author | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-09-02 01:25:33 -0400 |
---|---|---|
committer | ouwou <26526779+ouwou@users.noreply.github.com> | 2022-09-02 01:25:33 -0400 |
commit | 0a049856782397a7464d03c317ce3788559cdeda (patch) | |
tree | 9412d17c0ab9335d591d7b4590043b9cc4e3cc45 /src/discord/voiceclient.cpp | |
parent | 9c8d9e54fe96f97bdda2be26bab571e4cbf0c597 (diff) | |
download | abaddon-portaudio-0a049856782397a7464d03c317ce3788559cdeda.tar.gz abaddon-portaudio-0a049856782397a7464d03c317ce3788559cdeda.zip |
make compile work if voice support is disabled
Diffstat (limited to 'src/discord/voiceclient.cpp')
-rw-r--r-- | src/discord/voiceclient.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/discord/voiceclient.cpp b/src/discord/voiceclient.cpp index 7aaa4a5..d8855fd 100644 --- a/src/discord/voiceclient.cpp +++ b/src/discord/voiceclient.cpp @@ -1,3 +1,5 @@ +#ifdef WITH_VOICE + // clang-format off #include "voiceclient.hpp" #include "json.hpp" #include <sodium.h> @@ -10,6 +12,7 @@ #else #define S_ADDR(var) (var).sin_addr.s_addr #endif +// clang-format on UDPSocket::UDPSocket() { m_socket = socket(AF_INET, SOCK_DGRAM, 0); @@ -88,11 +91,11 @@ std::vector<uint8_t> UDPSocket::Receive() { void UDPSocket::Stop() { m_running = false; -#ifdef _WIN32 + #ifdef _WIN32 shutdown(m_socket, SD_BOTH); -#else + #else shutdown(m_socket, SHUT_RDWR); -#endif + #endif if (m_thread.joinable()) m_thread.join(); } @@ -385,3 +388,4 @@ void from_json(const nlohmann::json &j, VoiceSessionDescriptionData &m) { JS_D("mode", m.Mode); JS_D("secret_key", m.SecretKey); } +#endif |