Mercurial > projects > dwt-addons
comparison dwtx/dwtxhelper/mangoicu/ICU.d @ 91:11e8159caf7a
make the mango icu fork work.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Mon, 07 Jul 2008 15:53:07 +0200 |
parents | 040da1cb0d76 |
children |
comparison
equal
deleted
inserted
replaced
90:7ffeace6c47f | 91:11e8159caf7a |
---|---|
38 Anders F Bjorklund (Darwin patches) | 38 Anders F Bjorklund (Darwin patches) |
39 | 39 |
40 | 40 |
41 *******************************************************************************/ | 41 *******************************************************************************/ |
42 | 42 |
43 module dwtx.dwthelper.mangoicu.ICU; | 43 module dwtx.dwtxhelper.mangoicu.ICU; |
44 | 44 |
45 /******************************************************************************* | 45 /******************************************************************************* |
46 | 46 |
47 Library version identifiers | 47 Library version identifiers |
48 | 48 |
96 | 96 |
97 ***********************************************************************/ | 97 ***********************************************************************/ |
98 | 98 |
99 version (Win32) | 99 version (Win32) |
100 { | 100 { |
101 protected static char[] icuuc = "icuuc"~ICULib~".dll"; | 101 package static char[] icuuc = "icuuc"~ICULib~".dll"; |
102 protected static char[] icuin = "icuin"~ICULib~".dll"; | 102 package static char[] icuin = "icuin"~ICULib~".dll"; |
103 } | 103 } |
104 else | 104 else |
105 version (linux) | 105 version (linux) |
106 { | 106 { |
107 protected static char[] icuuc = "libicuuc.so."~ICULib; | 107 package static char[] icuuc = "libicuuc.so."~ICULib; |
108 protected static char[] icuin = "libicui18n.so."~ICULib; | 108 package static char[] icuin = "libicui18n.so."~ICULib; |
109 } | 109 } |
110 else | 110 else |
111 version (darwin) | 111 version (darwin) |
112 { | 112 { |
113 protected static char[] icuuc = "libicuuc.dylib."~ICULib; | 113 package static char[] icuuc = "libicuuc.dylib."~ICULib; |
114 protected static char[] icuin = "libicui18n.dylib."~ICULib; | 114 package static char[] icuin = "libicui18n.dylib."~ICULib; |
115 } | 115 } |
116 else | 116 else |
117 { | 117 { |
118 static assert (false); | 118 static assert (false); |
119 } | 119 } |
156 | 156 |
157 ICU error codes (the ones which are referenced) | 157 ICU error codes (the ones which are referenced) |
158 | 158 |
159 ***********************************************************************/ | 159 ***********************************************************************/ |
160 | 160 |
161 protected enum Error:int | 161 package enum UErrorCode:int |
162 { | 162 { |
163 OK, | 163 OK, |
164 BufferOverflow=15 | 164 BufferOverflow=15 |
165 } | 165 } |
166 | 166 |
167 /*********************************************************************** | 167 /*********************************************************************** |
168 | 168 |
169 ***********************************************************************/ | 169 ***********************************************************************/ |
170 | 170 |
171 protected static final bool isError (Error e) | 171 package static final bool isError (UErrorCode e) |
172 { | 172 { |
173 return e > 0; | 173 return e > 0; |
174 } | 174 } |
175 | 175 |
176 /*********************************************************************** | 176 /*********************************************************************** |
177 | 177 |
178 ***********************************************************************/ | 178 ***********************************************************************/ |
179 | 179 |
180 protected static final void exception (char[] msg) | 180 package static final void exception (char[] msg) |
181 { | 181 { |
182 throw new ICUException (msg); | 182 throw new ICUException (msg); |
183 } | 183 } |
184 | 184 |
185 /*********************************************************************** | 185 /*********************************************************************** |
186 | 186 |
187 ***********************************************************************/ | 187 ***********************************************************************/ |
188 | 188 |
189 protected static final void testError (Error e, char[] msg) | 189 package static final void testError (UErrorCode e, char[] msg) |
190 { | 190 { |
191 if (e > 0) | 191 if (e > 0) |
192 exception (msg); | 192 exception (msg); |
193 } | 193 } |
194 | 194 |
294 { | 294 { |
295 super (msg); | 295 super (msg); |
296 } | 296 } |
297 } | 297 } |
298 | 298 |
299 /******************************************************************************* | |
300 | |
301 *******************************************************************************/ | |
302 | |
303 typedef void* UParseError; | |
304 | |
299 | 305 |
300 /******************************************************************************* | 306 /******************************************************************************* |
301 | 307 |
302 Function address loader for Win32 | 308 Function address loader for Win32 |
303 | 309 |
312 | 318 |
313 /*********************************************************************** | 319 /*********************************************************************** |
314 | 320 |
315 ***********************************************************************/ | 321 ***********************************************************************/ |
316 | 322 |
317 class FunctionLoader | 323 package static class FunctionLoader |
318 { | 324 { |
319 /*************************************************************** | 325 /*************************************************************** |
320 | 326 |
321 ***************************************************************/ | 327 ***************************************************************/ |
322 | 328 |