Fixes so it will compile again under Win32.
[openssl.git] / crypto / bio / b_sock.c
index d3c1345d0b5eb28a71d4bc00080d3cd8e120ccc5..b9f10f3438546a761f55b8fc6324ff8850f1b13c 100644 (file)
@@ -63,7 +63,7 @@
 #include <errno.h>
 #define USE_SOCKETS
 #include "cryptlib.h"
-#include "bio.h"
+#include <openssl/bio.h>
 
 /*     BIOerr(BIO_F_WSASTARTUP,BIO_R_WSASTARTUP ); */
 
@@ -196,11 +196,15 @@ int BIO_get_port(const char *str, unsigned short *port_ptr)
 int BIO_sock_error(int sock)
        {
        int j,i;
-       unsigned int size;
+       int size;
                 
        size=sizeof(int);
-
-       i=getsockopt(sock,SOL_SOCKET,SO_ERROR,(char *)&j,&size);
+       /* Note: under Windows the third parameter is of type (char *)
+        * whereas under other systems it is (void *) if you don't have
+        * a cast it will choke the compiler: if you do have a cast then
+        * you can either go for (char *) or (void *).
+        */
+       i=getsockopt(sock,SOL_SOCKET,SO_ERROR,(void *)&j,&size);
        if (i < 0)
                return(1);
        else
@@ -593,7 +597,7 @@ int BIO_accept(int sock, char **addr)
        static struct sockaddr_in from;
        unsigned long l;
        unsigned short port;
-       unsigned int len;
+       int len;
        char *p;
 
        memset((char *)&from,0,sizeof(from));