};
static const int *lengths = lengths_list;
+#define START 0
+#define STOP 1
+
#ifdef SIGALRM
-# if defined(__STDC__) || defined(sgi) || defined(_AIX)
-# define SIGRETTYPE void
-# else
-# define SIGRETTYPE int
-# endif
-static SIGRETTYPE sig_done(int sig);
-static SIGRETTYPE sig_done(int sig)
+static void alarmed(int sig)
{
- signal(SIGALRM, sig_done);
+ signal(SIGALRM, alarmed);
run = 0;
}
-#endif
-#define START 0
-#define STOP 1
+static double Time_F(int s)
+{
+ double ret = app_tminterval(s, usertime);
+ if (s == STOP)
+ alarm(0);
+ return ret;
+}
-#if defined(_WIN32)
+#elif defined(_WIN32)
+
+# define SIGALRM -1
-# if !defined(SIGALRM)
-# define SIGALRM
-# endif
static unsigned int lapse;
static volatile unsigned int schlock;
static void alarm_win32(unsigned int secs)
return ret;
}
#else
-
static double Time_F(int s)
{
- double ret = app_tminterval(s, usertime);
- if (s == STOP)
- alarm(0);
- return ret;
+ return app_tminterval(s, usertime);
}
#endif
/* not worth fixing */
# error "You cannot disable DES on systems without SIGALRM."
# endif /* OPENSSL_NO_DES */
-#else
-# ifndef _WIN32
- signal(SIGALRM, sig_done);
-# endif
+#elif SIGALRM > 0
+ signal(SIGALRM, alarmed);
#endif /* SIGALRM */
#ifndef OPENSSL_NO_MD2