123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- #ifndef _LIBC_INTERNAL_H
- #define _LIBC_INTERNAL_H 1
- #include <features.h>
- #ifdef __UCLIBC_BUILD_RELRO__
- # define attribute_relro __attribute__ ((section (".data.rel.ro")))
- #else
- # define attribute_relro
- #endif
- #ifdef __UCLIBC_HAS_THREADS_NATIVE__
- # define attribute_tls_model_ie __attribute__ ((tls_model ("initial-exec")))
- #endif
- #include <sys/cdefs.h>
- #ifndef __ASSEMBLER__
- # ifdef IS_IN_libc
- # define __need_size_t
- # include <stddef.h>
- #ifdef __USE_GNU
- extern int __xpg_strerror_r (int __errnum, char *__buf, size_t __buflen);
- libc_hidden_proto(__xpg_strerror_r)
- #else
- extern char *__glibc_strerror_r (int __errnum, char *__buf, size_t __buflen);
- libc_hidden_proto(__glibc_strerror_r)
- #endif
- # ifndef __UCLIBC_HAS_THREADS__
- # define __pthread_mutex_init(mutex, mutexattr) ((void)0)
- # define __pthread_mutex_lock(mutex) ((void)0)
- # define __pthread_mutex_trylock(mutex) ((void)0)
- # define __pthread_mutex_unlock(mutex) ((void)0)
- # define _pthread_cleanup_push_defer(mutex) ((void)0)
- # define _pthread_cleanup_pop_restore(mutex) ((void)0)
- # endif
- extern const char *__uclibc_progname attribute_hidden;
- # endif
- #include <bits/stackinfo.h>
- #if defined(_STACK_GROWS_DOWN)
- # define extend_alloca(buf, len, newlen) \
- (__typeof (buf)) ({ size_t __newlen = (newlen); \
- char *__newbuf = alloca (__newlen); \
- if (__newbuf + __newlen == (char *) buf) \
- len += __newlen; \
- else \
- len = __newlen; \
- __newbuf; })
- #elif defined(_STACK_GROWS_UP)
- # define extend_alloca(buf, len, newlen) \
- (__typeof (buf)) ({ size_t __newlen = (newlen); \
- char *__newbuf = alloca (__newlen); \
- char *__buf = (buf); \
- if (__buf + __newlen == __newbuf) \
- { \
- len += __newlen; \
- __newbuf = __buf; \
- } \
- else \
- len = __newlen; \
- __newbuf; })
- #else
- # warning unknown stack
- # define extend_alloca(buf, len, newlen) \
- alloca (((len) = (newlen)))
- #endif
- #endif
- #endif
|