From 171d858e99c52dfaca3bdd655bdbd77fbc2fac96 Mon Sep 17 00:00:00 2001 From: Gildas Bazin Date: Mon, 3 Mar 2003 16:49:14 +0000 Subject: [PATCH] * ALL: another bunch of fixes for the MSVC build. --- include/vlc_common.h | 11 ++++++++++- modules/misc/dummy/decoder.c | 4 +++- msvc/vlc.dsp.in | 8 ++++---- src/misc/modules.c | 36 +++++++++++++++++++++++++++++++----- toolbox | 8 ++++---- 5 files changed, 52 insertions(+), 15 deletions(-) diff --git a/include/vlc_common.h b/include/vlc_common.h index 2326b9f347..c13c41c4cf 100644 --- a/include/vlc_common.h +++ b/include/vlc_common.h @@ -3,7 +3,7 @@ * Collection of useful common types and macros definitions ***************************************************************************** * Copyright (C) 1998, 1999, 2000 VideoLAN - * $Id: vlc_common.h,v 1.55 2003/02/28 04:31:24 ipkiss Exp $ + * $Id: vlc_common.h,v 1.56 2003/03/03 16:49:14 gbazin Exp $ * * Authors: Samuel Hocevar * Vincent Seguin @@ -610,8 +610,17 @@ typedef __int64 off_t; # define off_t unsigned __int64 # endif +# ifdef lseek +# undef lseek +# define lseek _lseeki64 +# endif + # ifndef O_NONBLOCK # define O_NONBLOCK 0 +# endif + +# ifndef alloca +# define alloca _alloca # endif /* These two are not defined in mingw32 (bug?) */ diff --git a/modules/misc/dummy/decoder.c b/modules/misc/dummy/decoder.c index 45870b5bd9..86f770f32a 100644 --- a/modules/misc/dummy/decoder.c +++ b/modules/misc/dummy/decoder.c @@ -2,7 +2,7 @@ * dec_dummy.c: dummy decoder plugin for vlc. ***************************************************************************** * Copyright (C) 2002 VideoLAN - * $Id: decoder.c,v 1.4 2002/11/18 18:05:13 sam Exp $ + * $Id: decoder.c,v 1.5 2003/03/03 16:49:14 gbazin Exp $ * * Authors: Samuel Hocevar * @@ -29,6 +29,8 @@ #ifdef HAVE_UNISTD_H # include /* write(), close() */ +#elif defined( WIN32 ) && !defined( UNDER_CE ) +# include #endif #ifdef HAVE_SYS_TYPES_H # include /* open() */ diff --git a/msvc/vlc.dsp.in b/msvc/vlc.dsp.in index 1fda4a5da3..c40600263a 100644 --- a/msvc/vlc.dsp.in +++ b/msvc/vlc.dsp.in @@ -49,8 +49,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib netapi32.lib winmm.lib /nologo /subsystem:console /machine:I386 +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386 /entry:mainCRTStartup +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib netapi32.lib winmm.lib /nologo /subsystem:windows /machine:I386 /entry:mainCRTStartup !ELSEIF "$(CFG)" == "vlc - Win32 Debug" @@ -73,8 +73,8 @@ BSC32=bscmake.exe # ADD BASE BSC32 /nologo # ADD BSC32 /nologo LINK32=link.exe -# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept -# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib netapi32.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /entry:mainCRTStartup +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib netapi32.lib winmm.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept /entry:mainCRTStartup # SUBTRACT LINK32 /pdb:none !ENDIF diff --git a/src/misc/modules.c b/src/misc/modules.c index d29399ede9..5ee42cf75a 100644 --- a/src/misc/modules.c +++ b/src/misc/modules.c @@ -2,7 +2,7 @@ * modules.c : Builtin and plugin modules management functions ***************************************************************************** * Copyright (C) 2001 VideoLAN - * $Id: modules.c,v 1.114 2003/02/18 22:40:39 ipkiss Exp $ + * $Id: modules.c,v 1.115 2003/03/03 16:49:14 gbazin Exp $ * * Authors: Samuel Hocevar * Ethan C. Baldridge @@ -565,7 +565,7 @@ static void AllocateAllPlugins( vlc_object_t *p_this ) path[ sizeof(path)/sizeof(char*) - 2 ] = config_GetPsz( p_this, "plugin-path" ); -#if defined( WIN32 ) && !defined( UNDER_CE ) +#if defined( WIN32 ) && !defined( UNDER_CE ) && !defined( _MSC_VER ) /* If there is no 'plugins' nor 'modules' subdirectory, the user may have * screwed up the unzipping stage, so we look into '.' instead */ if( !opendir( "plugins" ) && !opendir( "modules" ) @@ -642,8 +642,12 @@ static void AllocateAllPlugins( vlc_object_t *p_this ) static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir, int i_maxdepth ) { +#if defined( UNDER_CE ) || defined( _MSC_VER ) #ifdef UNDER_CE MYCHAR psz_path[MAX_PATH + 256]; +#else + char psz_path[MAX_PATH + 256]; +#endif WIN32_FIND_DATA finddata; HANDLE handle; unsigned int rc; @@ -659,7 +663,7 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir, return; } -#ifdef UNDER_CE +#if defined( UNDER_CE ) || defined( _MSC_VER ) rc = GetFileAttributes( psz_dir ); if( !(rc & FILE_ATTRIBUTE_DIRECTORY) ) { @@ -668,7 +672,11 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir, } /* Parse all files in the directory */ +#ifdef UNDER_CE swprintf( psz_path, L"%s\\*.*", psz_dir ); +#else + sprintf( psz_path, "%s\\*.*", psz_dir ); +#endif handle = FindFirstFile( psz_path, &finddata ); if( handle == INVALID_HANDLE_VALUE ) { @@ -679,15 +687,33 @@ static void AllocatePluginDir( vlc_object_t *p_this, const MYCHAR *psz_dir, /* Parse the directory and try to load all files it contains. */ do { +#ifdef UNDER_CE unsigned int i_len = wcslen( finddata.cFileName ); - swprintf( psz_path, L"%s\\%s", psz_dir, finddata.cFileName ); +#else + unsigned int i_len = strlen( finddata.cFileName ); + /* Skip ".", ".." and anything starting with "." */ + if( !*finddata.cFileName || *finddata.cFileName == '.' ) + { + if( !FindNextFile( handle, &finddata ) ) break; + continue; + } + sprintf( psz_path, "%s\\%s", psz_dir, finddata.cFileName ); +#endif if( GetFileAttributes( psz_path ) & FILE_ATTRIBUTE_DIRECTORY ) { AllocatePluginDir( p_this, psz_path, i_maxdepth - 1 ); } - else if( i_len > strlen( LIBEXT ) ) + else if( i_len > strlen( LIBEXT ) +#ifdef UNDER_CE + ) +#else + /* We only load files ending with LIBEXT */ + && !strncasecmp( psz_path + strlen( psz_path) + - strlen( LIBEXT ), + LIBEXT, strlen( LIBEXT ) ) ) +#endif { AllocatePluginFile( p_this, psz_path ); } diff --git a/toolbox b/toolbox index 48b8664adb..baf8e1be00 100755 --- a/toolbox +++ b/toolbox @@ -1,7 +1,7 @@ #! /bin/sh ## toolbox for the VLC media player -## $Id: toolbox,v 1.10 2003/03/01 19:25:13 gbazin Exp $ +## $Id: toolbox,v 1.11 2003/03/03 16:49:14 gbazin Exp $ ## ## Authors: Samuel Hocevar @@ -118,7 +118,7 @@ then cat >> ${target} << EOF # Begin Source File${M} SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M} -# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\"plugins\\" /D DATA_PATH=\\"share\\"${M} +# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M} # End Source File${M} EOF done @@ -134,7 +134,7 @@ EOF cat >> ${target} << EOF # Begin Source File${M} SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M} -# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\"plugins\\" /D DATA_PATH=\\"share\\"${M} +# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M} !IF "\$(CFG)" == "libvlc - Win32 (WCE MIPS) Release"${M} # PROP Output_Dir "MIPSRel\\${subdir}"${M} # PROP Intermediate_Dir "MIPSRel\\${subdir}"${M} @@ -172,7 +172,7 @@ EOF cat >> ${target} << EOF # Begin Source File${M} SOURCE="..\\`echo $file | sed -e 's%/%\\\\%g'`"${M} -# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\"plugins\\" /D DATA_PATH=\\"share\\"${M} +# ADD CPP /D "__VLC__" /D PLUGIN_PATH=\\".\\" /D DATA_PATH=\\"share\\"${M} !IF "\$(CFG)" == "libvlc - Win32 Release"${M} # PROP Output_Dir "Release\\${subdir}"${M} # PROP Intermediate_Dir "Release\\${subdir}"${M} -- 2.39.2