summaryrefslogtreecommitdiff
path: root/extra/ccrtp/libgcrypt160.patch
blob: f8a21dc51cd8d9bf65823861ca32109fd3b1fbfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
--- ccrtp-2.0.6/src/ccrtp/crypto/gcrypt/InitializeGcrypt.cpp~	2013-12-24 09:48:10.679538751 +0000
+++ ccrtp-2.0.6/src/ccrtp/crypto/gcrypt/InitializeGcrypt.cpp	2013-12-24 09:48:29.149404720 +0000
@@ -22,40 +22,6 @@
 #include <errno.h>
 #include <gcrypt.h>
 
-/*
- * The following macro was copied from gcrypt.h and modified to explicitly
- * cast the pointer types to keep the compiler happy.
- */
-#define GCRY_THREAD_OPTION_PTHREAD_CPP_IMPL                                   \
-static int gcry_pthread_mutex_init (void **priv)                              \
-{                                                                             \
-  int err = 0;                                                                \
-  pthread_mutex_t *lock = (pthread_mutex_t *)malloc (sizeof (pthread_mutex_t)); \
-                                                                              \
-  if (!lock)                                                                  \
-    err = ENOMEM;                                                             \
-  if (!err)                                                                   \
-{                                                                         \
-      err = pthread_mutex_init (lock, NULL);                                  \
-      if (err)                                                                \
-        free (lock);                                                          \
-      else                                                                    \
-        *priv = lock;                                                         \
-}                                                                         \
-  return err;                                                                 \
-}                                                                             \
-static int gcry_pthread_mutex_destroy (void **lock)                           \
-{ int err = pthread_mutex_destroy ((pthread_mutex_t *)*lock);  free (*lock); return err; }     \
-static int gcry_pthread_mutex_lock (void **lock)                              \
-{ return pthread_mutex_lock ((pthread_mutex_t *)*lock); }                     \
-static int gcry_pthread_mutex_unlock (void **lock)                            \
-{ return pthread_mutex_unlock ((pthread_mutex_t *)*lock); }                   \
-                                                                              \
-static struct gcry_thread_cbs gcry_threads_pthread =                          \
-{ GCRY_THREAD_OPTION_PTHREAD, NULL,                                           \
-  gcry_pthread_mutex_init, gcry_pthread_mutex_destroy,                        \
-  gcry_pthread_mutex_lock, gcry_pthread_mutex_unlock }
-
 /** Implement the locking callback functions for libgcrypt.
  *
  */
@@ -65,7 +31,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-GCRY_THREAD_OPTION_PTHREAD_CPP_IMPL;
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #ifdef __cplusplus
 }
 #endif