diff options
author | Richard Levitte <levitte@openssl.org> | 2001-02-20 08:13:47 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2001-02-20 08:13:47 +0000 |
commit | bc36ee6227517edae802bcb0da68d4f04fe1fb5e (patch) | |
tree | 19782c56cd5f5930807df5c8bfb4963a05121c48 /crypto | |
parent | f2bc668429fa2abdc77db0db861a9bb2be0c3a85 (diff) |
Use new-style system-id macros everywhere possible. I hope I haven't
missed any.
This compiles and runs on Linux, and external applications have no
problems with it. The definite test will be to build this on VMS.
Diffstat (limited to 'crypto')
53 files changed, 168 insertions, 166 deletions
diff --git a/crypto/asn1/a_gentm.c b/crypto/asn1/a_gentm.c index 000d346dd5..185d169600 100644 --- a/crypto/asn1/a_gentm.c +++ b/crypto/asn1/a_gentm.c @@ -193,7 +193,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, { char *p; struct tm *ts; -#if defined(OPENSSL_THREADS) && !defined(WIN32) +#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) struct tm data; #endif @@ -202,7 +202,7 @@ ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, if (s == NULL) return(NULL); -#if defined(OPENSSL_THREADS) && !defined(WIN32) +#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */ ts=&data; #else diff --git a/crypto/asn1/a_time.c b/crypto/asn1/a_time.c index d50e6157e0..266614d14f 100644 --- a/crypto/asn1/a_time.c +++ b/crypto/asn1/a_time.c @@ -100,7 +100,7 @@ int i2d_ASN1_TIME(ASN1_TIME *a, unsigned char **pp) ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t) { struct tm *ts; -#if defined(OPENSSL_THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) +#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__) struct tm data; gmtime_r(&t,&data); diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index 77b88e67db..0a5a8d2753 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c @@ -58,7 +58,7 @@ #include <stdio.h> #include <time.h> -#ifdef VMS +#ifdef OPENSSL_SYS_VMS #include <descrip.h> #include <lnmdef.h> #include <starlet.h> @@ -191,7 +191,7 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t) { char *p; struct tm *ts; -#if defined(OPENSSL_THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) +#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__) struct tm data; #endif @@ -201,13 +201,13 @@ ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t) if (s == NULL) return(NULL); -#if defined(OPENSSL_THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) +#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__) gmtime_r(&t,&data); /* should return &data, but doesn't on some systems, so we don't even look at the return value */ ts=&data; #else ts=gmtime(&t); #endif -#ifdef VMS +#ifdef OPENSSL_SYS_VMS if (ts == NULL) { static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL"); @@ -284,7 +284,7 @@ int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t) t -= offset*60; /* FIXME: may overflow in extreme cases */ -#if defined(OPENSSL_THREADS) && !defined(WIN32) && !defined(__CYGWIN32__) +#if defined(OPENSSL_THREADS) && !defined(OPENSSL_SYS_WIN32) && !defined(__CYGWIN32__) { struct tm data; gmtime_r(&t, &data); tm = &data; } #else tm = gmtime(&t); diff --git a/crypto/bf/bf_opts.c b/crypto/bf/bf_opts.c index bbe32b28c9..99df5c303e 100644 --- a/crypto/bf/bf_opts.c +++ b/crypto/bf/bf_opts.c @@ -59,7 +59,7 @@ /* define PART1, PART2, PART3 or PART4 to build only with a few of the options. * This is for machines with 64k code segment size restrictions. */ -#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) +#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) #define TIMES #endif @@ -82,7 +82,7 @@ OPENSSL_DECLARE_EXIT 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(VMS) && defined(__DECC) && !defined(__TMS) +#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS) #undef TIMES #endif @@ -322,7 +322,7 @@ int main(int argc, char **argv) break; } exit(0); -#if defined(LINT) || defined(MSDOS) +#if defined(LINT) || defined(OPENSSL_SYS_MSDOS) return(0); #endif } diff --git a/crypto/bf/bfspeed.c b/crypto/bf/bfspeed.c index ecc9dff4e4..5b2077b643 100644 --- a/crypto/bf/bfspeed.c +++ b/crypto/bf/bfspeed.c @@ -59,7 +59,7 @@ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ -#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) +#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) #define TIMES #endif @@ -82,7 +82,7 @@ OPENSSL_DECLARE_EXIT 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(VMS) && defined(__DECC) && !defined(__TMS) +#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS) #undef TIMES #endif @@ -268,7 +268,7 @@ int main(int argc, char **argv) printf("Blowfish raw ecb bytes per sec = %12.3f (%9.3fuS)\n",b,8.0e6/b); printf("Blowfish cbc bytes per sec = %12.3f (%9.3fuS)\n",c,8.0e6/c); exit(0); -#if defined(LINT) || defined(MSDOS) +#if defined(LINT) || defined(OPENSSL_SYS_MSDOS) return(0); #endif } diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index 35d2e5b6f3..d4b44b62bb 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -65,7 +65,7 @@ #include "cryptlib.h" #include <openssl/bio.h> -#ifdef WIN16 +#ifdef OPENSSL_SYS_WIN16 #define SOCKET_PROTOCOL 0 /* more microsoft stupidity */ #else #define SOCKET_PROTOCOL IPPROTO_TCP @@ -79,7 +79,7 @@ #define MAX_LISTEN 32 #endif -#ifdef WINDOWS +#ifdef OPENSSL_SYS_WINDOWS static int wsa_init_done=0; #endif @@ -429,7 +429,7 @@ end: int BIO_sock_init(void) { -#ifdef WINDOWS +#ifdef OPENSSL_SYS_WINDOWS static struct WSAData wsa_state; if (!wsa_init_done) @@ -449,13 +449,13 @@ int BIO_sock_init(void) return(-1); } } -#endif /* WINDOWS */ +#endif /* OPENSSL_SYS_WINDOWS */ return(1); } void BIO_sock_cleanup(void) { -#ifdef WINDOWS +#ifdef OPENSSL_SYS_WINDOWS if (wsa_init_done) { wsa_init_done=0; @@ -465,7 +465,7 @@ void BIO_sock_cleanup(void) #endif } -#if !defined(VMS) || __VMS_VER >= 70000000 +#if !defined(OPENSSL_SYS_VMS) || __VMS_VER >= 70000000 int BIO_socket_ioctl(int fd, long type, unsigned long *arg) { diff --git a/crypto/bio/bio_cb.c b/crypto/bio/bio_cb.c index d6b8aa313a..0ffa4d2136 100644 --- a/crypto/bio/bio_cb.c +++ b/crypto/bio/bio_cb.c @@ -125,7 +125,7 @@ long MS_CALLBACK BIO_debug_callback(BIO *bio, int cmd, const char *argp, b=(BIO *)bio->cb_arg; if (b != NULL) BIO_write(b,buf,strlen(buf)); -#if !defined(OPENSSL_NO_STDIO) && !defined(WIN16) +#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) else fputs(buf,stderr); #endif diff --git a/crypto/bio/bss_acpt.c b/crypto/bio/bss_acpt.c index 9569c7ed8d..8ea1db158b 100644 --- a/crypto/bio/bss_acpt.c +++ b/crypto/bio/bss_acpt.c @@ -64,13 +64,13 @@ #include "cryptlib.h" #include <openssl/bio.h> -#ifdef WIN16 +#ifdef OPENSSL_SYS_WIN16 #define SOCKET_PROTOCOL 0 /* more microsoft stupidity */ #else #define SOCKET_PROTOCOL IPPROTO_TCP #endif -#if (defined(VMS) && __VMS_VER < 70000000) +#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000) /* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */ #undef FIONBIO #endif diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index 9772bc8529..c41ba3cc41 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -64,13 +64,13 @@ #include "cryptlib.h" #include <openssl/bio.h> -#ifdef WIN16 +#ifdef OPENSSL_SYS_WIN16 #define SOCKET_PROTOCOL 0 /* more microsoft stupidity */ #else #define SOCKET_PROTOCOL IPPROTO_TCP #endif -#if (defined(VMS) && __VMS_VER < 70000000) +#if (defined(OPENSSL_SYS_VMS) && __VMS_VER < 70000000) /* FIONBIO used as a switch to enable ioctl, and that isn't in VMS < 7.0 */ #undef FIONBIO #endif diff --git a/crypto/bio/bss_fd.c b/crypto/bio/bss_fd.c index 47f59c467d..5e3e187de6 100644 --- a/crypto/bio/bss_fd.c +++ b/crypto/bio/bss_fd.c @@ -223,7 +223,7 @@ int BIO_fd_should_retry(int i) { err=get_last_sys_error(); -#if defined(WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ +#if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ if ((i == -1) && (err == 0)) return(1); #endif diff --git a/crypto/bio/bss_file.c b/crypto/bio/bss_file.c index cbfe74a5eb..f31e0a50ee 100644 --- a/crypto/bio/bss_file.c +++ b/crypto/bio/bss_file.c @@ -204,7 +204,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr) b->shutdown=(int)num&BIO_CLOSE; b->ptr=(char *)ptr; b->init=1; -#if defined(MSDOS) || defined(WINDOWS) +#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) /* Set correct text/binary mode */ if (num & BIO_FP_TEXT) _setmode(fileno((FILE *)ptr),_O_TEXT); @@ -233,7 +233,7 @@ static long MS_CALLBACK file_ctrl(BIO *b, int cmd, long num, void *ptr) ret=0; break; } -#if defined(MSDOS) || defined(WINDOWS) +#if defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_WINDOWS) if (!(num & BIO_FP_TEXT)) strcat(p,"b"); else diff --git a/crypto/bio/bss_log.c b/crypto/bio/bss_log.c index 1edf16a76f..b289c97d3c 100644 --- a/crypto/bio/bss_log.c +++ b/crypto/bio/bss_log.c @@ -66,9 +66,11 @@ #include <stdio.h> #include <errno.h> -#if defined(WIN32) +#include <openssl/opensslconf.h> + +#if defined(OPENSSL_SYS_WIN32) # include <process.h> -#elif defined(VMS) || defined(__VMS) +#elif defined(OPENSSL_SYS_VMS) # include <opcdef.h> # include <descrip.h> # include <lib$routines.h> @@ -85,7 +87,7 @@ #ifndef NO_SYSLOG -#if defined(WIN32) +#if defined(OPENSSL_SYS_WIN32) #define LOG_EMERG 0 #define LOG_ALERT 1 #define LOG_CRIT 2 @@ -96,7 +98,7 @@ #define LOG_DEBUG 7 #define LOG_DAEMON (3<<3) -#elif defined(VMS) +#elif defined(OPENSSL_SYS_VMS) /* On VMS, we don't really care about these, but we need them to compile */ #define LOG_EMERG 0 #define LOG_ALERT 1 @@ -118,7 +120,7 @@ static int MS_CALLBACK slg_free(BIO *data); static void xopenlog(BIO* bp, char* name, int level); static void xsyslog(BIO* bp, int priority, const char* string); static void xcloselog(BIO* bp); -#ifdef WIN32 +#ifdef OPENSSL_SYS_WIN32 LONG (WINAPI *go_for_advapi)() = RegOpenKeyEx; HANDLE (WINAPI *register_event_source)() = NULL; BOOL (WINAPI *deregister_event_source)() = NULL; @@ -241,7 +243,7 @@ static int MS_CALLBACK slg_puts(BIO *bp, const char *str) return(ret); } -#if defined(WIN32) +#if defined(OPENSSL_SYS_WIN32) static void xopenlog(BIO* bp, char* name, int level) { @@ -313,7 +315,7 @@ static void xcloselog(BIO* bp) bp->ptr= NULL; } -#elif defined(VMS) +#elif defined(OPENSSL_SYS_VMS) static int VMS_OPC_target = LOG_DAEMON; diff --git a/crypto/bio/bss_sock.c b/crypto/bio/bss_sock.c index 727378ad93..fdabd16d7e 100644 --- a/crypto/bio/bss_sock.c +++ b/crypto/bio/bss_sock.c @@ -228,7 +228,7 @@ int BIO_sock_should_retry(int i) { err=get_last_socket_error(); -#if defined(WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ +#if defined(OPENSSL_SYS_WINDOWS) && 0 /* more microsoft stupidity? perhaps not? Ben 4/1/99 */ if ((i == -1) && (err == 0)) return(1); #endif @@ -242,7 +242,7 @@ int BIO_sock_non_fatal_error(int err) { switch (err) { -#if defined(WINDOWS) +#if defined(OPENSSL_SYS_WINDOWS) # if defined(WSAEWOULDBLOCK) case WSAEWOULDBLOCK: # endif diff --git a/crypto/bn/bnspeed.c b/crypto/bn/bnspeed.c index 20fc7e08ff..2c81667154 100644 --- a/crypto/bn/bnspeed.c +++ b/crypto/bn/bnspeed.c @@ -71,7 +71,7 @@ #include <openssl/crypto.h> #include <openssl/err.h> -#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) +#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) #define TIMES #endif @@ -87,7 +87,7 @@ 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(VMS) && defined(__DECC) && !defined(__TMS) +#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS) #undef TIMES #endif diff --git a/crypto/bn/bntest.c b/crypto/bn/bntest.c index 0487a2b909..3228618b23 100644 --- a/crypto/bn/bntest.c +++ b/crypto/bn/bntest.c @@ -68,7 +68,7 @@ #include <openssl/x509.h> #include <openssl/err.h> -#ifdef WINDOWS +#ifdef OPENSSL_SYS_WINDOWS #include "../bio/bss_file.c" #endif diff --git a/crypto/bn/expspeed.c b/crypto/bn/expspeed.c index fead8e6036..91dc7ff9a7 100644 --- a/crypto/bn/expspeed.c +++ b/crypto/bn/expspeed.c @@ -97,7 +97,7 @@ static void genprime_cb(int p, int n, void *arg); #include <openssl/err.h> #include <openssl/rand.h> -#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) +#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) #define TIMES #endif @@ -113,7 +113,7 @@ static void genprime_cb(int p, int n, void *arg); 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(VMS) && defined(__DECC) && !defined(__TMS) +#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS) #undef TIMES #endif diff --git a/crypto/bn/exptest.c b/crypto/bn/exptest.c index 3e86f2ea0e..5ca570d1a8 100644 --- a/crypto/bn/exptest.c +++ b/crypto/bn/exptest.c @@ -63,7 +63,7 @@ #include <openssl/bn.h> #include <openssl/rand.h> #include <openssl/err.h> -#ifdef WINDOWS +#ifdef OPENSSL_SYS_WINDOWS #include "../bio/bss_file.c" #endif diff --git a/crypto/bn/vms-helper.c b/crypto/bn/vms-helper.c index 3da4622b13..4b63149bf3 100644 --- a/crypto/bn/vms-helper.c +++ b/crypto/bn/vms-helper.c @@ -60,7 +60,7 @@ bn_div_words_abort(int i) { #ifdef BN_DEBUG -#if !defined(OPENSSL_NO_STDIO) && !defined(WIN16) +#if !defined(OPENSSL_NO_STDIO) && !defined(OPENSSL_SYS_WIN16) fprintf(stderr,"Division would overflow (%d)\n",i); #endif abort(); diff --git a/crypto/cast/cast_spd.c b/crypto/cast/cast_spd.c index 0af915cf20..6e00b90f9d 100644 --- a/crypto/cast/cast_spd.c +++ b/crypto/cast/cast_spd.c @@ -59,7 +59,7 @@ /* 11-Sep-92 Andrew Daviel Support for Silicon Graphics IRIX added */ /* 06-Apr-92 Luke Brennan Support for VMS and add extra signal calls */ -#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) +#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) #define TIMES #endif @@ -82,7 +82,7 @@ OPENSSL_DECLARE_EXIT 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(VMS) && defined(__DECC) && !defined(__TMS) +#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS) #undef TIMES #endif @@ -268,7 +268,7 @@ int main(int argc, char **argv) printf("CAST raw ecb bytes per sec = %12.2f (%9.3fuS)\n",b,8.0e6/b); printf("CAST 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 } diff --git a/crypto/cast/castopts.c b/crypto/cast/castopts.c index c783796610..1b858d153b 100644 --- a/crypto/cast/castopts.c +++ b/crypto/cast/castopts.c @@ -59,7 +59,7 @@ /* define PART1, PART2, PART3 or PART4 to build only with a few of the options. * This is for machines with 64k code segment size restrictions. */ -#if !defined(MSDOS) && (!defined(VMS) || defined(__DECC)) +#if !defined(OPENSSL_SYS_MSDOS) && (!defined(OPENSSL_SYS_VMS) || defined(__DECC)) #define TIMES #endif @@ -82,7 +82,7 @@ OPENSSL_DECLARE_EXIT 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(VMS) && defined(__DECC) && !defined(__TMS) +#if defined(OPENSSL_SYS_VMS_DECC) && !defined(__TMS) #undef TIMES #endif @@ -332,7 +332,7 @@ int main(int argc, char **argv) break; } exit(0); -#if defined(LINT) || defined(MSDOS) +#if defined(LINT) || defined(OPENSSL_SYS_MSDOS) return(0); #endif } diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c index c2ff6c7011..cd2f8a491b 100644 --- a/crypto/comp/c_zlib.c +++ b/crypto/comp/c_zlib.c @@ -48,14 +48,14 @@ static COMP_METHOD zlib_method={ * work. Therefore, all ZLIB routines are loaded at run time * and we do not link to a .LIB file. */ -#if defined(WINDOWS) || defined(WIN32) +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) # include <windows.h> # define Z_CALLCONV _stdcall # define ZLIB_SHARED #else # define Z_CALLCONV -#endif /* !(WINDOWS || WIN32) */ +#endif /* !(OPENSSL_SYS_WINDOWS || OPENSSL_SYS_WIN32) */ #ifdef ZLIB_SHARED #include <openssl/dso.h> @@ -188,7 +188,7 @@ COMP_METHOD *COMP_zlib(void) #ifdef ZLIB_SHARED if (!zlib_loaded) { -#if defined(WINDOWS) || defined(WIN32) +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_WIN32) zlib_dso = DSO_load(NULL, "ZLIB", NULL, 0); #else zlib_dso = DSO_load(NULL, "z", NULL, 0); diff --git a/crypto/conf/conf_def.c b/crypto/conf/conf_def.c index 59f9476dc6..87335a9daa 100644 --- a/crypto/conf/conf_def.c +++ b/crypto/conf/conf_def.c @@ -185,7 +185,7 @@ static int def_load(CONF *conf, const char *name, long *line) int ret; BIO *in=NULL; -#ifdef VMS +#ifdef OPENSSL_SYS_VMS in=BIO_new_file(name, "r"); #else in=BIO_new_file(name, "rb"); |