#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
refs = __sync_add_and_fetch (&p_gc->refs, 1);
-#elif defined (WIN32) && defined (__GNUC__)
- refs = __builtin_choose_expr (sizeof (uintptr_t) == 4,
- InterlockedIncrement (&p_gc->refs),
- InterlockedIncrement64 (&p_gc->refs));
+#elif defined (WIN64)
+ refs = InterlockedIncrement64 (&p_gc->refs);
+#elif defined (WIN32)
+ refs = InterlockedIncrement (&p_gc->refs);
#elif defined(__APPLE__)
refs = OSAtomicIncrement32Barrier((int*)&p_gc->refs);
#else
#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4)
refs = __sync_sub_and_fetch (&p_gc->refs, 1);
-#elif defined (WIN32) && defined (__GNUC__)
- refs = __builtin_choose_expr (sizeof (uintptr_t) == 4,
- InterlockedDecrement (&p_gc->refs),
- InterlockedDecrement64 (&p_gc->refs));
+#elif defined (WIN64)
+ refs = InterlockedDecrement64 (&p_gc->refs);
+#elif defined (WIN32)
+ refs = InterlockedDecrement (&p_gc->refs);
#elif defined(__APPLE__)
refs = OSAtomicDecrement32Barrier((int*)&p_gc->refs);
#else
static void InitDeviceValues( libvlc_int_t * );
-vlc_mutex_t global_lock = VLC_STATIC_MUTEX;
+static vlc_mutex_t global_lock = VLC_STATIC_MUTEX;
/**
* Allocate a libvlc instance, initialize global data if needed
size_t module_count;
module_t **list = module_list_get( &module_count );
module_list_free( list );
- msg_Dbg( p_libvlc, "module bank initialized (%u modules)", module_count );
+ msg_Dbg( p_libvlc, "module bank initialized (%zu modules)", module_count );
/* Check for help on modules */
if( (p_tmp = config_GetPsz( p_libvlc, "module" )) )
if( priv->b_color )
priv->b_color = config_GetInt( p_libvlc, "color" ) > 0;
- /*
- * Output messages that may still be in the queue
- */
- msg_Flush( p_libvlc );
-
if( !config_GetInt( p_libvlc, "fpu" ) )
cpu_flags &= ~CPU_CAPABILITY_FPU;
/*
* Choose the best memcpy module
*/
- priv->p_memcpy_module = module_need( p_libvlc, "memcpy", "$memcpy", 0 );
+ priv->p_memcpy_module = module_need( p_libvlc, "memcpy", "$memcpy", false );
priv->b_stats = config_GetInt( p_libvlc, "stats" ) > 0;
priv->i_timers = 0;
*psz_parser = '\0';
psz_parser++;
}
- psz_temp = (char *)malloc( strlen(psz_module) + sizeof(",none") );
- if( psz_temp )
+ if( asprintf( &psz_temp, "%s,none", psz_module ) != -1)
{
- sprintf( psz_temp, "%s,none", psz_module );
libvlc_InternalAddIntf( p_libvlc, psz_temp );
free( psz_temp );
}
}
#endif
- if( config_GetInt( p_libvlc, "file-logging" ) > 0 )
+ if( (config_GetInt( p_libvlc, "file-logging" ) > 0) &&
+ !config_GetInt( p_libvlc, "syslog" ) )
{
libvlc_InternalAddIntf( p_libvlc, "logger,none" );
}
}
vlc_mutex_unlock( &global_lock );
- msg_Flush( p_libvlc );
msg_Destroy( p_libvlc );
/* Destroy mutexes */