From 54682a538ac88eb23e337730e897dad8a3f467ea Mon Sep 17 00:00:00 2001 From: George Joseph Date: Fri, 2 May 2025 12:19:25 -0600 Subject: [PATCH] lock.h: Add include for string.h when DEBUG_THREADS is defined. When DEBUG_THREADS is defined, lock.h uses strerror(), which is defined in the libc string.h file, to print warning messages. If the including source file doesn't include string.h then strerror() won't be found and and compile errors will be thrown. Since lock.h depends on this, string.h is now included from there if DEBUG_THREADS is defined. This way, including source files don't have to worry about it. --- include/asterisk/lock.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h index d959c1a11e..dcb8c20ff1 100644 --- a/include/asterisk/lock.h +++ b/include/asterisk/lock.h @@ -54,6 +54,9 @@ #ifdef HAVE_BKTR #include #endif +#ifdef DEBUG_THREADS +#include +#endif #ifndef HAVE_PTHREAD_RWLOCK_TIMEDWRLOCK #include "asterisk/time.h" -- 2.47.2