Commit cfac1213 authored by Cyril Deguet's avatar Cyril Deguet

* fixed previous commit...

parent 04734eae
......@@ -2,7 +2,7 @@
* socket.cpp: socket management
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: socket.cpp,v 1.9 2002/04/25 14:57:28 asmax Exp $
* $Id: socket.cpp,v 1.10 2002/04/25 15:23:19 asmax Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -452,9 +452,6 @@ void C_Socket::Bind(const C_String& strIntf, const C_String& strPort)
int iRc = bind(m_hSocket, pAddr, iAddrLen);
if(iRc)
{
#ifdef _WIN32
iRc = WSAGetLastError();
#endif
throw E_Socket("Unable to bind to " + strIntf + " on port " + strPort +
": " + GetErrorMsg(SYSTEM_NETWORK));
}
......
......@@ -2,7 +2,7 @@
* system.cpp: System base functions
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: system.cpp,v 1.2 2002/04/25 14:57:28 asmax Exp $
* $Id: system.cpp,v 1.3 2002/04/25 15:23:19 asmax Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -59,7 +59,7 @@
//------------------------------------------------------------------------------
int GetErrorCode(int iSubSystem/* = SYSTEM_DEFAULT*/)
{
#if _WIN32
#ifdef _WIN32
switch(iSubSystem)
{
case SYSTEM_DEFAULT:
......@@ -69,10 +69,10 @@ int GetErrorCode(int iSubSystem/* = SYSTEM_DEFAULT*/)
default:
ASSERT(false);
return GEN_ERR;
}
#elif defined HAVE_STRERROR
ASSERT(iSubSystem != SYSTEM_LIBRARY);
return errno;
}
#elif defined HAVE_STRERROR
ASSERT(iSubSystem != SYSTEM_LIBRARY);
return errno;
#endif
}
......@@ -111,8 +111,8 @@ C_String GetErrorMsg(int iSubSystem/* = SYSTEM_DEFAULT*/)
// To do: trim the string (\n, \r and .)
LocalFree(lpBuff);
return strMessage;
#elif defined HAVE_STRERROR
return C_String(strerror(GetErrorCode(iSubSystem)));
#elif defined HAVE_STRERROR
return C_String(strerror(GetErrorCode(iSubSystem)));
#endif
}
......
......@@ -2,7 +2,7 @@
* videoinput.cpp: Video4linux streams
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: videoinput.cpp,v 1.5 2002/03/21 14:09:19 bozo Exp $
* $Id: videoinput.cpp,v 1.6 2002/04/25 15:23:19 asmax Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
......@@ -31,8 +31,12 @@
//------------------------------------------------------------------------------
#include "../../core/defs.h"
#ifdef HAVE_SYSTIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "../../core/core.h"
......
......@@ -2,7 +2,7 @@
* vls.cpp: vls main file
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: vls.cpp,v 1.6 2002/04/25 14:57:29 asmax Exp $
* $Id: vls.cpp,v 1.7 2002/04/25 15:23:19 asmax Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -31,10 +31,10 @@
#include "../core/defs.h"
#ifdef GETPROTOBYNAME_IN_NETDB_H
#include <netdb.h>
#include <netdb.h>
#endif
#ifdef _WIN32
#include <winsock2.h>
#ifdef _WIN32
#include <winsock2.h>
#endif
#include "config.h"
......@@ -87,21 +87,21 @@ int C_Vls::OnAppInit()
{
// Startup message
printf("%s\n", PGRM_INFO);
// Check environnement
int iRc = CheckEnvir();
#ifdef _WIN32
// Initialize Winsock
WSADATA data;
int version = (u16)((u8)1 | (u16((u8)(1))) << 8);
iRc = WSAStartup(version, &data);
if (iRc)
{
printf("Unable to load Winsock 1.1\n");
}
#endif
int iRc = CheckEnvir();
#ifdef _WIN32
// Initialize Winsock
WSADATA data;
int version = (u16)((u8)1 | (u16((u8)(1))) << 8);
iRc = WSAStartup(version, &data);
if (iRc)
{
printf("Unable to load Winsock 1.1\n");
}
#endif
if(!iRc)
{
......@@ -156,10 +156,10 @@ int C_Vls::OnAppExit()
m_pAdministrator->DisableRequests();
iRc = m_pAdministrator->Stop();
}
#ifdef _WIN32
WSACleanup();
#endif
#ifdef _WIN32
WSACleanup();
#endif
return iRc;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment