[git commit future 1/1] libc-symbols.h: fix weak functions handling

Khem Raj raj.khem at gmail.com
Sat Mar 19 18:51:25 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=79a16397e2ee3f9df54d5e2bdb01bbe5d723ff30
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future

Move weak_function and weak_const_function under HAVE_WEAK_SYMBOLS guard
and provide fallbacks.

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 include/libc-symbols.h |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index db91a38..da9445f 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -196,12 +196,12 @@
 # define _strong_alias_untyped(name, aliasname) \
   extern __typeof (aliasname) aliasname __attribute__ ((alias (#name)));
 
+# ifdef HAVE_WEAK_SYMBOLS
+
 /* This comes between the return type and function name in
    a function definition to make that definition weak.  */
-# define weak_function __attribute__ ((weak))
-# define weak_const_function __attribute__ ((weak, __const__))
-
-# ifdef HAVE_WEAK_SYMBOLS
+#  define weak_function __attribute__ ((weak))
+#  define weak_const_function __attribute__ ((weak, __const__))
 
 /* Define ALIASNAME as a weak alias for NAME.
    If weak aliases are not available, this defines a strong alias.  */
@@ -215,6 +215,9 @@
 
 # else
 
+#  define weak_function /* empty */
+#  define weak_const_function __attribute__ ((__const__))
+
 #  define weak_alias(name, aliasname) strong_alias(name, aliasname)
 #  define weak_extern(symbol) /* Nothing. */
 
-- 
1.7.3.4



More information about the uClibc-cvs mailing list