From a0a86e975a651f0f890225650306c630fe310660 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Thu, 8 Dec 2005 14:04:40 +0000 Subject: Add hidden_weak_alias/hidden_strong_alias, remove gettimeofday hack and add comment about opendir/closedir undoable, it is too early in this file. i386/x86_64 could use optimized internal_function, but the commented part has to be done based on target, not host --- include/libc-internal.h | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'include') diff --git a/include/libc-internal.h b/include/libc-internal.h index feb27b812..47eb97439 100644 --- a/include/libc-internal.h +++ b/include/libc-internal.h @@ -66,6 +66,9 @@ /* 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. */ +#if 0 /*def __i386__*/ +# define internal_function __attribute__ ((regparm (3), stdcall)) +#endif #ifndef internal_function # define internal_function /* empty */ #endif @@ -98,6 +101,14 @@ # define attribute_hidden #endif #define hidden_def(name) extern __typeof (name) name attribute_hidden; +/* Define ALIASNAME as a hidden weak alias for NAME. */ +# define hidden_weak_alias(name, aliasname) _hidden_weak_alias (name, aliasname) +# define _hidden_weak_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((weak, alias (#name))) __attribute__ ((visibility ("hidden"))); +/* Define ALIASNAME as a hidden strong alias for NAME. */ +# define hidden_strong_alias(name, aliasname) _hidden_strong_alias(name, aliasname) +# define _hidden_strong_alias(name, aliasname) \ + extern __typeof (name) aliasname __attribute__ ((alias (#name))) __attribute__ ((visibility ("hidden"))); #ifdef __UCLIBC_BUILD_RELRO__ # define attribute_relro __attribute__ ((section (".data.rel.ro"))) @@ -142,9 +153,6 @@ typedef __ssize_t ssize_t; # include -/* sources are built w/ _GNU_SOURCE, this gets undefined */ -extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen); - /* prototypes for internal use, please keep these in sync w/ updated headers */ /* #include */ extern int __open(__const char *__file, int __oflag, ...) attribute_hidden; @@ -167,6 +175,9 @@ extern char *__strdup (__const char *__s) attribute_hidden; extern int __strcasecmp (__const char *__s1, __const char *__s2) attribute_hidden; extern int __strncasecmp (__const char *__s1, __const char *__s2, size_t __n) attribute_hidden; +/* sources are built w/ _GNU_SOURCE, this gets undefined */ +extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen); + /* #include */ extern ssize_t __read(int __fd, void *__buf, size_t __nbytes) attribute_hidden; extern ssize_t __write(int __fd, __const void *__buf, size_t __n) attribute_hidden; @@ -183,13 +194,19 @@ extern char *__getenv (__const char *__name) attribute_hidden; extern int __sigprocmask (int __how, __const __sigset_t *__restrict __set, __sigset_t *__restrict __oset) attribute_hidden; -/* #include */ +/* #include */ +extern int __ioctl (int __fd, unsigned long int __request, ...) attribute_hidden; + # if 0 /* undoable here */ +/* #include */ +typedef struct __dirstream DIR; +extern DIR *__opendir (__const char *__name) attribute_hidden; +extern int __closedir (DIR *__dirp) attribute_hidden; + +/* #include */ # define __need_timeval # include extern int __gettimeofday(struct timeval *__restrict __tv, *__restrict __timezone__ptr_t __tz) attribute_hidden; -# else -# define gettimeofday __gettimeofday # endif /* #include */ -- cgit v1.2.3