Make sure we get the definition of OPENSSL_NO_SOCK.
[openssl.git] / crypto / bio / b_sock.c
index 45bd7c47e87bc7c1d5fa9bd919d74c403169ae84..c5010080281a408e3eb3ccf4ee84e5bf767c09c5 100644 (file)
@@ -56,8 +56,6 @@
  * [including the GNU Public Licence.]
  */
 
-#ifndef OPENSSL_NO_SOCK
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h>
@@ -65,6 +63,8 @@
 #include "cryptlib.h"
 #include <openssl/bio.h>
 
+#ifndef OPENSSL_NO_SOCK
+
 #ifdef OPENSSL_SYS_WIN16
 #define SOCKET_PROTOCOL 0 /* more microsoft stupidity */
 #else
@@ -83,6 +83,7 @@
 static int wsa_init_done=0;
 #endif
 
+#if 0
 static unsigned long BIO_ghbn_hits=0L;
 static unsigned long BIO_ghbn_miss=0L;
 
@@ -93,6 +94,7 @@ static struct ghbn_cache_st
        struct hostent *ent;
        unsigned long order;
        } ghbn_cache[GHBN_NUM];
+#endif
 
 static int get_ip(const char *str,unsigned char *ip);
 #if 0
@@ -230,6 +232,7 @@ int BIO_sock_error(int sock)
                return(j);
        }
 
+#if 0
 long BIO_ghbn_ctrl(int cmd, int iarg, char *parg)
        {
        int i;
@@ -267,6 +270,7 @@ long BIO_ghbn_ctrl(int cmd, int iarg, char *parg)
                }
        return(1);
        }
+#endif
 
 #if 0
 static struct hostent *ghbn_dup(struct hostent *a)
@@ -463,6 +467,12 @@ int BIO_sock_init(void)
                        }
                }
 #endif /* OPENSSL_SYS_WINDOWS */
+#ifdef WATT32
+       extern int _watt_do_exit;
+       _watt_do_exit = 0;    /* don't make sock_init() call exit() */
+       if (sock_init())
+               return (-1);
+#endif
        return(1);
        }
 
@@ -472,7 +482,9 @@ void BIO_sock_cleanup(void)
        if (wsa_init_done)
                {
                wsa_init_done=0;
+#ifndef OPENSSL_SYS_WINCE
                WSACancelBlockingCall();
+#endif
                WSACleanup();
                }
 #endif
@@ -480,7 +492,7 @@ void BIO_sock_cleanup(void)
 
 #if !defined(OPENSSL_SYS_VMS) || __VMS_VER >= 70000000
 
-int BIO_socket_ioctl(int fd, long type, unsigned long *arg)
+int BIO_socket_ioctl(int fd, long type, void *arg)
        {
        int i;
 
@@ -730,7 +742,7 @@ int BIO_set_tcp_ndelay(int s, int on)
 int BIO_socket_nbio(int s, int mode)
        {
        int ret= -1;
-       unsigned long l;
+       int l;
 
        l=mode;
 #ifdef FIONBIO