remove unnecessary (char *) casts for ast_config_AST_* variables.
[asterisk/asterisk.git] / utils / extconf.c
index fa31102..c6e8cf6 100644 (file)
  *
  */
 
-#include "asterisk/autoconfig.h"
+#include "asterisk/compat.h"
 
-#include <stdio.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
 #include <errno.h>
 #include <time.h>
 #include <sys/stat.h>
@@ -67,8 +63,6 @@ struct ast_channel
 
 
 #include "asterisk/inline_api.h"
-#include "asterisk/compat.h"
-#include "asterisk/compiler.h"
 #include "asterisk/endian.h"
 #include "asterisk/ast_expr.h"
 #include "asterisk/ael_structs.h"
@@ -1152,7 +1146,7 @@ extern int ast_language_is_prefix;
 
 /* Asterisk REQUIRES recursive (not error checking) mutexes
    and will not run without them. */
-#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
+#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) && defined(PTHREAD_MUTEX_RECURSIVE_NP)
 #define PTHREAD_MUTEX_INIT_VALUE       PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
 #define AST_MUTEX_KIND                 PTHREAD_MUTEX_RECURSIVE_NP
 #else
@@ -1841,8 +1835,6 @@ AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
 #define ast_channel_trylock(x)         ast_mutex_trylock(&x->lock)
 #else
 
-struct ast_channel;
-
 /*! \brief Lock AST channel (and print debugging output)
 \note You need to enable DEBUG_CHANNEL_LOCKS for this function */
 int ast_channel_lock(struct ast_channel *chan);
@@ -3664,7 +3656,7 @@ static struct ast_config *config_text_file_load(const char *database, const char
                if (use_local_dir)
                        snprintf(fn, sizeof(fn), "./%s", filename);
                else
-                       snprintf(fn, sizeof(fn), "%s/%s", (char *)ast_config_AST_CONFIG_DIR, filename);
+                       snprintf(fn, sizeof(fn), "%s/%s", ast_config_AST_CONFIG_DIR, filename);
        }
 
        if (withcomments && cfg && cfg->include_level < 2 ) {