# include <byteorder.h>
#elif defined( PTHREAD_COND_T_IN_PTHREAD_H ) /* pthreads (like Linux & BSD) */
+# define LIBVLC_USE_PTHREAD 1
+
# include <pthread.h>
# ifdef DEBUG
/* Needed for pthread_cond_timedwait */
}
+#ifdef LIBVLC_USE_PTHREAD
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
+# define gcry_threads_vlc gcry_threads_pthread
+#else
/**
* gcrypt thread option VLC implementation
*/
-vlc_object_t *__p_gcry_data;
+
+# define NEED_THREAD_CONTEXT 1
+static vlc_object_t *__p_gcry_data;
static int gcry_vlc_mutex_init( void **p_sys )
{
gcry_vlc_mutex_lock,
gcry_vlc_mutex_unlock
};
+#endif
/*****************************************************************************
if( count.i_int == 0)
{
- const char *psz_version;
-
+#ifdef NEED_THREAD_CONTEXT
__p_gcry_data = VLC_OBJECT( p_this->p_vlc );
+#endif
gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_vlc);
if( gnutls_global_init( ) )
return VLC_EGENERIC;
}
- psz_version = gnutls_check_version( "1.2.9" );
+ const char *psz_version = gnutls_check_version( "1.2.9" );
if( psz_version == NULL )
{
gnutls_global_deinit( );