summaryrefslogtreecommitdiff
path: root/libs/pbd/pbd.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2014-12-04 10:07:11 -0500
committerPaul Davis <paul@linuxaudiosystems.com>2014-12-04 10:07:11 -0500
commit697c397f379481efd5f50cd772a9dcd659ecede7 (patch)
tree11a14110595e95e0721e576ad1c0b69a35b908dc /libs/pbd/pbd.cc
parent4e8dfda88093f3648bdbc0e6c292ec41fadc6d55 (diff)
move WSAStartup() and WSACleanup() out of per-object methods into per-library init/cleanup methods
Diffstat (limited to 'libs/pbd/pbd.cc')
-rw-r--r--libs/pbd/pbd.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/libs/pbd/pbd.cc b/libs/pbd/pbd.cc
index 145e1b91a8..858d870c1a 100644
--- a/libs/pbd/pbd.cc
+++ b/libs/pbd/pbd.cc
@@ -34,6 +34,10 @@
#include "pbd/id.h"
#include "pbd/enumwriter.h"
+#ifdef PLATFORM_WINDOWS
+#include <winsock2.h>
+#endif
+
#include "i18n.h"
extern void setup_libpbd_enums ();
@@ -68,6 +72,17 @@ PBD::init ()
// Essential!! Make sure that any files used by Ardour
// will be created or opened in BINARY mode!
_fmode = O_BINARY;
+
+ WSADATA wsaData;
+
+ /* Initialize windows socket DLL for PBD::CrossThreadChannel
+ */
+
+ if (WSAStartup(MAKEWORD(1,1),&wsaData) != 0) {
+ fatal << "Windows socket initialization failed with error: " << WSAGetLastError() << endmsg;
+ /*NOTREACHED*/
+ return;
+ }
#endif
if (!Glib::thread_supported()) {
@@ -89,5 +104,9 @@ PBD::init ()
void
PBD::cleanup ()
{
+#ifdef PLATFORM_WINDOWS
+ WSACleanup();
+#endif
+
EnumWriter::destroy ();
}