Commit ff9b7bb0 authored by Cyril Deguet's avatar Cyril Deguet

- a few changes to make vls compile under Visual C++ (it nearly works...)

parent d0fd8074
......@@ -2,7 +2,7 @@
* application.cpp: Application class
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: application.cpp,v 1.6 2002/03/24 18:54:10 asmax Exp $
* $Id: application.cpp,v 1.7 2002/03/29 23:27:44 asmax Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -35,7 +35,9 @@
#include <stddef.h>
#include <stdlib.h>
#include <stdio.h>
#ifdef HAVE_OPENDIR
#include <dirent.h>
#endif
#include <signal.h>
#include <sys/types.h>
......
......@@ -2,7 +2,7 @@
* common.h: common definitions
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: common.h,v 1.3 2002/03/25 03:48:58 bozo Exp $
* $Id: common.h,v 1.4 2002/03/29 23:27:44 asmax Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -75,20 +75,20 @@
typedef signed char s8;
typedef signed short s16;
typedef signed int s32;
//#if defined WIN32
//typedef __int64 s64;
//#else
#ifdef _WIN32
typedef __int64 s64;
#else
typedef signed long long s64;
//#endif
#endif
typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
//#if defined WIN32
//typedef unsigned __int64 u64;
//#else
#ifdef _WIN32
typedef unsigned __int64 u64;
#else
typedef unsigned long long u64;
//#endif
#endif
// Byte type
typedef u8 byte;
......
......@@ -2,7 +2,7 @@
* core.h: core classes definitions
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: core.h,v 1.5 2002/03/24 15:56:08 asmax Exp $
* $Id: core.h,v 1.6 2002/03/29 23:27:44 asmax Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
*
......@@ -39,7 +39,9 @@
#include <string.h> // For debug.h
#include <stdio.h> // For debug.h
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h> // For socket.h
#endif
#include <sys/types.h> // For socket.h
#ifdef PTHREAD_COND_T_IN_PTHREAD_H
......
......@@ -2,7 +2,7 @@
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /var/lib/cvs/videolan-reinjected/vls/src/core/lexer.cpp,v 1.2 2002/03/25 01:57:43 asmax Exp $
* $Header: /var/lib/cvs/videolan-reinjected/vls/src/core/lexer.cpp,v 1.3 2002/03/29 23:27:44 asmax Exp $
*/
#define FLEX_SCANNER
......@@ -28,10 +28,12 @@
#else
#ifndef YY_ALWAYS_INTERACTIVE
#ifndef YY_NEVER_INTERACTIVE
#ifndef _WIN32
extern int isatty YY_PROTO(( int ));
#endif
#endif
#endif
#endif
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
......@@ -385,7 +387,7 @@ char *yytext;
* lexer.lex: Lexical analyzer for configuration files
*-------------------------------------------------------------------------------
* (c)1999-2002 VideoLAN
* $Id: lexer.cpp,v 1.2 2002/03/25 01:57:43 asmax Exp $
* $Id: lexer.cpp,v 1.3 2002/03/29 23:27:44 asmax Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
*
......@@ -1298,7 +1300,8 @@ FILE *file;
#if YY_NEVER_INTERACTIVE
b->yy_is_interactive = 0;
#else
b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
//b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
b->yy_is_interactive = 0;
#endif
#endif
}
......
......@@ -2,7 +2,7 @@
* network.cpp:
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: network.cpp,v 1.3 2002/03/04 01:55:49 bozo Exp $
* $Id: network.cpp,v 1.4 2002/03/29 23:27:44 asmax Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -80,9 +80,11 @@ template <class Session>
// Initialize the socket that will wait for the client connections
m_pServerSocket->Open(iDomain, SOCK_STREAM, 0);
#ifndef _WIN32
int iOptVal = 1;
m_pServerSocket->SetOption(SOL_SOCKET, SO_REUSEADDR, &iOptVal,
sizeof(iOptVal));
#endif
m_pServerSocket->Bind(strAddr, strPort);
m_pServerSocket->Listen(5);
......
......@@ -2,7 +2,7 @@
* admin.cpp:
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: admin.cpp,v 1.5 2002/03/24 18:54:10 asmax Exp $
* $Id: admin.cpp,v 1.6 2002/03/29 23:27:44 asmax Exp $
*
* Authors: Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
*
......@@ -73,16 +73,18 @@ void C_CommandDesc::BuildUsage()
{
m_strUsage = "Usage: " + m_strName;
for(unsigned int ui = 0; ui < m_vMandatoryArgs.Size(); ui++)
unsigned int ui;
for(ui = 0; ui < m_vMandatoryArgs.Size(); ui++)
m_strUsage += " <" + m_vMandatoryArgs[ui] + ">";
for(unsigned int ui = 0; ui < m_vOptionalArgs.Size(); ui++)
for(ui = 0; ui < m_vOptionalArgs.Size(); ui++)
m_strUsage += " [" + m_vOptionalArgs[ui] + "]";
for(unsigned int ui = 0; ui < m_vOptions.Size(); ui++)
for(ui = 0; ui < m_vOptions.Size(); ui++)
m_strUsage += " [--" + m_vOptions[ui] + " value]";
for(unsigned int ui = 0; ui < m_vBooleans.Size(); ui++)
for(ui = 0; ui < m_vBooleans.Size(); ui++)
m_strUsage += " [--" + m_vBooleans[ui] + "]";
if(m_bExtendedOptions)
......@@ -536,15 +538,17 @@ C_Answer C_Admin::ParseCmdLine(C_AdminSession* pSession,
// Command is OK, now parse the arguments
C_Request cRq(strCmd);
// Default boolean value is "0"
for(unsigned int ui = 0; ui < pCmdDesc->m_vBooleans.Size(); ui++)
unsigned int ui;
for(ui = 0; ui < pCmdDesc->m_vBooleans.Size(); ui++)
cRq.SetArg(pCmdDesc->m_vBooleans[ui], "0");
int iError = 0;
unsigned int uiMandatory = 0;
unsigned int uiOptional = 0;
for(unsigned int ui = 1; ui < vArgs.Size(); ui++)
for(ui = 1; ui < vArgs.Size(); ui++)
{
C_String strArg(vArgs[ui]);
if(strArg.StartsWith("--"))
......@@ -693,7 +697,9 @@ C_Answer C_Admin::ValidateRequest(C_AdminSession* pSession,
// because they are ignored.
int iError = 0;
for(unsigned int ui = 0; ui < pCmdDesc->m_vMandatoryArgs.Size(); ui++)
unsigned int ui;
for(ui = 0; ui < pCmdDesc->m_vMandatoryArgs.Size(); ui++)
{
C_String strArg = cRequest.GetArg(pCmdDesc->m_vMandatoryArgs[ui]);
if(strArg.Length() == 0)
......@@ -705,7 +711,7 @@ C_Answer C_Admin::ValidateRequest(C_AdminSession* pSession,
}
}
for(unsigned int ui = 0; ui < pCmdDesc->m_vBooleans.Size(); ui++)
for(ui = 0; ui < pCmdDesc->m_vBooleans.Size(); ui++)
{
C_String strArg = cRequest.GetArg(pCmdDesc->m_vBooleans[ui]);
if((strArg != "0") && (strArg != "1"))
......
......@@ -2,7 +2,7 @@
* tsstreamer.cpp:
*-------------------------------------------------------------------------------
* (c)1999-2001 VideoLAN
* $Id: tsstreamer.cpp,v 1.3 2002/03/24 18:54:10 asmax Exp $
* $Id: tsstreamer.cpp,v 1.4 2002/03/29 23:27:44 asmax Exp $
*
* Authors: Benoit Steiner <benny@via.ecp.fr>
* Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>
......@@ -31,8 +31,12 @@
//------------------------------------------------------------------------------
#include "../core/defs.h"
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "../core/core.h"
#include "../mpeg/mpeg.h"
......
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