Commit 5c834978 authored by Gildas Bazin's avatar Gildas Bazin

* configure.ac, src/extras/libc.c, modules/misc/network/ipv4.c: fixed the WinCE build.

parent 5c0dd04b
...@@ -171,7 +171,6 @@ case "${target_os}" in ...@@ -171,7 +171,6 @@ case "${target_os}" in
VLC_ADD_LDFLAGS([vlc],[-lws2_32 -lnetapi32 -lwinmm -mwindows]) VLC_ADD_LDFLAGS([vlc],[-lws2_32 -lnetapi32 -lwinmm -mwindows])
VLC_ADD_LDFLAGS([vcdx cddax],[-lwinmm]) VLC_ADD_LDFLAGS([vcdx cddax],[-lwinmm])
VLC_ADD_LDFLAGS([ipv4 ipv6 access_http access_mms access_udp access_tcp access_ftp access_output_udp sap slp http stream_out_standard stream_out_rtp vod_rtsp telnet netsync],[-lws2_32]) VLC_ADD_LDFLAGS([ipv4 ipv6 access_http access_mms access_udp access_tcp access_ftp access_output_udp sap slp http stream_out_standard stream_out_rtp vod_rtsp telnet netsync],[-lws2_32])
VLC_ADD_LDFLAGS([ipv4],[-liphlpapi])
fi fi
if test "${SYS}" = "mingwce"; then if test "${SYS}" = "mingwce"; then
# add ws2 for closesocket, select, recv # add ws2 for closesocket, select, recv
...@@ -179,7 +178,6 @@ case "${target_os}" in ...@@ -179,7 +178,6 @@ case "${target_os}" in
VLC_ADD_CPPFLAGS([vlc],[-Dmain(a,b)=maince(a,b)]) VLC_ADD_CPPFLAGS([vlc],[-Dmain(a,b)=maince(a,b)])
VLC_ADD_LDFLAGS([vlc],[-lws2 -e WinMainCRTStartup]) VLC_ADD_LDFLAGS([vlc],[-lws2 -e WinMainCRTStartup])
VLC_ADD_LDFLAGS([ipv4 ipv6 access_http access_mms access_udp access_tcp access_ftp access_output_udp sap http netsync],[-lws2]) VLC_ADD_LDFLAGS([ipv4 ipv6 access_http access_mms access_udp access_tcp access_ftp access_output_udp sap http netsync],[-lws2])
VLC_ADD_LDFLAGS([ipv4],[-liphlpapi])
fi fi
;; ;;
*nto*) *nto*)
...@@ -241,8 +239,10 @@ XGETTEXT="${XGETTEXT} --keyword=_NS --keyword=_ANS" ...@@ -241,8 +239,10 @@ XGETTEXT="${XGETTEXT} --keyword=_NS --keyword=_ANS"
dnl dnl
dnl Iconv stuff dnl Iconv stuff
dnl dnl
if test "${SYS}" != "mingwce"; then
AS_IF([test "$am_cv_func_iconv" != "yes"], AS_IF([test "$am_cv_func_iconv" != "yes"],
[AC_MSG_ERROR([libiconv is needed for VLC to work properly])]) [AC_MSG_ERROR([libiconv is needed for VLC to work properly])])
fi
VLC_ADD_CFLAGS([vlc],[${INCICONV}]) VLC_ADD_CFLAGS([vlc],[${INCICONV}])
VLC_ADD_LDFLAGS([vlc],[${LIBICONV}]) VLC_ADD_LDFLAGS([vlc],[${LIBICONV}])
......
...@@ -344,21 +344,36 @@ static int OpenUDP( vlc_object_t * p_this ) ...@@ -344,21 +344,36 @@ static int OpenUDP( vlc_object_t * p_this )
#if defined (WIN32) || defined (UNDER_CE) #if defined (WIN32) || defined (UNDER_CE)
else else
{ {
DWORD WINAPI (*OurGetBestInterface)(IPAddr,PDWORD);
DWORD WINAPI (*OurGetIpAddrTable)(PMIB_IPADDRTABLE,PULONG,BOOL);
HINSTANCE hiphlpapi = LoadLibrary(_T("Iphlpapi.dll"));
DWORD i_index; DWORD i_index;
if( GetBestInterface( sock.sin_addr.s_addr,
&i_index ) == NO_ERROR ) if( hiphlpapi )
{
OurGetBestInterface =
(void *)GetProcAddress( hiphlpapi,
_T("GetBestInterface") );
OurGetIpAddrTable =
(void *)GetProcAddress( hiphlpapi,
_T("GetIpAddrTable") );
}
if( hiphlpapi && OurGetBestInterface && OurGetIpAddrTable &&
OurGetBestInterface( sock.sin_addr.s_addr,
&i_index ) == NO_ERROR )
{ {
PMIB_IPADDRTABLE p_table; PMIB_IPADDRTABLE p_table;
DWORD i = 0; DWORD i = 0;
msg_Dbg( p_this, "Winsock best interface is %lu", msg_Dbg( p_this, "Winsock best interface is %lu",
(unsigned long)i_index ); (unsigned long)i_index );
GetIpAddrTable( NULL, &i, 0 ); OurGetIpAddrTable( NULL, &i, 0 );
p_table = (PMIB_IPADDRTABLE)malloc( i ); p_table = (PMIB_IPADDRTABLE)malloc( i );
if( p_table != NULL ) if( p_table != NULL )
{ {
if( GetIpAddrTable( p_table, &i, 0 ) == NO_ERROR) if( OurGetIpAddrTable( p_table, &i, 0 ) == NO_ERROR )
{ {
for( i = 0; i < p_table->dwNumEntries; i-- ) for( i = 0; i < p_table->dwNumEntries; i-- )
{ {
...@@ -371,13 +386,13 @@ static int OpenUDP( vlc_object_t * p_this ) ...@@ -371,13 +386,13 @@ static int OpenUDP( vlc_object_t * p_this )
} }
} }
} }
else else msg_Warn( p_this, "GetIpAddrTable failed" );
msg_Warn( p_this, "GetIpAddrTable failed" );
free( p_table ); free( p_table );
} }
} }
else else msg_Dbg( p_this, "GetBestInterface failed" );
msg_Dbg( p_this, "GetBestInterface failed" );
if( hiphlpapi ) FreeLibrary( hiphlpapi );
} }
#endif #endif
if( psz_if_addr != NULL ) free( psz_if_addr ); if( psz_if_addr != NULL ) free( psz_if_addr );
......
...@@ -55,6 +55,10 @@ ...@@ -55,6 +55,10 @@
# include <windows.h> # include <windows.h>
#endif #endif
#ifdef UNDER_CE
# define strcoll strcmp
#endif
/***************************************************************************** /*****************************************************************************
* getenv: just in case, but it should never be called * getenv: just in case, but it should never be called
*****************************************************************************/ *****************************************************************************/
...@@ -343,7 +347,7 @@ int64_t vlc_atoll( const char *nptr ) ...@@ -343,7 +347,7 @@ int64_t vlc_atoll( const char *nptr )
* 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) && !defined(UNDER_CE)
typedef struct vlc_DIR typedef struct vlc_DIR
{ {
DIR *p_real_dir; DIR *p_real_dir;
...@@ -949,7 +953,7 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv, ...@@ -949,7 +953,7 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char **ppsz_argv,
} }
} }
#elif defined( WIN32 ) #elif defined( WIN32 ) && !defined( UNDER_CE )
SECURITY_ATTRIBUTES saAttr; SECURITY_ATTRIBUTES saAttr;
PROCESS_INFORMATION piProcInfo; PROCESS_INFORMATION piProcInfo;
STARTUPINFO siStartInfo; STARTUPINFO siStartInfo;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment