summaryrefslogtreecommitdiff
path: root/include/features.h
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2002-02-13 09:47:04 +0000
committerEric Andersen <andersen@codepoet.org>2002-02-13 09:47:04 +0000
commit3ab0557e5a3a81b5202334142326dd2e5edc5d28 (patch)
treefbc4cb8ae1dd73c49fdf4f898d0fb329e8551164 /include/features.h
parent80e6061ac5deca193759b979d34906bfc9b857ef (diff)
A number of naming updates in preparation for adding in
proper threading. Most of this is from Stefan Soucek, with additions and changes as needed from me.
Diffstat (limited to 'include/features.h')
-rw-r--r--include/features.h45
1 files changed, 41 insertions, 4 deletions
diff --git a/include/features.h b/include/features.h
index 54f839662..22795e0b3 100644
--- a/include/features.h
+++ b/include/features.h
@@ -322,6 +322,10 @@
# include <gnu/stubs.h>
#endif
+/* No C++ */
+#define __BEGIN_DECLS
+#define __END_DECLS
+
/* Load up the current set of uClibc supported features */
#define __need_uClibc_config_h
#include <bits/uClibc_config.h>
@@ -329,22 +333,55 @@
/* Some nice features only work properly with ELF */
#if defined _LIBC && defined HAVE_ELF
-# define link_warning(symbol, msg) \
+# define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+# define link_warning(symbol, msg) \
asm (".section " ".gnu.warning." #symbol "\n\t.previous"); \
static const char __evoke_link_warning_##symbol[] \
__attribute__ ((section (".gnu.warning." #symbol "\n\t#"))) = msg;
-# define weak_alias(name, aliasname) \
+# define _weak_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
+/*
+# define _weak_alias(name, aliasname) \
asm(".global " C_SYMBOL_PREFIX #name ";" \
".weak " C_SYMBOL_PREFIX #aliasname ";" \
C_SYMBOL_PREFIX #aliasname "=" C_SYMBOL_PREFIX #name ";");
+*/
# define weak_symbol(name) \
asm(".weak " C_SYMBOL_PREFIX #name ";");
#else
-# define link_warning(symbol, msg) \
+# define weak_alias(name, aliasname) _weak_alias (name, aliasname)
+# define link_warning(symbol, msg) \
asm (".stabs \"" msg "\",30,0,0,0\n\t" \
".stabs \"" #symbol "\",1,0,0,0\n");
-# define weak_alias(name, aliasname) \
+# define _weak_alias(name, aliasname) \
__asm__(".global _" #aliasname "\n.set _" #aliasname ",_" #name);
#endif
+/* --- this is added to integrate linuxthreads */
+
+#define __USE_UNIX98 1
+
+
+#ifndef weak_function
+/* If we do not have the __attribute__ ((weak)) syntax, there is no way we
+ can define functions as weak symbols. The compiler will emit a `.globl'
+ directive for the function symbol, and a `.weak' directive in addition
+ will produce an error from the assembler. */
+# define weak_function /* empty */
+# define weak_const_function /* empty */
+#endif
+
+/* On some platforms we can make internal function calls (i.e., calls of
+ functions not exported) a bit faster by using a different calling
+ convention. */
+#ifndef internal_function
+# define internal_function /* empty */
+#endif
+
+/* Prepare for the case that `__builtin_expect' is not available. */
+#ifndef HAVE_BUILTIN_EXPECT
+# define __builtin_expect(expr, val) (expr)
+#endif
+
+
#endif /* features.h */