Commit e304db6b authored by Gildas Bazin's avatar Gildas Bazin

* ALL: another bunch of MSVC compilation fixes.

parent 3d6ee48d
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: vlc_common.h,v 1.94 2003/12/04 16:02:54 sam Exp $
* $Id: vlc_common.h,v 1.95 2003/12/04 17:15:59 gbazin Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -450,13 +450,14 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
#define TAB_APPEND( count, tab, p ) \
if( (count) > 0 ) \
{ \
(void *)(tab) = realloc( (tab), sizeof( void ** ) * ( (count) + 1 ) );\
(*(void **)(&tab)) = \
realloc( tab, sizeof( void ** ) * ( (count) + 1 ) ); \
} \
else \
{ \
(void *)(tab) = malloc( sizeof( void ** ) ); \
(*(void **)(&tab)) = malloc( sizeof( void ** ) ); \
} \
(void**)(tab)[(count)] = (void*)(p); \
((void**)(tab))[count] = (void*)(p); \
(count)++
#define TAB_FIND( count, tab, p, index ) \
......@@ -465,7 +466,7 @@ typedef int ( * vlc_callback_t ) ( vlc_object_t *, /* variable's object */
(index) = -1; \
for( _i_ = 0; _i_ < (count); _i_++ ) \
{ \
if((void**)(tab)[_i_]==(void*)(p)) \
if( ((void**)(tab))[_i_] == (void*)(p) ) \
{ \
(index) = _i_; \
break; \
......
......@@ -4,7 +4,7 @@
* interface, such as message output.
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: vlc_messages.h,v 1.9 2003/12/03 23:01:48 sigmunau Exp $
* $Id: vlc_messages.h,v 1.10 2003/12/04 17:15:59 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -104,6 +104,7 @@ struct msg_subscription_t
* Prototypes
*****************************************************************************/
VLC_EXPORT( void, __msg_Generic, ( vlc_object_t *, int, const char *, const char *, ... ) ATTRIBUTE_FORMAT( 4, 5 ) );
VLC_EXPORT( void, __msg_GenericVa, ( vlc_object_t *, int, const char *, const char *, va_list args ) );
VLC_EXPORT( void, __msg_Info, ( vlc_object_t *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) );
VLC_EXPORT( void, __msg_Err, ( vlc_object_t *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) );
VLC_EXPORT( void, __msg_Warn, ( vlc_object_t *, const char *, ... ) ATTRIBUTE_FORMAT( 2, 3 ) );
......@@ -127,7 +128,42 @@ VLC_EXPORT( void, __msg_Dbg, ( vlc_object_t *, const char *, ... ) ATTRIBUTE_
__msg_Generic( VLC_OBJECT(p_this), VLC_MSG_DBG, MODULE_STRING, \
psz_format, ## args )
#else /* HAVE_VARIADIC_MACROS */
#elif defined(_MSC_VER) /* To avoid warnings and even errors with c++ files */
inline void msg_Info( void *p_this, const char *psz_format, ... )
{
va_list ap;
va_start( ap, psz_format );
__msg_GenericVa( ( vlc_object_t *)p_this, VLC_MSG_INFO, MODULE_STRING,
psz_format, ap );
va_end(ap);
}
inline void msg_Err( void *p_this, const char *psz_format, ... )
{
va_list ap;
va_start( ap, psz_format );
__msg_GenericVa( ( vlc_object_t *)p_this, VLC_MSG_ERR, MODULE_STRING,
psz_format, ap );
va_end(ap);
}
inline void msg_Warn( void *p_this, const char *psz_format, ... )
{
va_list ap;
va_start( ap, psz_format );
__msg_GenericVa( ( vlc_object_t *)p_this, VLC_MSG_WARN, MODULE_STRING,
psz_format, ap );
va_end(ap);
}
inline void msg_Dbg( void *p_this, const char *psz_format, ... )
{
va_list ap;
va_start( ap, psz_format );
__msg_GenericVa( ( vlc_object_t *)p_this, VLC_MSG_DBG, MODULE_STRING,
psz_format, ap );
va_end(ap);
}
#else /* _MSC_VER */
# define msg_Info __msg_Info
# define msg_Err __msg_Err
......
......@@ -2,7 +2,7 @@
* dshow.cpp : DirectShow access module for vlc
*****************************************************************************
* Copyright (C) 2002 VideoLAN
* $Id: dshow.cpp,v 1.19 2003/12/04 16:49:43 sam Exp $
* $Id: dshow.cpp,v 1.20 2003/12/04 17:15:59 gbazin Exp $
*
* Author: Gildas Bazin <gbazin@netcourrier.com>
*
......@@ -310,7 +310,7 @@ static int AccessOpen( vlc_object_t *p_this )
p_input->i_pts_delay = val.i_int * 1000;
/* Initialize OLE/COM */
CoInitializeEx( 0, COINIT_APARTMENTTHREADED );
CoInitialize( 0 );
/* create access private data */
p_input->p_access_data = p_sys =
......
......@@ -4,7 +4,7 @@
* modules, especially intf modules. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998-2002 VideoLAN
* $Id: messages.c,v 1.36 2003/12/03 23:01:48 sigmunau Exp $
* $Id: messages.c,v 1.37 2003/12/04 17:15:59 gbazin Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -229,6 +229,12 @@ void __msg_Generic( vlc_object_t *p_this, int i_type, const char *psz_module,
va_end( args );
}
void __msg_GenericVa( vlc_object_t *p_this, int i_type, const char *psz_module,
const char *psz_format, va_list args )
{
QueueMsg( p_this, i_type, psz_module, psz_format, args );
}
/* Generic functions used when variadic macros are not available. */
#define DECLARE_MSG_FN( FN_NAME, FN_TYPE ) \
void FN_NAME( vlc_object_t *p_this, const char *psz_format, ... ) \
......
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