win32: Fix WSAStartup issues
authorPatrick Gaskin <patrick@pgaskin.net>
Sun, 3 Jan 2021 09:01:40 +0000 (04:01 -0500)
committerPulseAudio Marge Bot <pulseaudio-maintainers@lists.freedesktop.org>
Wed, 13 Jan 2021 03:16:06 +0000 (03:16 +0000)
commit0edcf725bcb77c5a3ae0c3473b775a85dbcd0236
tree2e36e1e1ddbabaa709a484876dda5d9e7e943dce
parentfa0d30eee1d86f3895e45a2aec6796cb17d008ef
win32: Fix WSAStartup issues

WSAStartup was not being called for pacat and pactl built with meson,
causing them to fail in pa_mainloop_new with "cannot create wakeup
pipe". This issue also affects other applications linking to libpulse
other than the pulseaudio daemon, which calls WSAStartup itself.

When built with autotools, WSAStartup would have been called in
DllMain, which is recommended against by the documentation [1].

To fix these issues, the WSAStartup/WSACleanup calls can be moved
into pa_mainloop_new/pa_mainloop_free.

[1] https://docs.microsoft.com/en-us/windows/win32/api/winsock/nf-winsock-wsastartup

Part-of: <https://gitlab.freedesktop.org/pulseaudio/pulseaudio/-/merge_requests/456>
src/Makefile.am
src/pulse/mainloop.c
src/pulsecore/dllmain.c [deleted file]