]> git.sesse.net Git - vlc/commitdiff
WinCE: more missing functions fixes
authorGeoffroy Couprie <geo.couprie@gmail.com>
Tue, 30 Sep 2008 11:28:03 +0000 (13:28 +0200)
committerGeoffroy Couprie <geo.couprie@gmail.com>
Tue, 30 Sep 2008 11:28:03 +0000 (13:28 +0200)
include/vlc_fixups.h
include/vlc_threads.h
src/config/dirs.c
src/extras/libc.c
src/libvlc.c
src/misc/block.c

index 09c467be5aaf5bf696607e930e8ea071b7959023..9992cd5a5b66245380f2e6f9032de0d04a71b388 100644 (file)
@@ -281,4 +281,12 @@ typedef void *locale_t;
 #define N_(str) gettext_noop (str)
 #define gettext_noop(str) (str)
 
+#ifdef UNDER_CE
+static inline void rewind ( FILE *stream )
+{
+    fseek(stream, 0L, SEEK_SET);
+    clearerr(stream);
+}
+#endif
+
 #endif /* !LIBVLC_FIXUPS_H */
index 7b2f07b62d842a9a77fbebbe27ca3fe537e822a4..4050150378b29c07f593f419f05584cbeee091f4 100644 (file)
@@ -35,7 +35,7 @@
  */
 
 #if defined( UNDER_CE )
-                                                                /* WinCE API */
+#   include <errno.h>                                           /* WinCE API */
 #elif defined( WIN32 )
 #   include <process.h>                                         /* Win32 API */
 #   include <errno.h>
index 16cbf8134c85f4f26b506be6a3e741ff7da7d862..24a651a0dd1294b27c2f175f7890644acefcc531 100644 (file)
@@ -82,6 +82,9 @@ static const char *GetDir( bool b_appdata, bool b_common_appdata )
     wchar_t wdir[MAX_PATH];
 
 # if defined (UNDER_CE)
+    /*There are some errors in cegcc headers*/
+#undef SHGetSpecialFolderPath
+    BOOL WINAPI SHGetSpecialFolderPath(HWND,LPWSTR,int,BOOL);
     if( SHGetSpecialFolderPath( NULL, wdir, CSIDL_APPDATA, 1 ) )
 # else
     /* Get the "Application Data" folder for the current user */
index 70b5d66c846d52fa943441aff3dd00843e7073e7..b29a7ede200bff0760dce688c7efbad671a9aacb 100644 (file)
@@ -258,7 +258,11 @@ void *vlc_wopendir( const wchar_t *wpath )
         if( !p_dir )
             return NULL;
         p_dir->p_real_dir = NULL;
+# if defined(UNDER_CE)
+        p_dir->i_drives = NULL;
+# elif
         p_dir->i_drives = GetLogicalDrives();
+#endif
         return (void *)p_dir;
     }
 
@@ -303,6 +307,10 @@ struct _wdirent *vlc_wreaddir( void *_p_dir )
 
     /* Drive letters mode */
     i_drives = p_dir->i_drives;
+#ifdef UNDER_CE
+    swprintf( p_dir->dd_dir.d_name, L"\\");
+    p_dir->dd_dir.d_namlen = wcslen(p_dir->dd_dir.d_name);
+#else
     if ( !i_drives )
         return NULL; /* end */
 
@@ -315,6 +323,7 @@ struct _wdirent *vlc_wreaddir( void *_p_dir )
     swprintf( p_dir->dd_dir.d_name, L"%c:\\", 'A' + i );
     p_dir->dd_dir.d_namlen = wcslen(p_dir->dd_dir.d_name);
     p_dir->i_drives &= ~(1UL << i);
+#endif
     return &p_dir->dd_dir;
 }
 
index 7a905e29293e31e9caabdff6ad96d43e126a44f1..b12dfa23f9706ee3442f28dd486ac7025d5fe7b4 100644 (file)
@@ -2060,7 +2060,7 @@ static int ConsoleWidth( void )
             i_width = 80;
         pclose( file );
     }
-#else
+#elif !defined (UNDER_CE)
     CONSOLE_SCREEN_BUFFER_INFO buf;
 
     if (GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &buf))
index 0effdb901bd99c37e600b9d287116018deada934..7677d778510a6cab3583b4a358ac8e871bf84f02 100644 (file)
@@ -243,6 +243,10 @@ block_t *block_mmap_Alloc (void *addr, size_t length)
 
 
 #ifdef WIN32
+#ifdef UNDER_CE
+#define _get_osfhandle(a) ((long) (a))
+#endif
+
 static
 ssize_t pread (int fd, void *buf, size_t count, off_t offset)
 {