[asterisk-commits] russell: branch 1.4 r271339 - in /branches/1.4: ./ include/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jun 18 13:44:42 CDT 2010


Author: russell
Date: Fri Jun 18 13:44:38 2010
New Revision: 271339

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=271339
Log:
Fix a build problem on Mac OS X with DEBUG_THREADS enabled.

This set of changes was already in trunk.

Modified:
    branches/1.4/configure
    branches/1.4/configure.ac
    branches/1.4/include/asterisk/autoconfig.h.in
    branches/1.4/include/asterisk/lock.h

Modified: branches/1.4/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/configure.ac?view=diff&rev=271339&r1=271338&r2=271339
==============================================================================
--- branches/1.4/configure.ac (original)
+++ branches/1.4/configure.ac Fri Jun 18 13:44:38 2010
@@ -421,6 +421,20 @@
 if test "${ac_cv_pthread_once_needsbraces}" = "yes"; then
   AC_DEFINE([PTHREAD_ONCE_INIT_NEEDS_BRACES], 1, [Define if your system needs braces around PTHREAD_ONCE_INIT])
 fi
+
+# Can we compare a mutex to its initial value?
+# Generally yes on OpenBSD/FreeBSD and no on Mac OS X.
+AC_MSG_CHECKING(whether we can compare a mutex to its initial value)
+AC_LINK_IFELSE(
+	AC_LANG_PROGRAM([#include <pthread.h>], [pthread_mutex_t lock;
+	if ((lock) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
+		return 0;
+	}
+	return 0]),
+	AC_MSG_RESULT(yes)
+	AC_DEFINE([CAN_COMPARE_MUTEX_TO_INIT_VALUE], 1, [Define to 1 if the implementation of mutexes supports comparison of a mutex to its initializer.]),
+	AC_MSG_RESULT(no)
+)
 
 AC_MSG_CHECKING(for compiler atomic operations)
 AC_LINK_IFELSE(

Modified: branches/1.4/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/include/asterisk/autoconfig.h.in?view=diff&rev=271339&r1=271338&r2=271339
==============================================================================
--- branches/1.4/include/asterisk/autoconfig.h.in (original)
+++ branches/1.4/include/asterisk/autoconfig.h.in Fri Jun 18 13:44:38 2010
@@ -9,6 +9,10 @@
 
 /* Define to 1 if internal poll should be used. */
 #undef AST_POLL_COMPAT
+
+/* Define to 1 if the implementation of mutexes supports comparison of a mutex
+   to its initializer. */
+#undef CAN_COMPARE_MUTEX_TO_INIT_VALUE
 
 /* Define to 1 if the `closedir' function returns void instead of `int'. */
 #undef CLOSEDIR_VOID
@@ -463,7 +467,7 @@
 /* Define to 1 if you have the `strtoq' function. */
 #undef HAVE_STRTOQ
 
-/* Define to 1 if `st_blksize' is member of `struct stat'. */
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
 #undef HAVE_STRUCT_STAT_ST_BLKSIZE
 
 /* Define to 1 if you have the mISDN Supplemental Services library. */
@@ -652,11 +656,11 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
-
-/* Define to 1 if the C compiler supports function prototypes. */
-#undef PROTOTYPES
 
 /* Define to necessary symbol if this constant uses a non-standard name on
    your system. */
@@ -676,11 +680,6 @@
 
 /* Define to the type of arg 5 for `select'. */
 #undef SELECT_TYPE_ARG5
-
-/* Define to 1 if the `setvbuf' function takes the buffering type as its
-   second argument and the buffer pointer as the third, as on System V before
-   release 3. */
-#undef SETVBUF_REVERSED
 
 /* The size of `int', as computed by sizeof. */
 #undef SIZEOF_INT
@@ -702,20 +701,30 @@
 /* Define to 1 if your <sys/time.h> declares `struct tm'. */
 #undef TM_IN_SYS_TIME
 
-/* Define to 1 if on AIX 3.
-   System headers sometimes define this.
-   We just want to avoid a redefinition error message.  */
+/* Enable extensions on AIX 3, Interix.  */
 #ifndef _ALL_SOURCE
 # undef _ALL_SOURCE
 #endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-#undef _FILE_OFFSET_BITS
-
 /* Enable GNU extensions on systems that have them.  */
 #ifndef _GNU_SOURCE
 # undef _GNU_SOURCE
 #endif
+/* Enable threading extensions on Solaris.  */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# undef _POSIX_PTHREAD_SEMANTICS
+#endif
+/* Enable extensions on HP NonStop.  */
+#ifndef _TANDEM_SOURCE
+# undef _TANDEM_SOURCE
+#endif
+/* Enable general extensions on Solaris.  */
+#ifndef __EXTENSIONS__
+# undef __EXTENSIONS__
+#endif
+
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
 
 /* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
 #undef _LARGEFILE_SOURCE
@@ -732,20 +741,6 @@
 
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 #undef _POSIX_SOURCE
-
-/* Enable extensions on Solaris.  */
-#ifndef __EXTENSIONS__
-# undef __EXTENSIONS__
-#endif
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# undef _POSIX_PTHREAD_SEMANTICS
-#endif
-#ifndef _TANDEM_SOURCE
-# undef _TANDEM_SOURCE
-#endif
-
-/* Define like PROTOTYPES; this can be used by system headers. */
-#undef __PROTOTYPES
 
 /* Define to empty if `const' does not conform to ANSI C. */
 #undef const

Modified: branches/1.4/include/asterisk/lock.h
URL: http://svnview.digium.com/svn/asterisk/branches/1.4/include/asterisk/lock.h?view=diff&rev=271339&r1=271338&r2=271339
==============================================================================
--- branches/1.4/include/asterisk/lock.h (original)
+++ branches/1.4/include/asterisk/lock.h Fri Jun 18 13:44:38 2010
@@ -260,7 +260,7 @@
 	int res;
 	pthread_mutexattr_t  attr;
 
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 
 	if ((t->mutex) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
 /*
@@ -296,7 +296,7 @@
 	int res;
 	int canlog = strcmp(filename, "logger.c") & t->track;
 
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
 		/* Don't try to uninitialize non initialized mutex
 		 * This may no effect on linux
@@ -354,7 +354,7 @@
 	int res;
 	int canlog = strcmp(filename, "logger.c") & t->track;
 
-#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS)
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
 		/* Don't warn abount uninitialized mutex.
 		 * Simple try to initialize it.
@@ -442,7 +442,7 @@
 	int res;
 	int canlog = strcmp(filename, "logger.c") & t->track;
 
-#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS)
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
 		/* Don't warn abount uninitialized mutex.
 		 * Simple try to initialize it.
@@ -488,7 +488,7 @@
 	int res;
 	int canlog = strcmp(filename, "logger.c") & t->track;
 
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
 		__ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
 				   filename, lineno, func, mutex_name);
@@ -567,7 +567,7 @@
 	int res;
 	int canlog = strcmp(filename, "logger.c") & t->track;
 
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
 		__ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
 				   filename, lineno, func, mutex_name);
@@ -638,7 +638,7 @@
 	int res;
 	int canlog = strcmp(filename, "logger.c") & t->track;
 
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
 		__ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
 				   filename, lineno, func, mutex_name);
@@ -862,7 +862,7 @@
 {
 	int res;
 	pthread_rwlockattr_t attr;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
         int canlog = strcmp(filename, "logger.c");
 
         if (*prwlock != ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -889,7 +889,7 @@
 	int res;
 	int canlog = strcmp(filename, "logger.c");
 
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	if (*prwlock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
 		__ast_mutex_logger("%s line %d (%s): Warning: rwlock '%s' is uninitialized.\n",
 				   filename, lineno, func, rwlock_name);
@@ -911,7 +911,7 @@
 	const char *file, int line, const char *func)
 {
 	int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	int canlog = strcmp(file, "logger.c");
 
 	if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -938,7 +938,7 @@
 	const char *file, int line, const char *func)
 {
 	int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	int canlog = strcmp(file, "logger.c");
 	
 	if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -971,7 +971,7 @@
 	const char *file, int line, const char *func)
 {
 	int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	int canlog = strcmp(file, "logger.c");
 	
 	if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -1004,7 +1004,7 @@
 	const struct timespec *abs_timeout, const char *file, int line, const char *func)
 {
 	int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	int canlog = strcmp(file, "logger.c");
 	
 	if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -1053,7 +1053,7 @@
 	const struct timespec *abs_timeout, const char *file, int line, const char *func)
 {
 	int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	int canlog = strcmp(file, "logger.c");
 	
 	if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -1102,7 +1102,7 @@
 	const char *file, int line, const char *func)
 {
 	int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	int canlog = strcmp(file, "logger.c");
 	
 	if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {
@@ -1135,7 +1135,7 @@
 	const char *file, int line, const char *func)
 {
 	int res;
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
+#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) && defined(CAN_COMPARE_MUTEX_TO_INIT_VALUE)
 	int canlog = strcmp(file, "logger.c");
 	
 	if (*lock == ((ast_rwlock_t) AST_RWLOCK_INIT_VALUE)) {




More information about the asterisk-commits mailing list