summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-12-27 11:01:17 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-12-27 11:01:17 +0000
commitd2ac303510709b978fe85719635ef715260a2e87 (patch)
treedd8d2198f115a466eaad20cd5832b179a157fbc1
parentcf578c75a521e1f35a9f07ca04c0cd678209c79f (diff)
Help unifdef to remove private parts of headers
-rw-r--r--include/ctype.h7
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_ctype.h9
-rw-r--r--libc/sysdeps/linux/common/bits/uClibc_locale.h8
3 files changed, 17 insertions, 7 deletions
diff --git a/include/ctype.h b/include/ctype.h
index 6933c96c0..e1aea86a2 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -229,7 +229,9 @@ extern int _tolower(int __c) __THROW;
}))
#define __isctype(c, type) ((__UCLIBC_CTYPE_B)[(int)(c)] & (__ctype_mask_t)type)
-#if !defined __NO_CTYPE && !defined __cplusplus
+/* Do not combine in one #if - unifdef tool is not that clever */
+#ifndef __NO_CTYPE
+#ifndef __cplusplus
# define isalnum(c) __isctype((c), _ISalnum)
# define isalpha(c) __isctype((c), _ISalpha)
# define iscntrl(c) __isctype((c), _IScntrl)
@@ -270,7 +272,8 @@ __NTH (toupper (int __c))
# define _toupper(c) ((int) (__UCLIBC_CTYPE_TOUPPER)[(int) (c)])
# endif
-#endif /* Not __NO_CTYPE. */
+#endif /* not __cplusplus */
+#endif /* not __NO_CTYPE */
#if defined __USE_GNU && defined __UCLIBC_HAS_XLOCALE__
diff --git a/libc/sysdeps/linux/common/bits/uClibc_ctype.h b/libc/sysdeps/linux/common/bits/uClibc_ctype.h
index 04185cc58..9150b4870 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_ctype.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_ctype.h
@@ -171,7 +171,9 @@ __END_DECLS
//# define __tolower(c) __body(tolower,c)
//# define __toupper(c) __body(toupper,c)
-# if !defined __NO_CTYPE && !defined __cplusplus
+/* Do not combine in one #if - unifdef tool is not that clever */
+# ifndef __NO_CTYPE
+# ifndef __cplusplus
# define isspace(c) __isspace(c)
# define isblank(c) __isblank(c)
@@ -190,10 +192,12 @@ __END_DECLS
# define toupper(c) __body(toupper,c)
# endif
+# endif
#else /* !_GNUC__ */
-# if !defined __NO_CTYPE && !defined __cplusplus
+# ifndef __NO_CTYPE
+# ifndef __cplusplus
/* These macros should be safe from side effects!
* (not all __C_xxx macros are) */
@@ -205,6 +209,7 @@ __END_DECLS
# define isgraph(c) __C_isgraph(c)
# endif
+# endif
#endif /* __GNUC__ */
/**********************************************************************/
diff --git a/libc/sysdeps/linux/common/bits/uClibc_locale.h b/libc/sysdeps/linux/common/bits/uClibc_locale.h
index 532ab8244..ad80d8f83 100644
--- a/libc/sysdeps/linux/common/bits/uClibc_locale.h
+++ b/libc/sysdeps/linux/common/bits/uClibc_locale.h
@@ -98,7 +98,8 @@ enum {
* In particular, C/POSIX locale is '#' + "\x80\x01"}*LC_ALL + nul.
*/
-#if defined _LIBC && !defined __UCLIBC_GEN_LOCALE /* && (defined IS_IN_libc || defined NOT_IN_libc) */
+#ifdef _LIBC
+#ifndef __UCLIBC_GEN_LOCALE /* && (defined IS_IN_libc || defined NOT_IN_libc) */
typedef struct {
uint16_t num_weights;
uint16_t num_starters;
@@ -314,6 +315,7 @@ typedef struct __uclibc_locale_struct {
extern __uclibc_locale_t __global_locale_data;
extern struct __uclibc_locale_struct * __global_locale;
+#endif /* !__UCLIBC_GEN_LOCALE */
#endif /* _LIBC */
typedef struct __uclibc_locale_struct *__locale_t;
@@ -321,8 +323,8 @@ typedef struct __uclibc_locale_struct *__locale_t;
/* 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 ) attribute_hidden;
+ const char *__restrict src,
+ __locale_t loc) attribute_hidden;
#endif
#ifdef L_setlocale