]> git.sesse.net Git - vlc/commitdiff
* ALL: another bunch of fixes for the MSVC build.
authorGildas Bazin <gbazin@videolan.org>
Mon, 3 Mar 2003 16:49:14 +0000 (16:49 +0000)
committerGildas Bazin <gbazin@videolan.org>
Mon, 3 Mar 2003 16:49:14 +0000 (16:49 +0000)
include/vlc_common.h
modules/misc/dummy/decoder.c
msvc/vlc.dsp.in
src/misc/modules.c
toolbox

index 2326b9f347d31b06120097602f82254f5b97843d..c13c41c4cfb2c0737e29ba910c29bc660f8c8ad4 100644 (file)
@@ -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 <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -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?) */
index 45870b5bd9ffba13b37aab25e3a6db774ad3aa51..86f770f32ad22987201b2a69139f045ea07577b2 100644 (file)
@@ -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 <sam@zoy.org>
  *      
@@ -29,6 +29,8 @@
 
 #ifdef HAVE_UNISTD_H
 #   include <unistd.h> /* write(), close() */
+#elif defined( WIN32 ) && !defined( UNDER_CE )
+#   include <io.h>
 #endif
 #ifdef HAVE_SYS_TYPES_H
 #   include <sys/types.h> /* open() */
index 1fda4a5da3c641a4a18f5fb01de2bba3921acb56..c40600263ab9ea368e8fa5a08b9fee3c34565e03 100644 (file)
@@ -49,8 +49,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
-# 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\r
-# 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\r
+# 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\r
+# 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\r
 \r
 !ELSEIF  "$(CFG)" == "vlc - Win32 Debug"\r
 \r
@@ -73,8 +73,8 @@ BSC32=bscmake.exe
 # ADD BASE BSC32 /nologo\r
 # ADD BSC32 /nologo\r
 LINK32=link.exe\r
-# 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\r
-# 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\r
+# 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\r
+# 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\r
 # SUBTRACT LINK32 /pdb:none\r
 \r
 !ENDIF \r
index d29399ede9e71fbde8d3d00be0020bc2fda44066..5ee42cf75a52aa4f60963b750c36024d65d329c0 100644 (file)
@@ -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 <sam@zoy.org>
  *          Ethan C. Baldridge <BaldridgeE@cadmus.com>
@@ -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 48b8664adb3a2accaa95de44d034196bf64748e9..baf8e1be0015c6b658c6ab8ee3b25c1f25fbdf9f 100755 (executable)
--- 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 <sam@zoy.org>
 
@@ -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}