mirror of https://github.com/golang/go.git
misc/cgo/test: rewrite windows version of mysleep
Latest version of gcc (tdm-1) 5.1.0 refuses to compile our code on windows/386 (see issue for details). Rewrite the code. Fixes #14328 Change-Id: I70f4f063282bd2958cd2175f3974369dd49dd8dc Reviewed-on: https://go-review.googlesource.com/20008 Reviewed-by: Ian Lance Taylor <iant@golang.org> Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
4b92cd4ec1
commit
03f3bfc460
|
|
@ -36,7 +36,7 @@ IntoC(void)
|
|||
long long
|
||||
mysleep(int seconds) {
|
||||
long long st = GetTickCount();
|
||||
sleep(seconds);
|
||||
Sleep(1000 * seconds);
|
||||
return st;
|
||||
}
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -1,20 +0,0 @@
|
|||
// Copyright 2011 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package cgotest
|
||||
|
||||
/*
|
||||
// mingw32 on windows/386 provides usleep() but not sleep(),
|
||||
// as we don't want to require all other OSes to provide usleep,
|
||||
// we emulate sleep(int s) using win32 API Sleep(int ms).
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
unsigned int sleep(unsigned int seconds) {
|
||||
Sleep(1000 * seconds);
|
||||
return 0;
|
||||
}
|
||||
|
||||
*/
|
||||
import "C"
|
||||
Loading…
Reference in New Issue