1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
|
From d75ad2e129b3f22296cead3db53c784527deab60 Mon Sep 17 00:00:00 2001
From: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Date: Fri, 18 Sep 2009 14:07:31 +0000
Subject: fix make {,install_}{,host}utils
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
---
diff --git a/extra/locale/programs/locale.c b/extra/locale/programs/locale.c
index 462a579..dfd2029 100644
--- a/extra/locale/programs/locale.c
+++ b/extra/locale/programs/locale.c
@@ -10,10 +10,9 @@
*
*/
-
+#include <string.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <langinfo.h>
#include <unistd.h>
#ifdef __UCLIBC_HAS_GETOPT_LONG__
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 290e680..3ce884d 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -171,7 +171,6 @@ extern size_t _wchar_utf8sntowcs(wchar_t *__restrict pwc, size_t wn,
extern size_t _wchar_wcsntoutf8s(char *__restrict s, size_t n,
const wchar_t **__restrict src, size_t wn) attribute_hidden;
-
#endif /* _LIBC */
/**********************************************************************/
#ifdef L_btowc
@@ -1201,45 +1200,6 @@ typedef struct {
int skip_invalid_input; /* To support iconv -c option. */
} _UC_iconv_t;
-
-
-#ifdef L_iconv
-
-#include <iconv.h>
-#include <string.h>
-#include <endian.h>
-#include <byteswap.h>
-
-#if (__BYTE_ORDER != __BIG_ENDIAN) && (__BYTE_ORDER != __LITTLE_ENDIAN)
-#error unsupported endianness for iconv
-#endif
-
-#ifndef __CTYPE_HAS_8_BIT_LOCALES
-#error currently iconv requires 8 bit locales
-#endif
-#ifndef __CTYPE_HAS_UTF_8_LOCALES
-#error currently iconv requires UTF-8 locales
-#endif
-
-
-enum {
- IC_WCHAR_T = 0xe0,
- IC_MULTIBYTE = 0xe0,
-#if __BYTE_ORDER == __BIG_ENDIAN
- IC_UCS_4 = 0xec,
- IC_UTF_32 = 0xe4,
- IC_UCS_2 = 0xe2,
- IC_UTF_16 = 0xea,
-#else
- IC_UCS_4 = 0xed,
- IC_UTF_32 = 0xe5,
- IC_UCS_2 = 0xe3,
- IC_UTF_16 = 0xeb,
-#endif
- IC_UTF_8 = 2,
- IC_ASCII = 1
-};
-
/* For the multibyte
* bit 0 means swap endian
* bit 1 means 2 byte
@@ -1247,8 +1207,13 @@ enum {
*
*/
+#if defined L_iconv && defined _LIBC
+/* Used externally only by iconv utility */
extern const unsigned char __iconv_codesets[];
libc_hidden_proto(__iconv_codesets)
+#endif
+
+#if defined L_iconv || defined L_iconv_main
const unsigned char __iconv_codesets[] =
"\x0a\xe0""WCHAR_T\x00" /* superset of UCS-4 but platform-endian */
#if __BYTE_ORDER == __BIG_ENDIAN
@@ -1281,7 +1246,48 @@ const unsigned char __iconv_codesets[] =
"\x08\x02""UTF-8\x00"
"\x0b\x01""US-ASCII\x00"
"\x07\x01""ASCII"; /* Must be last! (special case to save a nul) */
+#endif
+#if defined L_iconv && defined _LIBC
libc_hidden_data_def(__iconv_codesets)
+#endif
+
+
+#ifdef L_iconv
+
+#include <iconv.h>
+#include <string.h>
+#include <endian.h>
+#include <byteswap.h>
+
+#if (__BYTE_ORDER != __BIG_ENDIAN) && (__BYTE_ORDER != __LITTLE_ENDIAN)
+#error unsupported endianness for iconv
+#endif
+
+#ifndef __CTYPE_HAS_8_BIT_LOCALES
+#error currently iconv requires 8 bit locales
+#endif
+#ifndef __CTYPE_HAS_UTF_8_LOCALES
+#error currently iconv requires UTF-8 locales
+#endif
+
+
+enum {
+ IC_WCHAR_T = 0xe0,
+ IC_MULTIBYTE = 0xe0,
+#if __BYTE_ORDER == __BIG_ENDIAN
+ IC_UCS_4 = 0xec,
+ IC_UTF_32 = 0xe4,
+ IC_UCS_2 = 0xe2,
+ IC_UTF_16 = 0xea,
+#else
+ IC_UCS_4 = 0xed,
+ IC_UTF_32 = 0xe5,
+ IC_UCS_2 = 0xe3,
+ IC_UTF_16 = 0xeb,
+#endif
+ IC_UTF_8 = 2,
+ IC_ASCII = 1
+};
/* Experimentally off - libc_hidden_proto(strcasecmp) */
@@ -1575,6 +1581,4 @@ size_t weak_function iconv(iconv_t cd, char **__restrict inbuf,
}
return nrcount;
}
-
#endif
-
--
cgit v0.8.2.1
|