Explorar el Código

* Winsock compilation fixes in cacaserver, courtesy of Ben Wiley Sittler

<bsittler@gmail.com>
tags/v0.99.beta14
Sam Hocevar sam hace 17 años
padre
commit
6d843e75b2
Se han modificado 1 ficheros con 11 adiciones y 6 borrados
  1. +11
    -6
      src/cacaserver.c

+ 11
- 6
src/cacaserver.c Ver fichero

@@ -30,6 +30,7 @@
#elif defined(HAVE_WINSOCK2_H)
# include <winsock2.h>
# include <ws2tcpip.h>
# define USE_WINSOCK 1
#endif
#if defined(HAVE_UNISTD_H)
# include <unistd.h>
@@ -41,6 +42,10 @@
#include <errno.h>
#include <stdarg.h>

#ifndef USE_WINSOCK
# define USE_WINSOCK 0
#endif

#include "cucul.h"

#define BACKLOG 1337 /* Number of pending connections */
@@ -129,12 +134,12 @@ int main(void)
struct server *server;
char *tmp;

#ifdef HAVE_WINDOWS_H
WORD winsockVersion;
WSADATA wsaData;
winsockVersion = MAKEWORD(1, 1);
#if USE_WINSOCK
WORD winsockVersion;
WSADATA wsaData;
winsockVersion = MAKEWORD(1, 1);

WSAStartup(winsockVersion, &wsaData);
WSAStartup(winsockVersion, &wsaData);
#endif
server = malloc(sizeof(struct server));

@@ -291,7 +296,7 @@ restart:

free(server);

#ifdef HAVE_WINDOWS_H
#if USE_WINSOCK
WSACleanup();
#endif
return 0;


Cargando…
Cancelar
Guardar