Make more use of REG_NREGS
[official-gcc.git] / libgo / go / net / main_windows_test.go
blob6ea318c2a5f3a747da8dba620df3b96805909bf1
1 // Copyright 2015 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
5 package net
7 var (
8 // Placeholders for saving original socket system calls.
9 origSocket = socketFunc
10 origClosesocket = closeFunc
11 origConnect = connectFunc
12 origConnectEx = connectExFunc
13 origListen = listenFunc
14 origAccept = acceptFunc
17 func installTestHooks() {
18 socketFunc = sw.Socket
19 closeFunc = sw.Closesocket
20 connectFunc = sw.Connect
21 connectExFunc = sw.ConnectEx
22 listenFunc = sw.Listen
23 acceptFunc = sw.AcceptEx
26 func uninstallTestHooks() {
27 socketFunc = origSocket
28 closeFunc = origClosesocket
29 connectFunc = origConnect
30 connectExFunc = origConnectEx
31 listenFunc = origListen
32 acceptFunc = origAccept
35 // forceCloseSockets must be called only from TestMain.
36 func forceCloseSockets() {
37 for s := range sw.Sockets() {
38 closeFunc(s)