Commit 4232e947 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont
Browse files

Rewrite CAST_PTHREAD_TO_INT in a ISO C valid way - closes #1407

parent 8ead2f57
......@@ -76,10 +76,13 @@ VLC_EXPORT( void, __vlc_thread_join, ( vlc_object_t *, const char *, int ) );
#define vlc_mutex_lock( P_MUTEX ) \
__vlc_mutex_lock( __FILE__, __LINE__, P_MUTEX )
#if defined( __APPLE__ ) || defined( __FreeBSD__ )
# define CAST_PTHREAD_TO_INT(t) (unsigned long int)(uintptr_t)(void *)t
#else
# define CAST_PTHREAD_TO_INT(t) (unsigned long int)t
#if defined( PTHREAD_COND_T_IN_PTHREAD_H )
static inline int CAST_PTHREAD_TO_INT (pthread_t th)
{
union { pthread_t th; int i; } v = { .i = 0 };
v.th = th;
return v.i;
}
#endif
static inline int __vlc_mutex_lock( const char * psz_file, int i_line,
......
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