Commit 03f3bfc4 authored by Alex Brainman's avatar Alex Brainman

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/20008Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 4b92cd4e
......@@ -36,7 +36,7 @@ IntoC(void)
long long
mysleep(int seconds) {
long long st = GetTickCount();
sleep(seconds);
Sleep(1000 * seconds);
return st;
}
#else
......
// 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"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment