aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-03 00:52:05 +0000
committerkpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b>2008-11-03 00:52:05 +0000
commitdd99ea8e6203f1af361ed20e10680ccdc87d1920 (patch)
tree6f934a51635fc46632de5c4240863b7aac364cfa /include
parentd3d057390c26ce35b54750705377c4d3ff4e42bd (diff)
Merge revision 153709 from trunk
------------------------------------------------------------------------ r153709 | kpfleming | 2008-11-02 17:34:39 -0600 (Sun, 02 Nov 2008) | 3 lines instead of trying to forcibly load res_agi when app_stack is loaded (even if the administrator didn't want it loaded), use GCC weak symbols to determine whether it was loaded already or not; if it was loaded, then use it. ------------------------------------------------------------------------ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@153745 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/agi.h16
-rw-r--r--include/asterisk/autoconfig.h.in3
-rw-r--r--include/asterisk/compiler.h6
3 files changed, 20 insertions, 5 deletions
diff --git a/include/asterisk/agi.h b/include/asterisk/agi.h
index 7c1a0aa68..609e98815 100644
--- a/include/asterisk/agi.h
+++ b/include/asterisk/agi.h
@@ -55,11 +55,17 @@ typedef struct agi_command {
AST_LIST_ENTRY(agi_command) list;
} agi_command;
-int ast_agi_fdprintf(struct ast_channel *chan, int fd, char *fmt, ...);
-int ast_agi_register(struct ast_module *mod, agi_command *cmd);
-int ast_agi_unregister(struct ast_module *mod, agi_command *cmd);
-void ast_agi_register_multiple(struct ast_module *mod, agi_command *cmd, int len);
-void ast_agi_unregister_multiple(struct ast_module *mod, agi_command *cmd, int len);
+#if defined(ASTERISK_AGI_OPTIONAL)
+#define AGI_WEAK attribute_weak
+#else
+#define AGI_WEAK
+#endif
+
+int AGI_WEAK ast_agi_fdprintf(struct ast_channel *chan, int fd, char *fmt, ...);
+int AGI_WEAK ast_agi_register(struct ast_module *mod, agi_command *cmd);
+int AGI_WEAK ast_agi_unregister(struct ast_module *mod, agi_command *cmd);
+void AGI_WEAK ast_agi_register_multiple(struct ast_module *mod, agi_command *cmd, int len);
+void AGI_WEAK ast_agi_unregister_multiple(struct ast_module *mod, agi_command *cmd, int len);
#if defined(__cplusplus) || defined(c_plusplus)
}
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index 75dd7ba6d..60f497d62 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -110,6 +110,9 @@
/* Define to 1 if your GCC C compiler supports the 'unused' attribute. */
#undef HAVE_ATTRIBUTE_unused
+/* Define to 1 if your GCC C compiler supports the 'weak' attribute. */
+#undef HAVE_ATTRIBUTE_weak
+
/* Define this to indicate the ${BKTR_DESCRIP} library */
#undef HAVE_BKTR
diff --git a/include/asterisk/compiler.h b/include/asterisk/compiler.h
index bc0476527..0fe1b6d0c 100644
--- a/include/asterisk/compiler.h
+++ b/include/asterisk/compiler.h
@@ -53,4 +53,10 @@
#define attribute_malloc
#endif
+#ifdef HAVE_ATTRIBUTE_weak
+#define attribute_weak __attribute__((weak))
+#else
+#define attribute_weak
+#endif
+
#endif /* _ASTERISK_COMPILER_H */