X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=crypto%2Frc5%2Frc5speed.c;h=8e363be535b4ff926756374a1ec937da157fa0ee;hb=d5f34443ad889815bde835105e5109b4e98ca237;hp=29148dc494ebd5b9d58171c57e3b97da66f0216a;hpb=31b8d8684441e6cd5138832bb1b2ddb10acd6ba6;p=openssl.git diff --git a/crypto/rc5/rc5speed.c b/crypto/rc5/rc5speed.c index 29148dc494..8e363be535 100644 --- a/crypto/rc5/rc5speed.c +++ b/crypto/rc5/rc5speed.c @@ -59,19 +59,20 @@ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ -#ifndef MSDOS +#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) && !defined(OPENSSL_SYS_MACOSX) #define TIMES #endif #include -#ifndef MSDOS -#include -#else -#include -extern int exit(); -#endif + +#include +#include OPENSSL_UNISTD_IO +OPENSSL_DECLARE_EXIT + +#ifndef OPENSSL_SYS_NETWARE #include -#ifndef VMS +#endif + #ifndef _IRIX #include #endif @@ -79,15 +80,15 @@ extern int exit(); #include #include #endif -#else /* VMS */ -#include -struct tms { - time_t tms_utime; - time_t tms_stime; - time_t tms_uchild; /* I dunno... */ - time_t tms_uchildsys; /* so these names are a guess :-) */ - } + +/* Depending on the VMS version, the tms structure is perhaps defined. + The __TMS macro will show if it was. If it wasn't defined, we should + undefine TIMES, since that tells the rest of the program how things + should be handled. -- Richard Levitte */ +#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS) +#undef TIMES #endif + #ifndef TIMES #include #endif @@ -98,16 +99,12 @@ struct tms { #include #endif -#include "rc5.h" +#include /* The following if from times(3) man page. It may need to be changed */ #ifndef HZ #ifndef CLK_TCK -#ifndef VMS #define HZ 100.0 -#else /* VMS */ -#define HZ 100.0 -#endif #else /* CLK_TCK */ #define HZ ((double)CLK_TCK) #endif @@ -116,12 +113,7 @@ struct tms { #define BUFSIZE ((long)1024) long run=0; -#ifndef NOPROTO double Time_F(int s); -#else -double Time_F(); -#endif - #ifdef SIGALRM #if defined(__STDC__) || defined(sgi) || defined(_AIX) #define SIGRETTYPE void @@ -129,14 +121,8 @@ double Time_F(); #define SIGRETTYPE int #endif -#ifndef NOPROTO SIGRETTYPE sig_done(int sig); -#else -SIGRETTYPE sig_done(); -#endif - -SIGRETTYPE sig_done(sig) -int sig; +SIGRETTYPE sig_done(int sig) { signal(SIGALRM,sig_done); run=0; @@ -149,8 +135,7 @@ int sig; #define START 0 #define STOP 1 -double Time_F(s) -int s; +double Time_F(int s) { double ret; #ifdef TIMES @@ -186,9 +171,7 @@ int s; #endif } -int main(argc,argv) -int argc; -char **argv; +int main(int argc, char **argv) { long count; static unsigned char buf[BUFSIZE]; @@ -203,7 +186,7 @@ char **argv; #endif #ifndef TIMES - printf("To get the most acurate results, try to run this\n"); + printf("To get the most accurate results, try to run this\n"); printf("program when this computer is idle.\n"); #endif @@ -288,7 +271,7 @@ char **argv; printf("RC5_32/12/16 raw ecb bytes per sec = %12.2f (%9.3fuS)\n",b,8.0e6/b); printf("RC5_32/12/16 cbc bytes per sec = %12.2f (%9.3fuS)\n",c,8.0e6/c); exit(0); -#if defined(LINT) || defined(MSDOS) +#if defined(LINT) || defined(OPENSSL_SYS_MSDOS) return(0); #endif }