summaryrefslogtreecommitdiff
path: root/include/libc-symbols.h
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-03-24 12:18:40 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:32 +0200
commitd2e776750d04e1855fc550c6cefe4031bb9ee6e8 (patch)
treead7bcbf4c27d840cc1511d067c15bd0b6c050ff4 /include/libc-symbols.h
parentc5cb40e9fc0b6e17e94c716d75c495e98e593a79 (diff)
libc-symbols.h: fix weak functions handling
Move weak_function and weak_const_function under HAVE_WEAK_SYMBOLS guard and provide fallbacks. Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'include/libc-symbols.h')
-rw-r--r--include/libc-symbols.h11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index db91a38a1..da9445f87 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. */