#include "asterisk/http.h"
#include "asterisk/lock.h"
-#ifdef DLFCNCOMPAT
+#ifdefdef DLFCNCOMPAT
#include "asterisk/dlfcn-compat.h"
#else
#include <dlfcn.h>
#include "asterisk/md5.h"
#include "asterisk/utils.h"
-#ifndef RTLD_NOW
+#ifdefndef RTLD_NOW
#define RTLD_NOW 0
#endif
return cur;
}
-#if LOADABLE_MODULES
+#ifdef LOADABLE_MODULES
static void unload_dynamic_module(struct ast_module *mod)
{
void *lib = mod->lib;
on the already-opened library to what we want... if not, we have to
close it and start over
*/
-#if defined(HAVE_RTLD_NOLOAD) && !defined(__Darwin__)
+#ifdef defined(HAVE_RTLD_NOLOAD) && !defined(__Darwin__)
if (!dlopen(fn, RTLD_NOLOAD | (wants_global ? RTLD_LAZY | RTLD_GLOBAL : RTLD_NOW | RTLD_LOCAL))) {
ast_log(LOG_WARNING, "Unable to promote flags on module '%s': %s\n", resource_in, dlerror());
while (!dlclose(lib));
if (!error && !mod->lib)
mod->info->restore_globals();
-#if LOADABLE_MODULES
+#ifdef LOADABLE_MODULES
if (!error)
unload_dynamic_module(mod);
#endif
if (global_symbols_only && !ast_test_flag(mod->info, AST_MODFLAG_GLOBAL_SYMBOLS))
return AST_MODULE_LOAD_SKIP;
} else {
-#if LOADABLE_MODULES
+#ifdef LOADABLE_MODULES
if (!(mod = load_dynamic_module(resource_name, global_symbols_only))) {
/* don't generate a warning message during load_modules() */
if (!global_symbols_only) {
if (inspect_module(mod)) {
ast_log(LOG_WARNING, "Module '%s' could not be loaded.\n", resource_name);
-#if LOADABLE_MODULES
+#ifdef LOADABLE_MODULES
unload_dynamic_module(mod);
#endif
return AST_MODULE_LOAD_DECLINE;
struct load_order load_order;
int res = 0;
struct ast_flags config_flags = { 0 };
-#if LOADABLE_MODULES
+#ifdef LOADABLE_MODULES
struct dirent *dirent;
DIR *dir;
#endif
order = add_to_load_order(mod->resource, &load_order);
}
-#if LOADABLE_MODULES
+#ifdef LOADABLE_MODULES
/* if we are allowed to load dynamic modules, scan the directory for
for all available modules and add them as well */
if ((dir = opendir(ast_config_AST_MODULE_DIR))) {