diff options
author | Richard Levitte <levitte@openssl.org> | 2000-06-09 10:41:35 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-06-09 10:41:35 +0000 |
commit | ef33b97050f8157234abe6d5f2da3da1cdda6d68 (patch) | |
tree | a2bb6602fdec189c9acae86bba54d7c1aaac4148 /crypto/lhash | |
parent | 814ed26cfa66945a537f2764f543340845e561a5 (diff) | |
download | openssl-ef33b97050f8157234abe6d5f2da3da1cdda6d68.tar.gz |
Using checks of the existence of HEADER_{foo}_H in other header files
was a really bad idea. For example, the following:
#include <x509.h>
#include <bio.h>
#include <asn1.h>
would make sure that things like ASN1_UTCTIME_print() wasn't defined
unless you moved the inclusion of bio.h to above the inclusion of
x509.h. The reason is that x509.h includes asn1.h, and the
declaration of ASN1_UTCTIME_print() depended on the definition of
HEADER_BIO_H. That's what I call an obscure bug.
Instead, this change makes sure that whatever header files are needed
for the correct process of one header file are included automagically,
and that the definitions of, for example, BIO-related things are
dependent on the absence of the NO_{foo} macros. This is also
consistent with the way parts of OpenSSL can be excluded at will.
Diffstat (limited to 'crypto/lhash')
-rw-r--r-- | crypto/lhash/lh_stats.c | 5 | ||||
-rw-r--r-- | crypto/lhash/lhash.h | 6 |
2 files changed, 9 insertions, 2 deletions
diff --git a/crypto/lhash/lh_stats.c b/crypto/lhash/lh_stats.c index 80b931c12b..ee0600060e 100644 --- a/crypto/lhash/lh_stats.c +++ b/crypto/lhash/lh_stats.c @@ -63,9 +63,12 @@ * and things should work as expected */ #include "cryptlib.h" +#ifndef NO_BIO +#include <openssl/bio.h> +#endif #include <openssl/lhash.h> -#ifndef HEADER_BIO_H +#ifdef NO_BIO void lh_stats(LHASH *lh, FILE *out) { diff --git a/crypto/lhash/lhash.h b/crypto/lhash/lhash.h index 868d535260..b8ff021906 100644 --- a/crypto/lhash/lhash.h +++ b/crypto/lhash/lhash.h @@ -67,6 +67,10 @@ #include <stdio.h> #endif +#ifndef NO_BIO +#include <openssl/bio.h> +#endif + #ifdef __cplusplus extern "C" { #endif @@ -132,7 +136,7 @@ void lh_node_stats(LHASH *lh, FILE *out); void lh_node_usage_stats(LHASH *lh, FILE *out); #endif -#ifdef HEADER_BIO_H +#ifndef NO_BIO void lh_stats_bio(LHASH *lh, BIO *out); void lh_node_stats_bio(LHASH *lh, BIO *out); void lh_node_usage_stats_bio(LHASH *lh, BIO *out); |