summaryrefslogtreecommitdiff
path: root/misc/cgo/test/sleep_windows_386.go
diff options
context:
space:
mode:
Diffstat (limited to 'misc/cgo/test/sleep_windows_386.go')
-rw-r--r--misc/cgo/test/sleep_windows_386.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/misc/cgo/test/sleep_windows_386.go b/misc/cgo/test/sleep_windows_386.go
new file mode 100644
index 000000000..75687d783
--- /dev/null
+++ b/misc/cgo/test/sleep_windows_386.go
@@ -0,0 +1,20 @@
+// 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"