Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-gpu
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-gpu
Commits
b973e326
Commit
b973e326
authored
Sep 30, 2008
by
Geoffroy Couprie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WinCE: fix missing functions
parent
a490cbb6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
9 deletions
+61
-9
include/vlc_fixups.h
include/vlc_fixups.h
+42
-0
src/extras/libc.c
src/extras/libc.c
+2
-2
src/modules/os.c
src/modules/os.c
+5
-4
src/text/unicode.c
src/text/unicode.c
+12
-3
No files found.
include/vlc_fixups.h
View file @
b973e326
...
@@ -44,12 +44,54 @@ static inline char *strdup (const char *str)
...
@@ -44,12 +44,54 @@ static inline char *strdup (const char *str)
# include <stdarg.h>
# include <stdarg.h>
static
inline
int
vasprintf
(
char
**
strp
,
const
char
*
fmt
,
va_list
ap
)
static
inline
int
vasprintf
(
char
**
strp
,
const
char
*
fmt
,
va_list
ap
)
{
{
#ifndef UNDER_CE
int
len
=
vsnprintf
(
NULL
,
0
,
fmt
,
ap
)
+
1
;
int
len
=
vsnprintf
(
NULL
,
0
,
fmt
,
ap
)
+
1
;
char
*
res
=
(
char
*
)
malloc
(
len
);
char
*
res
=
(
char
*
)
malloc
(
len
);
if
(
res
==
NULL
)
if
(
res
==
NULL
)
return
-
1
;
return
-
1
;
*
strp
=
res
;
*
strp
=
res
;
return
vsprintf
(
res
,
fmt
,
ap
);
return
vsprintf
(
res
,
fmt
,
ap
);
#else
/* HACK: vsnprintf in the WinCE API behaves like
* the one in glibc 2.0 and doesn't return the number of characters
* it needed to copy the string.
* cf http://msdn.microsoft.com/en-us/library/1kt27hek.aspx
* and cf the man page of vsnprintf
*
Guess we need no more than 50 bytes. */
int
n
,
size
=
50
;
char
*
res
,
*
np
;
if
((
res
=
(
char
*
)
malloc
(
size
))
==
NULL
)
return
-
1
;
while
(
1
)
{
n
=
vsnprintf
(
res
,
size
,
fmt
,
ap
);
/* If that worked, return the string. */
if
(
n
>
-
1
&&
n
<
size
)
{
*
strp
=
res
;
return
n
;
}
/* Else try again with more space. */
if
(
n
==
-
1
)
size
*=
2
;
/* twice the old size */
if
((
np
=
(
char
*
)
realloc
(
res
,
size
))
==
NULL
)
{
free
(
res
);
return
-
1
;
}
else
{
res
=
np
;
}
}
#endif
/* UNDER_CE */
}
}
#endif
#endif
...
...
src/extras/libc.c
View file @
b973e326
...
@@ -234,7 +234,7 @@ char *vlc_strsep( char **ppsz_string, const char *psz_delimiters )
...
@@ -234,7 +234,7 @@ char *vlc_strsep( char **ppsz_string, const char *psz_delimiters )
* vlc_*dir_wrapper: wrapper under Windows to return the list of drive letters
* vlc_*dir_wrapper: wrapper under Windows to return the list of drive letters
* when called with an empty argument or just '\'
* when called with an empty argument or just '\'
*****************************************************************************/
*****************************************************************************/
#if defined(WIN32)
&& !defined(UNDER_CE)
#if defined(WIN32)
# include <assert.h>
# include <assert.h>
typedef
struct
vlc_DIR
typedef
struct
vlc_DIR
...
@@ -330,7 +330,7 @@ void vlc_rewinddir( void *_p_dir )
...
@@ -330,7 +330,7 @@ void vlc_rewinddir( void *_p_dir )
/* This one is in the libvlccore exported symbol list */
/* This one is in the libvlccore exported symbol list */
int
vlc_wclosedir
(
void
*
_p_dir
)
int
vlc_wclosedir
(
void
*
_p_dir
)
{
{
#if defined(WIN32)
&& !defined(UNDER_CE)
#if defined(WIN32)
vlc_DIR
*
p_dir
=
(
vlc_DIR
*
)
_p_dir
;
vlc_DIR
*
p_dir
=
(
vlc_DIR
*
)
_p_dir
;
int
i_ret
=
0
;
int
i_ret
=
0
;
...
...
src/modules/os.c
View file @
b973e326
...
@@ -183,16 +183,17 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
...
@@ -183,16 +183,17 @@ int module_Load( vlc_object_t *p_this, const char *psz_file,
wchar_t
psz_wfile
[
MAX_PATH
];
wchar_t
psz_wfile
[
MAX_PATH
];
MultiByteToWideChar
(
CP_ACP
,
0
,
psz_file
,
-
1
,
psz_wfile
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
psz_file
,
-
1
,
psz_wfile
,
MAX_PATH
);
#ifndef UNDER_CE
/* FIXME: this is not thread-safe -- Courmisch */
/* FIXME: this is not thread-safe -- Courmisch */
UINT
mode
=
SetErrorMode
(
SEM_FAILCRITICALERRORS
);
UINT
mode
=
SetErrorMode
(
SEM_FAILCRITICALERRORS
);
SetErrorMode
(
mode
|
SEM_FAILCRITICALERRORS
);
SetErrorMode
(
mode
|
SEM_FAILCRITICALERRORS
);
#endif
#ifdef UNDER_CE
handle
=
LoadLibrary
(
psz_wfile
);
#else
handle
=
LoadLibraryW
(
psz_wfile
);
handle
=
LoadLibraryW
(
psz_wfile
);
#endif
#ifndef UNDER_CE
SetErrorMode
(
mode
);
SetErrorMode
(
mode
);
#endif
if
(
handle
==
NULL
)
if
(
handle
==
NULL
)
{
{
...
...
src/text/unicode.c
View file @
b973e326
...
@@ -262,7 +262,10 @@ char *ToLocaleDup (const char *utf8)
...
@@ -262,7 +262,10 @@ char *ToLocaleDup (const char *utf8)
*/
*/
int
utf8_open
(
const
char
*
filename
,
int
flags
,
mode_t
mode
)
int
utf8_open
(
const
char
*
filename
,
int
flags
,
mode_t
mode
)
{
{
#ifdef WIN32
#ifdef UNDER_CE
/*_open translates to wchar internally on WinCE*/
return
_open
(
filename
,
flags
,
mode
);
#elif defined (WIN32)
/* for Windows NT and above */
/* for Windows NT and above */
wchar_t
wpath
[
MAX_PATH
+
1
];
wchar_t
wpath
[
MAX_PATH
+
1
];
...
@@ -571,7 +574,10 @@ int utf8_scandir( const char *dirname, char ***namelist,
...
@@ -571,7 +574,10 @@ int utf8_scandir( const char *dirname, char ***namelist,
static
int
utf8_statEx
(
const
char
*
filename
,
struct
stat
*
buf
,
static
int
utf8_statEx
(
const
char
*
filename
,
struct
stat
*
buf
,
bool
deref
)
bool
deref
)
{
{
#if defined (WIN32)
#ifdef UNDER_CE
/*_stat translates to wchar internally on WinCE*/
return
_stat
(
filename
,
buf
);
#elif defined (WIN32)
/* for Windows NT and above */
/* for Windows NT and above */
wchar_t
wpath
[
MAX_PATH
+
1
];
wchar_t
wpath
[
MAX_PATH
+
1
];
...
@@ -631,7 +637,10 @@ int utf8_lstat( const char *filename, struct stat *buf)
...
@@ -631,7 +637,10 @@ int utf8_lstat( const char *filename, struct stat *buf)
*/
*/
int
utf8_unlink
(
const
char
*
filename
)
int
utf8_unlink
(
const
char
*
filename
)
{
{
#if defined (WIN32)
#ifdef UNDER_CE
/*_open translates to wchar internally on WinCE*/
return
_unlink
(
filename
);
#elif defined (WIN32)
/* for Windows NT and above */
/* for Windows NT and above */
wchar_t
wpath
[
MAX_PATH
+
1
];
wchar_t
wpath
[
MAX_PATH
+
1
];
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment