]> git.sesse.net Git - vlc/commitdiff
* src/misc/modules.c,cpu.c, modules/access/file.c: WinCE fixes.
authorGildas Bazin <gbazin@videolan.org>
Wed, 5 Jan 2005 22:45:36 +0000 (22:45 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 5 Jan 2005 22:45:36 +0000 (22:45 +0000)
modules/access/file.c
src/misc/cpu.c
src/misc/modules.c

index ae134ff861e1d1bf97e19f10e00efde91ef36275..841e18c7ec05d4a8f2012c34d698071655f4ea54 100644 (file)
@@ -185,7 +185,9 @@ static int Open( vlc_object_t *p_this )
     p_sys->file = NULL;
     p_sys->i_file = 0;
     p_sys->i_index = 0;
+#ifndef UNDER_CE
     p_sys->fd = -1;
+#endif
 
     if( !strcasecmp( p_access->psz_access, "stream" ) )
     {
@@ -577,7 +579,7 @@ static int _OpenFile( access_t * p_access, char * psz_name )
     p_sys->fd = fopen( psz_name, "rb" );
     if ( !p_sys->fd )
     {
-        msg_Err( p_access, "cannot open file %s" );
+        msg_Err( p_access, "cannot open file %s", psz_name );
         return VLC_EGENERIC;
     }
 
index a0da75d6757c8411d78f2bfa5ad41c5d73343110..6c5a292bf42771cc8355313d2eadb9059abac945 100644 (file)
@@ -283,7 +283,7 @@ uint32_t CPUCapabilities( void )
     i_capabilities |= CPU_CAPABILITY_FPU;
     return i_capabilities;
 
-#elif defined( _MSC_VER )
+#elif defined( _MSC_VER ) && !defined( UNDER_CE )
     i_capabilities |= CPU_CAPABILITY_FPU;
     return i_capabilities;
 
index 7a50dc1bd60acc50e59eede5dd0c423ec85c122f..99b02daa8f7599691ebe99148536e115e92a4e8d 100644 (file)
@@ -1544,23 +1544,19 @@ static void * _module_getsymbol( module_handle_t handle,
 static char * GetWindowsError( void )
 {
 #if defined(UNDER_CE)
-    wchar_t psz_tmp[256];
-    char * psz_buffer = malloc( 256 );
+    wchar_t psz_tmp[MAX_PATH];
+    char * psz_buffer = malloc( MAX_PATH );
 #else
-    char * psz_tmp = malloc( 256 );
+    char * psz_tmp = malloc( MAX_PATH );
 #endif
     int i = 0, i_error = GetLastError();
 
     FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
                    NULL, i_error, MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT),
-                   (LPTSTR) psz_tmp, 256, NULL );
+                   (LPTSTR)psz_tmp, MAX_PATH, NULL );
 
     /* Go to the end of the string */
-#if defined(UNDER_CE)
-    while( psz_tmp[i] && psz_tmp[i] != L'\r' && psz_tmp[i] != L'\n' )
-#else
-    while( psz_tmp[i] && psz_tmp[i] != '\r' && psz_tmp[i] != '\n' )
-#endif
+    while( psz_tmp[i] && psz_tmp[i] != _T('\r') && psz_tmp[i] != _T('\n') )
     {
         i++;
     }
@@ -1577,8 +1573,7 @@ static char * GetWindowsError( void )
     }
 
 #if defined(UNDER_CE)
-    WideCharToMultiByte( CP_ACP, WC_DEFAULTCHAR, psz_tmp, -1,
-                         psz_buffer, 256, NULL, NULL );
+    wcstombs( psz_buffer, psz_tmp, MAX_PATH );
     return psz_buffer;
 #else
     return psz_tmp;