diff options
Diffstat (limited to 'src/lib/libcrypto/cast/castopts.c')
-rw-r--r-- | src/lib/libcrypto/cast/castopts.c | 61 |
1 files changed, 21 insertions, 40 deletions
diff --git a/src/lib/libcrypto/cast/castopts.c b/src/lib/libcrypto/cast/castopts.c index 68cf5a4a60..642e9725af 100644 --- a/src/lib/libcrypto/cast/castopts.c +++ b/src/lib/libcrypto/cast/castopts.c | |||
@@ -59,19 +59,17 @@ | |||
59 | /* define PART1, PART2, PART3 or PART4 to build only with a few of the options. | 59 | /* define PART1, PART2, PART3 or PART4 to build only with a few of the options. |
60 | * This is for machines with 64k code segment size restrictions. */ | 60 | * This is for machines with 64k code segment size restrictions. */ |
61 | 61 | ||
62 | #ifndef MSDOS | 62 | #if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) |
63 | #define TIMES | 63 | #define TIMES |
64 | #endif | 64 | #endif |
65 | 65 | ||
66 | #include <stdio.h> | 66 | #include <stdio.h> |
67 | #ifndef MSDOS | 67 | |
68 | #include <unistd.h> | 68 | #include <openssl/e_os2.h> |
69 | #else | 69 | #include OPENSSL_UNISTD_IO |
70 | #include <io.h> | 70 | OPENSSL_DECLARE_EXIT |
71 | extern void exit(); | 71 | |
72 | #endif | ||
73 | #include <signal.h> | 72 | #include <signal.h> |
74 | #ifndef VMS | ||
75 | #ifndef _IRIX | 73 | #ifndef _IRIX |
76 | #include <time.h> | 74 | #include <time.h> |
77 | #endif | 75 | #endif |
@@ -79,25 +77,26 @@ extern void exit(); | |||
79 | #include <sys/types.h> | 77 | #include <sys/types.h> |
80 | #include <sys/times.h> | 78 | #include <sys/times.h> |
81 | #endif | 79 | #endif |
82 | #else /* VMS */ | 80 | |
83 | #include <types.h> | 81 | /* Depending on the VMS version, the tms structure is perhaps defined. |
84 | struct tms { | 82 | The __TMS macro will show if it was. If it wasn't defined, we should |
85 | time_t tms_utime; | 83 | undefine TIMES, since that tells the rest of the program how things |
86 | time_t tms_stime; | 84 | should be handled. -- Richard Levitte */ |
87 | time_t tms_uchild; /* I dunno... */ | 85 | #if defined(VMS) && defined(__DECC) && !defined(__TMS) |
88 | time_t tms_uchildsys; /* so these names are a guess :-) */ | 86 | #undef TIMES |
89 | } | ||
90 | #endif | 87 | #endif |
88 | |||
91 | #ifndef TIMES | 89 | #ifndef TIMES |
92 | #include <sys/timeb.h> | 90 | #include <sys/timeb.h> |
93 | #endif | 91 | #endif |
94 | 92 | ||
95 | #ifdef sun | 93 | #if defined(sun) || defined(__ultrix) |
94 | #define _POSIX_SOURCE | ||
96 | #include <limits.h> | 95 | #include <limits.h> |
97 | #include <sys/param.h> | 96 | #include <sys/param.h> |
98 | #endif | 97 | #endif |
99 | 98 | ||
100 | #include "cast.h" | 99 | #include <openssl/cast.h> |
101 | 100 | ||
102 | #define CAST_DEFAULT_OPTIONS | 101 | #define CAST_DEFAULT_OPTIONS |
103 | 102 | ||
@@ -136,11 +135,7 @@ struct tms { | |||
136 | #ifndef HZ | 135 | #ifndef HZ |
137 | # ifndef CLK_TCK | 136 | # ifndef CLK_TCK |
138 | # ifndef _BSD_CLK_TCK_ /* FreeBSD fix */ | 137 | # ifndef _BSD_CLK_TCK_ /* FreeBSD fix */ |
139 | # ifndef VMS | 138 | # define HZ 100.0 |
140 | # define HZ 100.0 | ||
141 | # else /* VMS */ | ||
142 | # define HZ 100.0 | ||
143 | # endif | ||
144 | # else /* _BSD_CLK_TCK_ */ | 139 | # else /* _BSD_CLK_TCK_ */ |
145 | # define HZ ((double)_BSD_CLK_TCK_) | 140 | # define HZ ((double)_BSD_CLK_TCK_) |
146 | # endif | 141 | # endif |
@@ -152,12 +147,7 @@ struct tms { | |||
152 | #define BUFSIZE ((long)1024) | 147 | #define BUFSIZE ((long)1024) |
153 | long run=0; | 148 | long run=0; |
154 | 149 | ||
155 | #ifndef NOPROTO | ||
156 | double Time_F(int s); | 150 | double Time_F(int s); |
157 | #else | ||
158 | double Time_F(); | ||
159 | #endif | ||
160 | |||
161 | #ifdef SIGALRM | 151 | #ifdef SIGALRM |
162 | #if defined(__STDC__) || defined(sgi) | 152 | #if defined(__STDC__) || defined(sgi) |
163 | #define SIGRETTYPE void | 153 | #define SIGRETTYPE void |
@@ -165,14 +155,8 @@ double Time_F(); | |||
165 | #define SIGRETTYPE int | 155 | #define SIGRETTYPE int |
166 | #endif | 156 | #endif |
167 | 157 | ||
168 | #ifndef NOPROTO | ||
169 | SIGRETTYPE sig_done(int sig); | 158 | SIGRETTYPE sig_done(int sig); |
170 | #else | 159 | SIGRETTYPE sig_done(int sig) |
171 | SIGRETTYPE sig_done(); | ||
172 | #endif | ||
173 | |||
174 | SIGRETTYPE sig_done(sig) | ||
175 | int sig; | ||
176 | { | 160 | { |
177 | signal(SIGALRM,sig_done); | 161 | signal(SIGALRM,sig_done); |
178 | run=0; | 162 | run=0; |
@@ -185,8 +169,7 @@ int sig; | |||
185 | #define START 0 | 169 | #define START 0 |
186 | #define STOP 1 | 170 | #define STOP 1 |
187 | 171 | ||
188 | double Time_F(s) | 172 | double Time_F(int s) |
189 | int s; | ||
190 | { | 173 | { |
191 | double ret; | 174 | double ret; |
192 | #ifdef TIMES | 175 | #ifdef TIMES |
@@ -247,9 +230,7 @@ int s; | |||
247 | fprintf(stderr,"%s bytes per sec = %12.2f (%5.1fuS)\n",name, \ | 230 | fprintf(stderr,"%s bytes per sec = %12.2f (%5.1fuS)\n",name, \ |
248 | tm[index]*8,1.0e6/tm[index]); | 231 | tm[index]*8,1.0e6/tm[index]); |
249 | 232 | ||
250 | int main(argc,argv) | 233 | int main(int argc, char **argv) |
251 | int argc; | ||
252 | char **argv; | ||
253 | { | 234 | { |
254 | long count; | 235 | long count; |
255 | static unsigned char buf[BUFSIZE]; | 236 | static unsigned char buf[BUFSIZE]; |