Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
07c9677d
Commit
07c9677d
authored
Jun 15, 2015
by
Thomas Guillem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gcrypt: require libgcrypt >= 1.6.0
And remove setup thread callbacks init since it's not supported anymore.
parent
1a2f7b20
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
74 deletions
+19
-74
configure.ac
configure.ac
+15
-14
include/vlc_gcrypt.h
include/vlc_gcrypt.h
+4
-60
No files found.
configure.ac
View file @
07c9677d
...
...
@@ -3966,22 +3966,23 @@ dnl libgcrypt
dnl
AC_ARG_ENABLE(libgcrypt,
[ --disable-libgcrypt gcrypt support (default enabled)])
# require libgcrypt >= 1.6.0
AS_IF([test "${enable_libgcrypt}" != "no"], [
AC_CHECK_DECL([GCRYCTL_SET_THREAD_CBS], [
libgcrypt-config --version >/dev/null || \
AC_MSG_ERROR([gcrypt.h present but libgcrypt-config could not be found])
AC_CHECK_LIB(gcrypt, gcry_control, [
AC_TRY_COMPILE([
#include <gcrypt.h>
#if GCRYPT_VERSION_NUMBER < 0x010600
#error
#endif],
[], [
have_libgcrypt="yes"
AC_DEFINE([HAVE_GCRYPT], 1, [Defined if having gcrypt])
GCRYPT_CFLAGS="`libgcrypt-config --cflags`"
GCRYPT_LIBS="`libgcrypt-config --libs`"
], [
AC_MSG_ERROR([libgcrypt not found. Install libgcrypt or pass --disable-libgcrypt.])
], [`libgcrypt-config --libs`])
], [
AC_MSG_ERROR([libgcrypt version 1.1.94 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
], [#include <gcrypt.h>]
)
AS_IF([test "${enable_libgcrypt}" == "yes"], [
AC_MSG_ERROR([libgcrypt version 1.6.0 or higher not found. Install libgcrypt or pass --disable-libgcrypt.])
])
])
])
AC_SUBST(GCRYPT_CFLAGS)
...
...
include/vlc_gcrypt.h
View file @
07c9677d
...
...
@@ -25,65 +25,6 @@
#include <errno.h>
#ifdef LIBVLC_USE_PTHREAD
/**
* If possible, use gcrypt-provided thread implementation. This is so that
* other non-VLC components (inside the process) can also use gcrypt safely.
*/
GCRY_THREAD_OPTION_PTHREAD_IMPL
;
# define gcry_threads_vlc gcry_threads_pthread
#else
/**
* gcrypt thread option VLC implementation
*/
static
int
gcry_vlc_mutex_init
(
void
**
p_sys
)
{
vlc_mutex_t
*
p_lock
=
(
vlc_mutex_t
*
)
malloc
(
sizeof
(
vlc_mutex_t
)
);
if
(
p_lock
==
NULL
)
return
ENOMEM
;
vlc_mutex_init
(
p_lock
);
*
p_sys
=
p_lock
;
return
VLC_SUCCESS
;
}
static
int
gcry_vlc_mutex_destroy
(
void
**
p_sys
)
{
vlc_mutex_t
*
p_lock
=
(
vlc_mutex_t
*
)
*
p_sys
;
vlc_mutex_destroy
(
p_lock
);
free
(
p_lock
);
return
VLC_SUCCESS
;
}
static
int
gcry_vlc_mutex_lock
(
void
**
p_sys
)
{
vlc_mutex_lock
(
(
vlc_mutex_t
*
)
*
p_sys
);
return
VLC_SUCCESS
;
}
static
int
gcry_vlc_mutex_unlock
(
void
**
lock
)
{
vlc_mutex_unlock
(
(
vlc_mutex_t
*
)
*
lock
);
return
VLC_SUCCESS
;
}
static
const
struct
gcry_thread_cbs
gcry_threads_vlc
=
{
GCRY_THREAD_OPTION_USER
,
NULL
,
gcry_vlc_mutex_init
,
gcry_vlc_mutex_destroy
,
gcry_vlc_mutex_lock
,
gcry_vlc_mutex_unlock
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
,
NULL
};
#endif
/**
* Initializes gcrypt with proper locking.
*/
static
inline
void
vlc_gcrypt_init
(
void
)
{
/* This would need a process-wide static mutex with all libraries linking
...
...
@@ -96,7 +37,10 @@ static inline void vlc_gcrypt_init (void)
vlc_global_lock
(
VLC_GCRYPT_MUTEX
);
if
(
!
done
)
{
gcry_control
(
GCRYCTL_SET_THREAD_CBS
,
&
gcry_threads_vlc
);
/* The suggested way for an application to make sure that global_init
* has been called is by using gcry_check_version. (see global_init
* comments in gcrypt sources) */
gcry_check_version
(
NULL
);
done
=
true
;
}
vlc_global_unlock
(
VLC_GCRYPT_MUTEX
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment