2 * Copyright 2010 The Native Client Authors. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
15 #include "native_client/src/shared/platform/nacl_log.h"
16 #include "native_client/src/trusted/debug_stub/debug_stub.h"
17 #include "native_client/src/trusted/debug_stub/platform.h"
20 using port::IPlatform;
22 void NaClDebugStubPlatformInit() {
23 WORD wVersionRequested;
27 // Make sure to request the use of sockets.
28 // NOTE: It is safe to call Startup multiple times
29 wVersionRequested = MAKEWORD(2, 2);
30 err = WSAStartup(wVersionRequested, &wsaData);
32 // We could not find a matching DLL
33 NaClLog(LOG_ERROR, "WSAStartup failed with error: %d\n", err);
37 if (HIBYTE(wsaData.wVersion) != 2) {
38 // We couldn't get a matching version
39 NaClLog(LOG_ERROR, "Could not find a usable version of Winsock.dll\n");
45 void NaClDebugStubPlatformFini() {