siproxd: use PKG_HASH and update copyright date
[feed/telephony.git] / net / asterisk-13.x / patches / 004-ifdef-missing-execinfo.patch
1 --- a/include/asterisk/lock.h
2 +++ b/include/asterisk/lock.h
3 @@ -51,9 +51,11 @@
4 #include <pthread.h>
5 #include <time.h>
6 #include <sys/param.h>
7 +#ifndef __UCLIBC__
8 #ifdef HAVE_BKTR
9 #include <execinfo.h>
10 #endif
11 +#endif
12
13 #ifndef HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK
14 #include "asterisk/time.h"
15 @@ -86,11 +88,15 @@
16 #define __AST_RWLOCK_INIT_VALUE {0}
17 #endif /* HAVE_PTHREAD_RWLOCK_INITIALIZER */
18
19 +#ifndef __UCLIBC__
20 #ifdef HAVE_BKTR
21 #define AST_LOCK_TRACK_INIT_VALUE { { NULL }, { 0 }, 0, { NULL }, { 0 }, {{{ 0 }}}, PTHREAD_MUTEX_INIT_VALUE }
22 #else
23 #define AST_LOCK_TRACK_INIT_VALUE { { NULL }, { 0 }, 0, { NULL }, { 0 }, PTHREAD_MUTEX_INIT_VALUE }
24 #endif
25 +#else
26 +#define AST_LOCK_TRACK_INIT_VALUE { { NULL }, { 0 }, 0, { NULL }, { 0 }, PTHREAD_MUTEX_INIT_VALUE }
27 +#endif
28
29 #define AST_MUTEX_INIT_VALUE { PTHREAD_MUTEX_INIT_VALUE, NULL, 1 }
30 #define AST_MUTEX_INIT_VALUE_NOTRACKING { PTHREAD_MUTEX_INIT_VALUE, NULL, 0 }
31 @@ -114,9 +120,11 @@ struct ast_lock_track {
32 int reentrancy;
33 const char *func[AST_MAX_REENTRANCY];
34 pthread_t thread[AST_MAX_REENTRANCY];
35 +#ifndef __UCLIBC__
36 #ifdef HAVE_BKTR
37 struct ast_bt backtrace[AST_MAX_REENTRANCY];
38 #endif
39 +#endif
40 pthread_mutex_t reentr_mutex;
41 };
42
43 @@ -241,6 +249,7 @@ enum ast_lock_type {
44 * on the lock. ast_mark_lock_acquired() will mark it as held by this thread.
45 */
46 #if !defined(LOW_MEMORY)
47 +#ifndef HAVE_BKTR
48 #ifdef HAVE_BKTR
49 void ast_store_lock_info(enum ast_lock_type type, const char *filename,
50 int line_num, const char *func, const char *lock_name, void *lock_addr, struct ast_bt *bt);
51 @@ -248,14 +257,22 @@ void ast_store_lock_info(enum ast_lock_t
52 void ast_store_lock_info(enum ast_lock_type type, const char *filename,
53 int line_num, const char *func, const char *lock_name, void *lock_addr);
54 #endif /* HAVE_BKTR */
55 +#else
56 +void ast_store_lock_info(enum ast_lock_type type, const char *filename,
57 + int line_num, const char *func, const char *lock_name, void *lock_addr);
58 +#endif
59
60 #else
61
62 +#ifndef __UCLIBC__
63 #ifdef HAVE_BKTR
64 #define ast_store_lock_info(I,DONT,CARE,ABOUT,THE,PARAMETERS,BUD)
65 #else
66 #define ast_store_lock_info(I,DONT,CARE,ABOUT,THE,PARAMETERS)
67 #endif /* HAVE_BKTR */
68 +#else
69 +#define ast_store_lock_info(I,DONT,CARE,ABOUT,THE,PARAMETERS)
70 +#endif
71 #endif /* !defined(LOW_MEMORY) */
72
73 /*!
74 @@ -283,19 +300,27 @@ void ast_mark_lock_failed(void *lock_add
75 * be removed from the current thread's lock info struct.
76 */
77 #if !defined(LOW_MEMORY)
78 +#ifndef __UCLIBC__
79 #ifdef HAVE_BKTR
80 void ast_remove_lock_info(void *lock_addr, struct ast_bt *bt);
81 #else
82 void ast_remove_lock_info(void *lock_addr);
83 #endif /* HAVE_BKTR */
84 +#else
85 +void ast_remove_lock_info(void *lock_addr);
86 +#endif
87 void ast_suspend_lock_info(void *lock_addr);
88 void ast_restore_lock_info(void *lock_addr);
89 #else
90 +#ifndef __UCLIBC
91 #ifdef HAVE_BKTR
92 #define ast_remove_lock_info(ignore,me)
93 #else
94 #define ast_remove_lock_info(ignore)
95 #endif /* HAVE_BKTR */
96 +#else
97 +#define ast_remove_lock_info(ignore)
98 +#endif
99 #define ast_suspend_lock_info(ignore);
100 #define ast_restore_lock_info(ignore);
101 #endif /* !defined(LOW_MEMORY) */