+#if !defined(SIGALRM)
+void AlarmHandler(int sig);
+int WINAPI AlarmThread(void *seconds)
+{
+ sleep((unsigned int)seconds);
+ AlarmHandler(0);
+ return 0;
+}
+
+void alarm(unsigned int seconds)
+{
+ CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AlarmThread, (void*)seconds, 0, NULL);
+}
+#endif
+