diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2000-06-21 02:25:30 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2000-06-21 02:25:30 +0000 |
commit | 130832150c1313824868b154cccda3ace88fa950 (patch) | |
tree | f2b0eac7c3740a8b85f52210b42dc5dc9352557b /crypto/bio | |
parent | 7ef8206859f9a52f48e817c023c744fe00e82c5d (diff) |
Fixes for Win32 build.
This is mostly a work around for the old VC++ problem
that it treats func() as func(void).
Various prototypes had been added to 'compare' function
pointers that triggered this. This could be fixed by removing
the prototype, adding function pointer casts to every call or
changing the passed function to use the expected arguments.
I mostly did the latter.
The mkdef.pl script was modified to remove the typesafe
functions which no longer exist.
Oh and some functions called OPENSSL_freeLibrary() were
changed back to FreeLibrary(), wonder how that happened :-)
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/bf_buff.c | 4 | ||||
-rw-r--r-- | crypto/bio/bf_nbio.c | 4 | ||||
-rw-r--r-- | crypto/bio/bf_null.c | 4 | ||||
-rw-r--r-- | crypto/bio/bio.h | 8 | ||||
-rw-r--r-- | crypto/bio/bss_conn.c | 6 |
5 files changed, 14 insertions, 12 deletions
diff --git a/crypto/bio/bf_buff.c b/crypto/bio/bf_buff.c index e9916d29eb..c65dc142a5 100644 --- a/crypto/bio/bf_buff.c +++ b/crypto/bio/bf_buff.c @@ -69,7 +69,7 @@ static int buffer_gets(BIO *h, char *str, int size); static long buffer_ctrl(BIO *h, int cmd, long arg1, void *arg2); static int buffer_new(BIO *h); static int buffer_free(BIO *data); -static long buffer_callback_ctrl(BIO *h, int cmd, void (*fp)()); +static long buffer_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); #define DEFAULT_BUFFER_SIZE 1024 static BIO_METHOD methods_buffer= @@ -439,7 +439,7 @@ malloc_error: return(0); } -static long buffer_callback_ctrl(BIO *b, int cmd, void (*fp)()) +static long buffer_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) { long ret=1; diff --git a/crypto/bio/bf_nbio.c b/crypto/bio/bf_nbio.c index a4a60a0c6d..413ef5c4c5 100644 --- a/crypto/bio/bf_nbio.c +++ b/crypto/bio/bf_nbio.c @@ -73,7 +73,7 @@ static int nbiof_gets(BIO *h,char *str,int size); static long nbiof_ctrl(BIO *h,int cmd,long arg1,void *arg2); static int nbiof_new(BIO *h); static int nbiof_free(BIO *data); -static long nbiof_callback_ctrl(BIO *h,int cmd,void (*fp)()); +static long nbiof_callback_ctrl(BIO *h,int cmd,bio_info_cb *fp); typedef struct nbio_test_st { /* only set if we sent a 'should retry' error */ @@ -226,7 +226,7 @@ static long nbiof_ctrl(BIO *b, int cmd, long num, void *ptr) return(ret); } -static long nbiof_callback_ctrl(BIO *b, int cmd, void (*fp)()) +static long nbiof_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) { long ret=1; diff --git a/crypto/bio/bf_null.c b/crypto/bio/bf_null.c index a3f0b02a7f..2678a1a85d 100644 --- a/crypto/bio/bf_null.c +++ b/crypto/bio/bf_null.c @@ -72,7 +72,7 @@ static int nullf_gets(BIO *h, char *str, int size); static long nullf_ctrl(BIO *h, int cmd, long arg1, void *arg2); static int nullf_new(BIO *h); static int nullf_free(BIO *data); -static long nullf_callback_ctrl(BIO *h, int cmd, void (*fp)()); +static long nullf_callback_ctrl(BIO *h, int cmd, bio_info_cb *fp); static BIO_METHOD methods_nullf= { BIO_TYPE_NULL_FILTER, @@ -154,7 +154,7 @@ static long nullf_ctrl(BIO *b, int cmd, long num, void *ptr) return(ret); } -static long nullf_callback_ctrl(BIO *b, int cmd, void (*fp)()) +static long nullf_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) { long ret=1; diff --git a/crypto/bio/bio.h b/crypto/bio/bio.h index 68107d9798..5634a96a79 100644 --- a/crypto/bio/bio.h +++ b/crypto/bio/bio.h @@ -211,6 +211,8 @@ extern "C" { typedef struct bio_st BIO; +typedef void bio_info_cb(struct bio_st *, int, const char *, int, long, long); + #ifndef WIN16 typedef struct bio_method_st { @@ -223,7 +225,7 @@ typedef struct bio_method_st long (*ctrl)(BIO *, int, long, void *); int (*create)(BIO *); int (*destroy)(BIO *); - long (*callback_ctrl)(BIO *, int, void (*)(struct bio_st *, int, const char *, int, long, long)); + long (*callback_ctrl)(BIO *, int, bio_info_cb *); } BIO_METHOD; #else typedef struct bio_method_st @@ -460,8 +462,8 @@ int BIO_read_filename(BIO *b,const char *name); size_t BIO_ctrl_pending(BIO *b); size_t BIO_ctrl_wpending(BIO *b); #define BIO_flush(b) (int)BIO_ctrl(b,BIO_CTRL_FLUSH,0,NULL) -#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,(void (**)())(cbp)) -#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,(void (*)())(cb)) +#define BIO_get_info_callback(b,cbp) (int)BIO_ctrl(b,BIO_CTRL_GET_CALLBACK,0,(bio_info_cb **)(cbp)) +#define BIO_set_info_callback(b,cb) (int)BIO_callback_ctrl(b,BIO_CTRL_SET_CALLBACK,(bio_info_cb *)(cb)) /* For the BIO_f_buffer() type */ #define BIO_buffer_get_num_lines(b) BIO_ctrl(b,BIO_CTRL_GET,0,NULL) diff --git a/crypto/bio/bss_conn.c b/crypto/bio/bss_conn.c index 1281a0af0d..7ed26f358f 100644 --- a/crypto/bio/bss_conn.c +++ b/crypto/bio/bss_conn.c @@ -104,7 +104,7 @@ static int conn_puts(BIO *h, const char *str); static long conn_ctrl(BIO *h, int cmd, long arg1, void *arg2); static int conn_new(BIO *h); static int conn_free(BIO *data); -static long conn_callback_ctrl(BIO *h, int cmd, void (*fp)()); +static long conn_callback_ctrl(BIO *h, int cmd, bio_info_cb *); static int conn_state(BIO *b, BIO_CONNECT *c); static void conn_close_socket(BIO *data); @@ -574,7 +574,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) if (data->param_hostname) BIO_set_conn_hostname(dbio,data->param_hostname); BIO_set_nbio(dbio,data->nbio); - (void)BIO_set_info_callback(dbio,(void *(*)())(data->info_callback)); + (void)BIO_set_info_callback(dbio,data->info_callback); } break; case BIO_CTRL_SET_CALLBACK: @@ -602,7 +602,7 @@ static long conn_ctrl(BIO *b, int cmd, long num, void *ptr) return(ret); } -static long conn_callback_ctrl(BIO *b, int cmd, void (*fp)()) +static long conn_callback_ctrl(BIO *b, int cmd, bio_info_cb *fp) { long ret=1; BIO_CONNECT *data; |