From ef33b97050f8157234abe6d5f2da3da1cdda6d68 Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Fri, 9 Jun 2000 10:41:35 +0000 Subject: Using checks of the existence of HEADER_{foo}_H in other header files was a really bad idea. For example, the following: #include #include #include 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. --- crypto/err/err.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'crypto/err') diff --git a/crypto/err/err.h b/crypto/err/err.h index 519a9c5b09..2c3d39c68c 100644 --- a/crypto/err/err.h +++ b/crypto/err/err.h @@ -64,6 +64,13 @@ #include #endif +#ifndef NO_BIO +#include +#endif +#ifndef NO_LHASH +#include +#endif + #ifdef __cplusplus extern "C" { #endif @@ -241,7 +248,7 @@ const char *ERR_reason_error_string(unsigned long e); #ifndef NO_FP_API void ERR_print_errors_fp(FILE *fp); #endif -#ifdef HEADER_BIO_H +#ifndef NO_BIO void ERR_print_errors(BIO *bp); void ERR_add_error_data(int num, ...); #endif @@ -253,7 +260,7 @@ void ERR_free_strings(void); void ERR_remove_state(unsigned long pid); /* if zero we look it up */ ERR_STATE *ERR_get_state(void); -#ifdef HEADER_LHASH_H +#ifndef NO_LHASH LHASH *ERR_get_string_table(void); LHASH *ERR_get_err_state_table(void); /* even less thread-safe than * ERR_get_string_table :-) */ -- cgit v1.2.3