diff options
author | Richard Levitte <levitte@openssl.org> | 2000-01-18 09:30:51 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-01-18 09:30:51 +0000 |
commit | a9188d4e173304948c7711566556602bfb3ee32f (patch) | |
tree | e9b4a390ef9692cc6212c8f1ae60a82cc8854f33 /crypto/bio/bss_conn.c | |
parent | ea5e7bcf632bba51618ab9407409b24cc4df8fa0 (diff) |
Compaq C 6.2 for VMS will complain when we want to convert
non-function pointers to function pointers and vice versa.
The current solution is to have unions that describe the
conversion we want to do, and gives us the ability to extract
the type of data we want.
The current solution is a quick fix, and can probably be made
in a more general or elegant way.
Diffstat (limited to 'crypto/bio/bss_conn.c')
-rw-r--r-- | crypto/bio/bss_conn.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index 68c46e3d69..154cb78fb8 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -98,6 +98,12 @@ typedef struct bio_connect_st int (*info_callback)(); } BIO_CONNECT; +union int_fn_to_char_u + { + char *char_p; + int (*fn_p)(); + }; + static int conn_write(BIO *h,char *buf,int num); static int conn_read(BIO *h,char *buf,int size); static int conn_puts(BIO *h,char *str); @@ -564,16 +570,26 @@ static long conn_ctrl(BIO *b, int cmd, long num, char *ptr) case BIO_CTRL_FLUSH: break; case BIO_CTRL_DUP: + { + union int_fn_to_char_u tmp_cb; + dbio=(BIO *)ptr; if (data->param_port) BIO_set_conn_port(dbio,data->param_port); if (data->param_hostname) BIO_set_conn_hostname(dbio,data->param_hostname); BIO_set_nbio(dbio,data->nbio); - (void)BIO_set_info_callback(dbio,data->info_callback); + tmp_cb.fn_p=data->info_callback; + (void)BIO_set_info_callback(dbio,tmp_cb.char_p); + } break; case BIO_CTRL_SET_CALLBACK: - data->info_callback=(int (*)())ptr; + { + union int_fn_to_char_u tmp_cb; + + tmp_cb.char_p=ptr; + data->info_callback=tmp_cb.fn_p; + } break; case BIO_CTRL_GET_CALLBACK: { |