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 :-)
This commit is contained in:
Dr. Stephen Henson
2000-06-21 02:25:30 +00:00
parent 7ef8206859
commit 130832150c
26 changed files with 79 additions and 88 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)

View File

@@ -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;