[asterisk-commits] kpfleming: branch kpfleming/new_optional_api r197364 - /team/kpfleming/new_op...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Wed May 27 18:23:20 CDT 2009
Author: kpfleming
Date: Wed May 27 18:23:16 2009
New Revision: 197364
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=197364
Log:
Correct documentation on how this stuff works, and make weak_import symbols
public.
Modified:
team/kpfleming/new_optional_api/include/asterisk/optional_api.h
Modified: team/kpfleming/new_optional_api/include/asterisk/optional_api.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/kpfleming/new_optional_api/include/asterisk/optional_api.h?view=diff&rev=197364&r1=197363&r2=197364
==============================================================================
--- team/kpfleming/new_optional_api/include/asterisk/optional_api.h (original)
+++ team/kpfleming/new_optional_api/include/asterisk/optional_api.h Wed May 27 18:23:16 2009
@@ -32,14 +32,14 @@
*
* To accomodate this situation, the AST_OPTIONAL_API macro allows an API
* function to be declared in a special way, if Asterisk being built on a
- * platform that supports the GCC 'weak' and 'alias' attributes. If so,
- * the API function is actually a weak symbol, which means if the provider
- * of the API is not loaded, the symbol can still be referenced (unlike a
+ * platform that supports special compiler and dynamic linker attributes.
+ * If so the API function will actually be a weak symbol, which means if the
+ * provider of the API is not loaded, the symbol can still be referenced (unlike a
* strong symbol, which would cause an immediate fault if not defined when
* referenced), but it will return NULL signifying the linker/loader was
* not able to resolve the symbol. In addition, the macro defines a hidden
* 'stub' version of the API call, using a provided function body, and uses
- * the alias attribute to make the API function symbol actually resolve to
+ * various methods to make the API function symbol actually resolve to
* that hidden stub, but only when the *real* provider of the symbol has
* not been found.
*
@@ -133,13 +133,13 @@
#define AST_OPTIONAL_API(result, name, proto, stub) \
static result __stub__##name proto stub; \
- static __attribute__((weak_import)) typeof(__stub__##name) __##name; \
+ __attribute__((weak_import)) typeof(__stub__##name) __##name; \
static attribute_unused typeof(__stub__##name) * name; \
static void __attribute__((constructor)) __init__##name(void) { name = __##name ? : __stub__##name; }
#define AST_OPTIONAL_API_ATTR(result, attr, name, proto, stub) \
static __attribute__((attr)) result __stub__##name proto stub; \
- static __attribute__((attr, weak_import)) typeof(__stub__##name) __##name; \
+ __attribute__((attr, weak_import)) typeof(__stub__##name) __##name; \
static attribute_unused __attribute__((attr)) typeof(__stub__##name) * name; \
static void __attribute__((constructor)) __init__##name(void) { name = __##name ? : __stub__##name; }
More information about the asterisk-commits
mailing list