Some C compilers produce warnings or compilation errors if an attempt

is made to directly cast a function of one type to what it considers and
incompatible type. In particular gcc 3.4.2.

Add new openssl_fcast macro to place functions into a form where the compiler
will allow them to be cast.

The current version achives this by casting to: void function(void).
This commit is contained in:
Dr. Stephen Henson
2005-05-12 23:01:44 +00:00
parent ba2ba27008
commit fe86616c72
4 changed files with 49 additions and 46 deletions

View File

@@ -469,7 +469,7 @@ int OCSP_basic_sign(OCSP_BASICRESP *brsp,
ASN1_STRING *ASN1_STRING_encode(ASN1_STRING *s, i2d_of_void *i2d,
void *data, STACK_OF(ASN1_OBJECT) *sk);
#define ASN1_STRING_encode_of(type,s,i2d,data,sk) \
((ASN1_STRING *(*)(ASN1_STRING *,I2D_OF(type),type *,STACK_OF(ASN1_OBJECT) *))ASN1_STRING_encode)(s,i2d,data,sk)
((ASN1_STRING *(*)(ASN1_STRING *,I2D_OF(type),type *,STACK_OF(ASN1_OBJECT) *))openssl_fcast(ASN1_STRING_encode))(s,i2d,data,sk)
X509_EXTENSION *OCSP_crlID_new(char *url, long *n, char *tim);