aboutsummaryrefslogtreecommitdiffstats
path: root/extension/time.c
diff options
context:
space:
mode:
authorJuergen Kahrs <Juergen.Kahrs@googlemail.com>2013-02-12 09:41:29 +0100
committerJuergen Kahrs <Juergen.Kahrs@googlemail.com>2013-02-12 09:41:29 +0100
commitd8d656a2929d9fd54d9263634c803b92dab568c3 (patch)
tree4bca99b303c048554ae8fbb4247fb256464b4611 /extension/time.c
parent2f8d4e37f5dffe7f5b8d28a21d785b37d6e09e0f (diff)
parent038e70b403210a1ad298666b61369e03fb6d6ca6 (diff)
downloadegawk-d8d656a2929d9fd54d9263634c803b92dab568c3.tar.gz
egawk-d8d656a2929d9fd54d9263634c803b92dab568c3.tar.bz2
egawk-d8d656a2929d9fd54d9263634c803b92dab568c3.zip
Merge remote-tracking branch 'origin/master' into cmake
Diffstat (limited to 'extension/time.c')
-rw-r--r--extension/time.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/extension/time.c b/extension/time.c
index 89811c41..dcafb8fa 100644
--- a/extension/time.c
+++ b/extension/time.c
@@ -61,6 +61,9 @@ int plugin_is_GPL_compatible;
#if defined(HAVE_NANOSLEEP) && defined(HAVE_TIME_H)
#include <time.h>
#endif
+#if defined(HAVE_GETSYSTEMTIMEASFILETIME)
+#include <windows.h>
+#endif
/*
* Returns time since 1/1/1970 UTC as a floating point value; should
@@ -160,10 +163,17 @@ do_sleep(int nargs, awk_value_t *result)
/* probably interrupted */
update_ERRNO_int(errno);
}
+#elif defined(HAVE_GETSYSTEMTIMEASFILETIME)
+ {
+ DWORD milliseconds = secs * 1000;
+
+ Sleep (milliseconds);
+ rc = 0;
+ }
#else
/* no way to sleep on this platform */
rc = -1;
- update_ERRNO_str(_("sleep: not supported on this platform"));
+ update_ERRNO_string(_("sleep: not supported on this platform"));
#endif
return make_number(rc, result);