summaryrefslogtreecommitdiffstats
path: root/libc/sysdeps/linux/common/bits
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-01-14 19:22:44 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-01-14 19:22:44 +0000
commit9138bf01b3b21ce23cfdf15fce3f30bb9a1fbc61 (patch)
treefb0ac2208e1a080dfae3f2ca5f1f90f568bf4165 /libc/sysdeps/linux/common/bits
parent6e3c1938ff129fb5385a963ec600111aa6228bdc (diff)
downloaduClibc-alpine-9138bf01b3b21ce23cfdf15fce3f30bb9a1fbc61.tar.bz2
uClibc-alpine-9138bf01b3b21ce23cfdf15fce3f30bb9a1fbc61.tar.xz
Merge from trunk.
Diffstat (limited to 'libc/sysdeps/linux/common/bits')
-rw-r--r--libc/sysdeps/linux/common/bits/nan.h15
-rw-r--r--libc/sysdeps/linux/common/bits/statfs.h22
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_ctype.h40
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_fpmax.h10
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_locale.h26
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_pthread.h15
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_stdio.h6
7 files changed, 50 insertions, 84 deletions
diff --git a/libc/sysdeps/linux/common/bits/nan.h b/libc/sysdeps/linux/common/bits/nan.h
index 6d88b551b..bae97f216 100644
--- a/libc/sysdeps/linux/common/bits/nan.h
+++ b/libc/sysdeps/linux/common/bits/nan.h
@@ -1,5 +1,5 @@
/* `NAN' constant for IEEE 754 machines.
- Copyright (C) 1992, 1996, 1997, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1992,1996,1997,1999,2004,2006 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -24,11 +24,15 @@
/* IEEE Not A Number. */
-#ifdef __GNUC__
+#if __GNUC_PREREQ(3,3)
+
+# define NAN (__builtin_nanf (""))
+
+#elif defined __GNUC__
# define NAN \
- (__extension__ \
- ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
+ (__extension__ \
+ ((union { unsigned __l __attribute__ ((__mode__ (__SI__))); float __d; }) \
{ __l: 0x7fc00000UL }).__d)
#else
@@ -42,7 +46,8 @@
# define __nan_bytes { 0, 0, 0xc0, 0x7f }
# endif
-static union { unsigned char __c[4]; float __d; } __nan_union = { __nan_bytes };
+static union { unsigned char __c[4]; float __d; } __nan_union
+ __attribute_used__ = { __nan_bytes };
# define NAN (__nan_union.__d)
#endif /* GCC. */
diff --git a/libc/sysdeps/linux/common/bits/statfs.h b/libc/sysdeps/linux/common/bits/statfs.h
index 78c9bdbbc..e115c4d75 100644
--- a/libc/sysdeps/linux/common/bits/statfs.h
+++ b/libc/sysdeps/linux/common/bits/statfs.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998, 2000 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -20,12 +20,12 @@
# error "Never include <bits/statfs.h> directly; use <sys/statfs.h> instead."
#endif
-#include <bits/types.h> /* for __fsid_t and __fsblkcnt_t*/
+#include <bits/types.h>
struct statfs
{
- int f_type;
- int f_bsize;
+ __SWORD_TYPE f_type;
+ __SWORD_TYPE f_bsize;
#ifndef __USE_FILE_OFFSET64
__fsblkcnt_t f_blocks;
__fsblkcnt_t f_bfree;
@@ -40,25 +40,25 @@ struct statfs
__fsfilcnt64_t f_ffree;
#endif
__fsid_t f_fsid;
- int f_namelen;
- int f_spare[6];
+ __SWORD_TYPE f_namelen;
+ __SWORD_TYPE f_spare[5];
};
#ifdef __USE_LARGEFILE64
struct statfs64
{
- int f_type;
- int f_bsize;
+ __SWORD_TYPE f_type;
+ __SWORD_TYPE f_bsize;
__fsblkcnt64_t f_blocks;
__fsblkcnt64_t f_bfree;
__fsblkcnt64_t f_bavail;
__fsfilcnt64_t f_files;
__fsfilcnt64_t f_ffree;
__fsid_t f_fsid;
- int f_namelen;
- int f_spare[6];
+ __SWORD_TYPE f_namelen;
+ __SWORD_TYPE f_spare[5];
};
#endif
-/* Tell code we have this member. */
+/* Tell code we have these members. */
#define _STATFS_F_NAMELEN
diff --git a/libc/sysdeps/linux/common/bits/uClibc_ctype.h b/libc/sysdeps/linux/common/bits/uClibc_ctype.h
index 7c2d412cf..dd723c77c 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_ctype.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_ctype.h
@@ -134,17 +134,6 @@ enum {
#define __C_tolower(c) (__C_isupper(c) ? ((c) | 0x20) : (c))
#define __C_toupper(c) (__C_islower(c) ? ((c) ^ 0x20) : (c))
-#define __C_isxlower(c) \
- (__C_isdigit(c) \
- || ((sizeof(c) == sizeof(char)) \
- ? (((unsigned char)(((c)) - 'a')) < 6) \
- : (((unsigned int)(((c)) - 'a')) < 6)))
-#define __C_isxupper(c) \
- (__C_isdigit(c) \
- || ((sizeof(c) == sizeof(char)) \
- ? (((unsigned char)(((c)) - 'A')) < 6) \
- : (((unsigned int)(((c)) - 'A')) < 6)))
-
/**********************************************************************/
__BEGIN_DECLS
@@ -171,14 +160,7 @@ extern int isascii(int c) __THROW;
extern int toascii(int c) __THROW;
#endif
-/* The following are included for compatibility with older versions of
- * uClibc; but now they're only visible if MISC funcctionality is requested.
- * However, as they are locale-independent, the hidden macro versions are
- * always present. */
-#ifdef __USE_MISC
-extern int isxlower(int c) __THROW; /* uClibc-specific. */
-extern int isxupper(int c) __THROW; /* uClibc-specific. */
-
+#if defined _LIBC && (defined NOT_IN_libc || defined IS_IN_libc)
/* isdigit() is really locale-invariant, so provide some small fast macros.
* These are uClibc-specific. */
#define __isdigit_char(C) (((unsigned char)((C) - '0')) <= 9)
@@ -202,20 +184,6 @@ extern int isxupper(int c) __THROW; /* uClibc-specific. */
#define _toupper(c) ((c) ^ 0x20)
#define _tolower(c) ((c) | 0x20)
-
-/* For compatibility with older versions of uClibc. Are these ever used? */
-#if 0
-#define __isxlower(c) __C_isxlower(c) /* uClibc-specific. */
-#define __isxupper(c) __C_isxupper(c) /* uClibc-specific. */
-#endif
-
-/* Apparently, glibc implements things as macros if __NO_CTYPE isn't defined.
- * If we don't have locale support, we'll do the same. Otherwise, we'll
- * only use macros for the supported-locale-invariant cases. */
-#ifndef __UCLIBC_HAS_LOCALE__
-
-#endif /* __UCLIBC_HAS_LOCALE__ */
-
__END_DECLS
/**********************************************************************/
@@ -264,9 +232,6 @@ __END_DECLS
#define __ispunct(c) __body(ispunct,c)
#define __isgraph(c) __body(isgraph,c)
-#define __isxlower(c) __body(isxlower,c)
-#define __isxupper(c) __body(isxupper,c)
-
#define __tolower(c) __body(tolower,c)
#define __toupper(c) __body(toupper,c)
@@ -285,9 +250,6 @@ __END_DECLS
#define ispunct(c) __ispunct(c)
#define isgraph(c) __isgraph(c)
-#define isxlower(c) __isxlower(c)
-#define isxupper(c) __isxupper(c)
-
#define tolower(c) __tolower(c)
#define toupper(c) __toupper(c)
diff --git a/libc/sysdeps/linux/common/bits/uClibc_fpmax.h b/libc/sysdeps/linux/common/bits/uClibc_fpmax.h
index 690f7b23b..27432a03e 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_fpmax.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_fpmax.h
@@ -98,21 +98,23 @@ typedef float __fpmax_t;
#endif /* DECIMAL_DIG */
-extern __fpmax_t __strtofpmax(const char *str, char **endptr, int exp_adjust);
+#if defined _LIBC && defined IS_IN_libc
+extern __fpmax_t __strtofpmax(const char *str, char **endptr, int exp_adjust) attribute_hidden;
#ifdef __UCLIBC_HAS_XLOCALE__
extern __fpmax_t __strtofpmax_l(const char *str, char **endptr, int exp_adjust,
- __locale_t locale_arg);
+ __locale_t locale_arg) attribute_hidden;
#endif
#ifdef __UCLIBC_HAS_WCHAR__
extern __fpmax_t __wcstofpmax(const wchar_t *wcs, wchar_t **endptr,
- int exp_adjust);
+ int exp_adjust) attribute_hidden;
#ifdef __UCLIBC_HAS_XLOCALE__
extern __fpmax_t __wcstofpmax_l(const wchar_t *wcs, wchar_t **endptr,
- int exp_adjust, __locale_t locale_arg);
+ int exp_adjust, __locale_t locale_arg) attribute_hidden;
#endif
+#endif /* _LIBC */
#endif /* __UCLIBC_HAS_WCHAR__ */
/* The following checks in an __fpmax_t is either 0 or +/- infinity.
diff --git a/libc/sysdeps/linux/common/bits/uClibc_locale.h b/libc/sysdeps/linux/common/bits/uClibc_locale.h
index a6191a32d..fe574170f 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_locale.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_locale.h
@@ -65,21 +65,20 @@
#define __LC_ALL 6
/**********************************************************************/
-/* #if defined(_LIBC) && !defined(__LOCALE_C_ONLY) */
#ifndef __LOCALE_C_ONLY
-#ifdef _LIBC
+#if defined _LIBC /* && (defined IS_IN_libc || defined NOT_IN_libc) */
#include <stddef.h>
#include <stdint.h>
#include <bits/uClibc_touplow.h>
-#endif
-#if defined(_LIBC) && !defined(__UCLIBC_GEN_LOCALE)
+#ifndef __UCLIBC_GEN_LOCALE
#include <bits/uClibc_locale_data.h>
#endif
+#endif
-extern void _locale_set(const unsigned char *p);
-extern void _locale_init(void);
+/* extern void _locale_set(const unsigned char *p); */
+/* extern void _locale_init(void); */
enum {
__ctype_encoding_7_bit, /* C/POSIX */
@@ -101,7 +100,7 @@ enum {
* In particular, C/POSIX locale is '#' + "\x80\x01"}*LC_ALL + nul.
*/
-#if defined(_LIBC) && !defined(__UCLIBC_GEN_LOCALE)
+#if defined _LIBC && !defined __UCLIBC_GEN_LOCALE /* && (defined IS_IN_libc || defined NOT_IN_libc) */
typedef struct {
uint16_t num_weights;
uint16_t num_starters;
@@ -319,14 +318,15 @@ typedef struct __uclibc_locale_struct {
extern __uclibc_locale_t __global_locale_data;
extern struct __uclibc_locale_struct * __global_locale;
-#endif
+#endif /* _LIBC */
typedef struct __uclibc_locale_struct *__locale_t;
-#ifdef _LIBC
+/* if we need to leave only _LIBC, then attribute_hidden is not usable */
+#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
extern int __locale_mbrtowc_l(wchar_t *__restrict dst,
const char *__restrict src,
- __locale_t loc );
+ __locale_t loc ) attribute_hidden;
#endif
#ifdef L_setlocale
@@ -368,7 +368,7 @@ extern __locale_t __curlocale_set(__locale_t newloc);
#define __LOCALE_ARG , locale_arg
#define __LOCALE_PTR locale_arg
-#else /* defined(__UCLIBC_HAS_XLOCALE__) && defined(__STDLIB_DO_XLOCALE) */
+#else /* defined(__UCLIBC_HAS_XLOCALE__) && defined(__UCLIBC_DO_XLOCALE) */
#define __XL(N) N
#define __XL_NPP(N) N
@@ -377,10 +377,10 @@ extern __locale_t __curlocale_set(__locale_t newloc);
#define __LOCALE_ARG
#define __LOCALE_PTR __UCLIBC_CURLOCALE
-#endif /* defined(__UCLIBC_HAS_XLOCALE__) && defined(__STDLIB_DO_XLOCALE) */
+#endif /* defined(__UCLIBC_HAS_XLOCALE__) && defined(__UCLIBC_DO_XLOCALE) */
/**********************************************************************/
-#endif /* defined(_LIBC) && !defined(__LOCALE_C_ONLY) */
+#endif /* !defined(__LOCALE_C_ONLY) */
/**********************************************************************/
#endif /* _UCLIBC_LOCALE_H */
diff --git a/libc/sysdeps/linux/common/bits/uClibc_pthread.h b/libc/sysdeps/linux/common/bits/uClibc_pthread.h
index b757ef439..a3be2ca35 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_pthread.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_pthread.h
@@ -16,7 +16,7 @@
* 02111-1307 USA.
*/
-/* Supply prototypes for the (weak) thread functions used by the
+/* Supply prototypes for the internal thread functions used by the
* uClibc library code.
*/
@@ -24,17 +24,14 @@
#define _UCLIBC_PTHREAD_H
#ifndef _PTHREAD_H
-#error Always include <pthread.h> rather than <bits/uClibc_pthread.h>
+# error "Always include <pthread.h> rather than <bits/uClibc_pthread.h>"
#endif
extern int __pthread_mutex_init (pthread_mutex_t *__restrict __mutex,
__const pthread_mutexattr_t *__restrict
- __mutex_attr) __THROW;
-
-extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex) __THROW;
-
-extern int __pthread_mutex_lock (pthread_mutex_t *__mutex) __THROW;
-
-extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex) __THROW;
+ __mutex_attr) attribute_hidden;
+extern int __pthread_mutex_trylock (pthread_mutex_t *__mutex) attribute_hidden;
+extern int __pthread_mutex_lock (pthread_mutex_t *__mutex) attribute_hidden;
+extern int __pthread_mutex_unlock (pthread_mutex_t *__mutex) attribute_hidden;
#endif
diff --git a/libc/sysdeps/linux/common/bits/uClibc_stdio.h b/libc/sysdeps/linux/common/bits/uClibc_stdio.h
index 04844ac6a..d73da9de7 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_stdio.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_stdio.h
@@ -397,8 +397,8 @@ struct __STDIO_FILE_STRUCT {
**********************************************************************/
#if defined _LIBC && (defined IS_IN_libc || defined NOT_IN_libc)
-extern void _stdio_init(void);
-extern void _stdio_term(void);
+extern void _stdio_init(void) attribute_hidden;
+extern void _stdio_term(void) attribute_hidden;
#ifdef __STDIO_HAS_OPENLIST
@@ -440,7 +440,7 @@ extern void __stdio_init_mutex(pthread_mutex_t *m) attribute_hidden;
extern int __fgetc_unlocked(FILE *__stream);
extern int __fputc_unlocked(int __c, FILE *__stream);
-/* First define the default definitions. They overriden below as necessary. */
+/* First define the default definitions. They will be overwritten below as necessary. */
#define __FGETC_UNLOCKED(__stream) (__fgetc_unlocked)((__stream))
#define __FGETC(__stream) (fgetc)((__stream))
#define __GETC_UNLOCKED_MACRO(__stream) (__fgetc_unlocked)((__stream))