* 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>
#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 ) \
(index) = -1; \
for( _i_ = 0; _i_ < (count); _i_++ ) \
{ \
- if((void**)(tab)[_i_]==(void*)(p)) \
+ if( ((void**)(tab))[_i_] == (void*)(p) ) \
{ \
(index) = _i_; \
break; \
* 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>
* 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 ) );
__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
* 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>
*
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 =
* 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>
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, ... ) \