123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183 |
- #ifndef _LIBC_INTERNAL_H
- #define _LIBC_INTERNAL_H 1
- #if defined __HAVE_ELF__
- # define weak_alias(name, aliasname) _weak_alias (name, aliasname)
- # define _weak_alias(name, aliasname) \
- extern __typeof (name) aliasname __attribute__ ((weak, alias (#name)));
- # define strong_alias(name, aliasname) _strong_alias(name, aliasname)
- # define _strong_alias(name, aliasname) \
- extern __typeof (name) aliasname __attribute__ ((alias (#name)));
- # define weak_function __attribute__ ((weak))
- # define weak_const_function __attribute__ ((weak, __const__))
- # if defined(__cris__)
- # define link_warning(symbol, msg)
- # else
- # define link_warning(symbol, msg) \
- asm (".section " ".gnu.warning." #symbol "\n\t.previous"); \
- static const char __evoke_link_warning_##symbol[] \
- __attribute__ ((unused, section (".gnu.warning." #symbol "\n\t#"))) = msg;
- #endif
- #else
- # define strong_alias(name, aliasname) _strong_alias (name, aliasname)
- # define weak_alias(name, aliasname) _strong_alias (name, aliasname)
- # define _strong_alias(name, aliasname) \
- __asm__(".global " __C_SYMBOL_PREFIX__ #aliasname "\n" \
- ".set " __C_SYMBOL_PREFIX__ #aliasname "," __C_SYMBOL_PREFIX__ #name);
- # define link_warning(symbol, msg) \
- asm (".stabs \"" msg "\",30,0,0,0\n\t" \
- ".stabs \"" #symbol "\",1,0,0,0\n");
- #endif
- #ifndef weak_function
-
- # define weak_function
- # define weak_const_function
- #endif
- #ifndef internal_function
- # define internal_function
- #endif
- #ifndef NOT_IN_libc
- # define IS_IN_libc 1
- #endif
- #if __GNUC__ == 2 && __GNUC_MINOR__ < 96
- # define __builtin_expect(x, expected_value) (x)
- #endif
- #ifndef likely
- # define likely(x) __builtin_expect((!!(x)),1)
- #endif
- #ifndef unlikely
- # define unlikely(x) __builtin_expect((!!(x)),0)
- #endif
- #ifndef __LINUX_COMPILER_H
- # define __LINUX_COMPILER_H
- #endif
- #ifndef __cast__
- # define __cast__(_to)
- #endif
- #if __GNUC_PREREQ (3, 3)
- # define attribute_hidden __attribute__ ((visibility ("hidden")))
- #else
- # define attribute_hidden
- #endif
- #ifdef __UCLIBC_BUILD_RELRO__
- # define attribute_relro __attribute__ ((section (".data.rel.ro")))
- #else
- # define attribute_relro
- #endif
- #ifdef __GNUC__
- # define attribute_noreturn __attribute__ ((__noreturn__))
- #else
- # define attribute_noreturn
- #endif
- #include <sys/cdefs.h>
- #define __USE_UNIX98 1
- #ifndef __ASSEMBLER__
- # ifdef IS_IN_libc
- # include <bits/types.h>
- # ifndef __ssize_t_defined
- typedef __ssize_t ssize_t;
- # define __ssize_t_defined
- # endif
- # define __need_size_t
- # include <stddef.h>
- # include <bits/sigset.h>
- extern int __open(__const char *__file, int __oflag, ...) attribute_hidden;
- extern int __memcmp (__const void *__s1, __const void *__s2, size_t __n) attribute_hidden;
- extern void *__memcpy (void *__restrict __dest,
- __const void *__restrict __src, size_t __n) attribute_hidden;
- extern void *__memmove (void *__dest, __const void *__src, size_t __n) attribute_hidden;
- extern void *__memset (void *__s, int __c, size_t __n) attribute_hidden;
- extern char *__strcpy (char *__restrict __dest, __const char *__restrict __src) attribute_hidden;
- extern size_t __strlen (__const char *__s) attribute_hidden;
- extern int __strcmp (__const char *__s1, __const char *__s2) attribute_hidden;
- extern char *__strcat (char *__restrict __dest, __const char *__restrict __src) attribute_hidden;
- extern char *__strncpy (char *__restrict __dest,
- __const char *__restrict __src, size_t __n) attribute_hidden;
- extern char *__strchr (__const char *__s, int __c) attribute_hidden;
- extern int __strncmp (__const char *__s1, __const char *__s2, size_t __n) attribute_hidden;
- extern char *__strdup (__const char *__s) attribute_hidden;
- 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;
- extern int __close(int __fd) attribute_hidden;
- extern int __sigprocmask (int __how, __const __sigset_t *__restrict __set,
- __sigset_t *__restrict __oset) attribute_hidden;
- # if 0
- # define __need_timeval
- # include <bits/time.h>
- extern int __gettimeofday(struct timeval *__restrict __tv, *__restrict __timezone__ptr_t __tz) attribute_hidden;
- # else
- # define gettimeofday __gettimeofday
- # endif
- # elif IS_IN_libpthread
- # define gettimeofday __libc_gettimeofday
- # else
- # define open __libc_open
- # endif
- #endif
- #endif
|