[vlc-devel] commit: WinCE: more missing functions fixes (Geoffroy Couprie )

git version control git at videolan.org
Tue Sep 30 13:25:05 CEST 2008


vlc | branch: master | Geoffroy Couprie <geo.couprie at gmail.com> | Tue Sep 30 13:28:03 2008 +0200| [d0102803a094e4b98623df34a998ad92db288d7e] | committer: Geoffroy Couprie 

WinCE: more missing functions fixes

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d0102803a094e4b98623df34a998ad92db288d7e
---

 include/vlc_fixups.h  |    8 ++++++++
 include/vlc_threads.h |    2 +-
 src/config/dirs.c     |    3 +++
 src/extras/libc.c     |    9 +++++++++
 src/libvlc.c          |    2 +-
 src/misc/block.c      |    4 ++++
 6 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/include/vlc_fixups.h b/include/vlc_fixups.h
index 09c467b..9992cd5 100644
--- a/include/vlc_fixups.h
+++ b/include/vlc_fixups.h
@@ -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 */
diff --git a/include/vlc_threads.h b/include/vlc_threads.h
index 7b2f07b..4050150 100644
--- a/include/vlc_threads.h
+++ b/include/vlc_threads.h
@@ -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>
diff --git a/src/config/dirs.c b/src/config/dirs.c
index 16cbf81..24a651a 100644
--- a/src/config/dirs.c
+++ b/src/config/dirs.c
@@ -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 */
diff --git a/src/extras/libc.c b/src/extras/libc.c
index 70b5d66..b29a7ed 100644
--- a/src/extras/libc.c
+++ b/src/extras/libc.c
@@ -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;
 }
 
diff --git a/src/libvlc.c b/src/libvlc.c
index 7a905e2..b12dfa2 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -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))
diff --git a/src/misc/block.c b/src/misc/block.c
index 0effdb9..7677d77 100644
--- a/src/misc/block.c
+++ b/src/misc/block.c
@@ -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)
 {




More information about the vlc-devel mailing list