diff options
author | Andy Polyakov <appro@openssl.org> | 2011-12-15 22:30:03 +0000 |
---|---|---|
committer | Andy Polyakov <appro@openssl.org> | 2011-12-15 22:30:03 +0000 |
commit | bdba45957a246ca3c74e93fb14e85184e2455248 (patch) | |
tree | 6ce1f12d172450b366ec1d4a4f4163cf64be81bb | |
parent | 0e1467a64c2368d267b0eebb4190f95a7196c9c9 (diff) | |
download | openssl-bdba45957a246ca3c74e93fb14e85184e2455248.tar.gz |
apps/speed.c: Cygwin alarm() fails sometimes.
PR: 2655
-rw-r--r-- | apps/speed.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/speed.c b/apps/speed.c index d4b0fddf7b..2c489eb029 100644 --- a/apps/speed.c +++ b/apps/speed.c @@ -108,8 +108,14 @@ #include <signal.h> #endif -#ifdef _WIN32 +#if defined(_WIN32) || defined(__CYGWIN__) #include <windows.h> +# if defined(__CYGwIN__) && !defined(_WIN32) + /* <windows.h> should define _WIN32, which normally is mutually + * exclusive with __CYGWIN__, but if it didn't... */ +# define _WIN32 + /* this is done because Cygwin alarm() fails sometimes. */ +# endif #endif #include <openssl/bn.h> @@ -274,9 +280,12 @@ static SIGRETTYPE sig_done(int sig) #if defined(_WIN32) -#define SIGALRM +#if !defined(SIGALRM) +# define SIGALRM +#endif static unsigned int lapse,schlock; -static void alarm(unsigned int secs) { lapse = secs*1000; } +static void alarm_win32(unsigned int secs) { lapse = secs*1000; } +#define alarm alarm_win32 static DWORD WINAPI sleepy(VOID *arg) { |