200-uclibc-locale.patch 111 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246
  1. diff -urN gcc-3.4.0-dist/libstdc++-v3/acinclude.m4 gcc-3.4.0/libstdc++-v3/acinclude.m4
  2. --- gcc-3.4.0-dist/libstdc++-v3/acinclude.m4 2004-03-18 11:35:22.000000000 -0600
  3. +++ gcc-3.4.0/libstdc++-v3/acinclude.m4 2004-08-12 17:08:19.000000000 -0500
  4. @@ -995,7 +995,7 @@
  5. AC_MSG_CHECKING([for C locale to use])
  6. GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
  7. [use MODEL for target locale package],
  8. - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
  9. + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
  10. # If they didn't use this option switch, or if they specified --enable
  11. # with no specific model, we'll have to look for one. If they
  12. @@ -1011,6 +1011,9 @@
  13. # Default to "generic".
  14. if test $enable_clocale_flag = auto; then
  15. case x${target_os} in
  16. + x*-uclibc*)
  17. + enable_clocale_flag=uclibc
  18. + ;;
  19. xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
  20. AC_EGREP_CPP([_GLIBCXX_ok], [
  21. #include <features.h>
  22. @@ -1137,6 +1140,41 @@
  23. CTIME_CC=config/locale/generic/time_members.cc
  24. CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  25. ;;
  26. + uclibc)
  27. + AC_MSG_RESULT(uclibc)
  28. +
  29. + # Declare intention to use gettext, and add support for specific
  30. + # languages.
  31. + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  32. + ALL_LINGUAS="de fr"
  33. +
  34. + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  35. + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  36. + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  37. + USE_NLS=yes
  38. + fi
  39. + # Export the build objects.
  40. + for ling in $ALL_LINGUAS; do \
  41. + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  42. + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  43. + done
  44. + AC_SUBST(glibcxx_MOFILES)
  45. + AC_SUBST(glibcxx_POFILES)
  46. +
  47. + CLOCALE_H=config/locale/uclibc/c_locale.h
  48. + CLOCALE_CC=config/locale/uclibc/c_locale.cc
  49. + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
  50. + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  51. + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  52. + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  53. + CMESSAGES_H=config/locale/uclibc/messages_members.h
  54. + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  55. + CMONEY_CC=config/locale/uclibc/monetary_members.cc
  56. + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  57. + CTIME_H=config/locale/uclibc/time_members.h
  58. + CTIME_CC=config/locale/uclibc/time_members.cc
  59. + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  60. + ;;
  61. esac
  62. # This is where the testsuite looks for locale catalogs, using the
  63. diff -urN gcc-3.4.0-dist/libstdc++-v3/aclocal.m4 gcc-3.4.0/libstdc++-v3/aclocal.m4
  64. --- gcc-3.4.0-dist/libstdc++-v3/aclocal.m4 2004-03-18 11:35:23.000000000 -0600
  65. +++ gcc-3.4.0/libstdc++-v3/aclocal.m4 2004-08-12 17:13:42.000000000 -0500
  66. @@ -1024,6 +1024,9 @@
  67. # Default to "generic".
  68. if test $enable_clocale_flag = auto; then
  69. case x${target_os} in
  70. + x*-uclibc*)
  71. + enable_clocale_flag=uclibc
  72. + ;;
  73. xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
  74. AC_EGREP_CPP([_GLIBCXX_ok], [
  75. #include <features.h>
  76. @@ -1150,6 +1153,41 @@
  77. CTIME_CC=config/locale/generic/time_members.cc
  78. CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  79. ;;
  80. + uclibc)
  81. + AC_MSG_RESULT(uclibc)
  82. +
  83. + # Declare intention to use gettext, and add support for specific
  84. + # languages.
  85. + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  86. + ALL_LINGUAS="de fr"
  87. +
  88. + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  89. + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
  90. + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  91. + USE_NLS=yes
  92. + fi
  93. + # Export the build objects.
  94. + for ling in $ALL_LINGUAS; do \
  95. + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  96. + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  97. + done
  98. + AC_SUBST(glibcxx_MOFILES)
  99. + AC_SUBST(glibcxx_POFILES)
  100. +
  101. + CLOCALE_H=config/locale/uclibc/c_locale.h
  102. + CLOCALE_CC=config/locale/uclibc/c_locale.cc
  103. + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
  104. + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  105. + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  106. + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  107. + CMESSAGES_H=config/locale/uclibc/messages_members.h
  108. + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  109. + CMONEY_CC=config/locale/uclibc/monetary_members.cc
  110. + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  111. + CTIME_H=config/locale/uclibc/time_members.h
  112. + CTIME_CC=config/locale/uclibc/time_members.cc
  113. + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  114. + ;;
  115. esac
  116. # This is where the testsuite looks for locale catalogs, using the
  117. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  118. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
  119. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2004-08-12 17:08:19.000000000 -0500
  120. @@ -0,0 +1,59 @@
  121. +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
  122. +
  123. +// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
  124. +//
  125. +// This file is part of the GNU ISO C++ Library. This library is free
  126. +// software; you can redistribute it and/or modify it under the
  127. +// terms of the GNU General Public License as published by the
  128. +// Free Software Foundation; either version 2, or (at your option)
  129. +// any later version.
  130. +
  131. +// This library is distributed in the hope that it will be useful,
  132. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  133. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  134. +// GNU General Public License for more details.
  135. +
  136. +// You should have received a copy of the GNU General Public License along
  137. +// with this library; see the file COPYING. If not, write to the Free
  138. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  139. +// USA.
  140. +
  141. +// As a special exception, you may use this file as part of a free software
  142. +// library without restriction. Specifically, if other files instantiate
  143. +// templates or use macros or inline functions from this file, or you compile
  144. +// this file and link it with other files to produce an executable, this
  145. +// file does not by itself cause the resulting executable to be covered by
  146. +// the GNU General Public License. This exception does not however
  147. +// invalidate any other reasons why the executable file might be covered by
  148. +// the GNU General Public License.
  149. +
  150. +// Written by Jakub Jelinek <jakub@redhat.com>
  151. +
  152. +#include <clocale>
  153. +
  154. +#ifdef __UCLIBC_MJN3_ONLY__
  155. +#warning clean this up
  156. +#endif
  157. +
  158. +#ifdef __UCLIBC_HAS_XLOCALE__
  159. +
  160. +extern "C" __typeof(iswctype_l) __iswctype_l;
  161. +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
  162. +extern "C" __typeof(strcoll_l) __strcoll_l;
  163. +extern "C" __typeof(strftime_l) __strftime_l;
  164. +extern "C" __typeof(strtod_l) __strtod_l;
  165. +extern "C" __typeof(strtof_l) __strtof_l;
  166. +extern "C" __typeof(strtold_l) __strtold_l;
  167. +extern "C" __typeof(strxfrm_l) __strxfrm_l;
  168. +extern "C" __typeof(towlower_l) __towlower_l;
  169. +extern "C" __typeof(towupper_l) __towupper_l;
  170. +extern "C" __typeof(wcscoll_l) __wcscoll_l;
  171. +extern "C" __typeof(wcsftime_l) __wcsftime_l;
  172. +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
  173. +extern "C" __typeof(wctype_l) __wctype_l;
  174. +extern "C" __typeof(newlocale) __newlocale;
  175. +extern "C" __typeof(freelocale) __freelocale;
  176. +extern "C" __typeof(duplocale) __duplocale;
  177. +extern "C" __typeof(uselocale) __uselocale;
  178. +
  179. +#endif // GLIBC 2.3 and later
  180. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
  181. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
  182. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2004-08-12 17:08:19.000000000 -0500
  183. @@ -0,0 +1,160 @@
  184. +// Wrapper for underlying C-language localization -*- C++ -*-
  185. +
  186. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  187. +//
  188. +// This file is part of the GNU ISO C++ Library. This library is free
  189. +// software; you can redistribute it and/or modify it under the
  190. +// terms of the GNU General Public License as published by the
  191. +// Free Software Foundation; either version 2, or (at your option)
  192. +// any later version.
  193. +
  194. +// This library is distributed in the hope that it will be useful,
  195. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  196. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  197. +// GNU General Public License for more details.
  198. +
  199. +// You should have received a copy of the GNU General Public License along
  200. +// with this library; see the file COPYING. If not, write to the Free
  201. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  202. +// USA.
  203. +
  204. +// As a special exception, you may use this file as part of a free software
  205. +// library without restriction. Specifically, if other files instantiate
  206. +// templates or use macros or inline functions from this file, or you compile
  207. +// this file and link it with other files to produce an executable, this
  208. +// file does not by itself cause the resulting executable to be covered by
  209. +// the GNU General Public License. This exception does not however
  210. +// invalidate any other reasons why the executable file might be covered by
  211. +// the GNU General Public License.
  212. +
  213. +//
  214. +// ISO C++ 14882: 22.8 Standard locale categories.
  215. +//
  216. +
  217. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  218. +
  219. +#include <cerrno> // For errno
  220. +#include <locale>
  221. +#include <stdexcept>
  222. +#include <langinfo.h>
  223. +#include <bits/c++locale_internal.h>
  224. +
  225. +#ifndef __UCLIBC_HAS_XLOCALE__
  226. +#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
  227. +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
  228. +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
  229. +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
  230. +#define __strtof_l(S, E, L) strtof((S), (E))
  231. +#define __strtod_l(S, E, L) strtod((S), (E))
  232. +#define __strtold_l(S, E, L) strtold((S), (E))
  233. +#warning should dummy __newlocale check for C|POSIX ?
  234. +#define __newlocale(a, b, c) NULL
  235. +#define __freelocale(a) ((void)0)
  236. +#define __duplocale(a) __c_locale()
  237. +#endif
  238. +
  239. +namespace std
  240. +{
  241. + template<>
  242. + void
  243. + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
  244. + const __c_locale& __cloc)
  245. + {
  246. + if (!(__err & ios_base::failbit))
  247. + {
  248. + char* __sanity;
  249. + errno = 0;
  250. + float __f = __strtof_l(__s, &__sanity, __cloc);
  251. + if (__sanity != __s && errno != ERANGE)
  252. + __v = __f;
  253. + else
  254. + __err |= ios_base::failbit;
  255. + }
  256. + }
  257. +
  258. + template<>
  259. + void
  260. + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
  261. + const __c_locale& __cloc)
  262. + {
  263. + if (!(__err & ios_base::failbit))
  264. + {
  265. + char* __sanity;
  266. + errno = 0;
  267. + double __d = __strtod_l(__s, &__sanity, __cloc);
  268. + if (__sanity != __s && errno != ERANGE)
  269. + __v = __d;
  270. + else
  271. + __err |= ios_base::failbit;
  272. + }
  273. + }
  274. +
  275. + template<>
  276. + void
  277. + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
  278. + const __c_locale& __cloc)
  279. + {
  280. + if (!(__err & ios_base::failbit))
  281. + {
  282. + char* __sanity;
  283. + errno = 0;
  284. + long double __ld = __strtold_l(__s, &__sanity, __cloc);
  285. + if (__sanity != __s && errno != ERANGE)
  286. + __v = __ld;
  287. + else
  288. + __err |= ios_base::failbit;
  289. + }
  290. + }
  291. +
  292. + void
  293. + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
  294. + __c_locale __old)
  295. + {
  296. + __cloc = __newlocale(1 << LC_ALL, __s, __old);
  297. +#ifdef __UCLIBC_HAS_XLOCALE__
  298. + if (!__cloc)
  299. + {
  300. + // This named locale is not supported by the underlying OS.
  301. + __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
  302. + "name not valid"));
  303. + }
  304. +#endif
  305. + }
  306. +
  307. + void
  308. + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
  309. + {
  310. + if (_S_get_c_locale() != __cloc)
  311. + __freelocale(__cloc);
  312. + }
  313. +
  314. + __c_locale
  315. + locale::facet::_S_clone_c_locale(__c_locale& __cloc)
  316. + { return __duplocale(__cloc); }
  317. +} // namespace std
  318. +
  319. +namespace __gnu_cxx
  320. +{
  321. + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
  322. + {
  323. + "LC_CTYPE",
  324. + "LC_NUMERIC",
  325. + "LC_TIME",
  326. + "LC_COLLATE",
  327. + "LC_MONETARY",
  328. + "LC_MESSAGES",
  329. +#if _GLIBCXX_NUM_CATEGORIES != 0
  330. + "LC_PAPER",
  331. + "LC_NAME",
  332. + "LC_ADDRESS",
  333. + "LC_TELEPHONE",
  334. + "LC_MEASUREMENT",
  335. + "LC_IDENTIFICATION"
  336. +#endif
  337. + };
  338. +}
  339. +
  340. +namespace std
  341. +{
  342. + const char* const* const locale::_S_categories = __gnu_cxx::category_names;
  343. +} // namespace std
  344. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.h
  345. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
  346. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2004-08-12 17:08:19.000000000 -0500
  347. @@ -0,0 +1,119 @@
  348. +// Wrapper for underlying C-language localization -*- C++ -*-
  349. +
  350. +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  351. +//
  352. +// This file is part of the GNU ISO C++ Library. This library is free
  353. +// software; you can redistribute it and/or modify it under the
  354. +// terms of the GNU General Public License as published by the
  355. +// Free Software Foundation; either version 2, or (at your option)
  356. +// any later version.
  357. +
  358. +// This library is distributed in the hope that it will be useful,
  359. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  360. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  361. +// GNU General Public License for more details.
  362. +
  363. +// You should have received a copy of the GNU General Public License along
  364. +// with this library; see the file COPYING. If not, write to the Free
  365. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  366. +// USA.
  367. +
  368. +// As a special exception, you may use this file as part of a free software
  369. +// library without restriction. Specifically, if other files instantiate
  370. +// templates or use macros or inline functions from this file, or you compile
  371. +// this file and link it with other files to produce an executable, this
  372. +// file does not by itself cause the resulting executable to be covered by
  373. +// the GNU General Public License. This exception does not however
  374. +// invalidate any other reasons why the executable file might be covered by
  375. +// the GNU General Public License.
  376. +
  377. +//
  378. +// ISO C++ 14882: 22.8 Standard locale categories.
  379. +//
  380. +
  381. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  382. +
  383. +#ifndef _C_LOCALE_H
  384. +#define _C_LOCALE_H 1
  385. +
  386. +#pragma GCC system_header
  387. +
  388. +#include <cstring> // get std::strlen
  389. +#include <cstdio> // get std::snprintf or std::sprintf
  390. +#include <clocale>
  391. +#include <langinfo.h> // For codecvt
  392. +#ifdef __UCLIBC_MJN3_ONLY__
  393. +#warning fix this
  394. +#endif
  395. +#ifdef __UCLIBC_HAS_LOCALE__
  396. +#include <iconv.h> // For codecvt using iconv, iconv_t
  397. +#endif
  398. +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  399. +#include <libintl.h> // For messages
  400. +#endif
  401. +
  402. +#ifdef __UCLIBC_MJN3_ONLY__
  403. +#warning what is _GLIBCXX_C_LOCALE_GNU for
  404. +#endif
  405. +#define _GLIBCXX_C_LOCALE_GNU 1
  406. +
  407. +#ifdef __UCLIBC_MJN3_ONLY__
  408. +#warning fix categories
  409. +#endif
  410. +// #define _GLIBCXX_NUM_CATEGORIES 6
  411. +#define _GLIBCXX_NUM_CATEGORIES 0
  412. +
  413. +#ifdef __UCLIBC_HAS_XLOCALE__
  414. +namespace __gnu_cxx
  415. +{
  416. + extern "C" __typeof(uselocale) __uselocale;
  417. +}
  418. +#endif
  419. +
  420. +namespace std
  421. +{
  422. +#ifdef __UCLIBC_HAS_XLOCALE__
  423. + typedef __locale_t __c_locale;
  424. +#else
  425. + typedef int* __c_locale;
  426. +#endif
  427. +
  428. + // Convert numeric value of type _Tv to string and return length of
  429. + // string. If snprintf is available use it, otherwise fall back to
  430. + // the unsafe sprintf which, in general, can be dangerous and should
  431. + // be avoided.
  432. + template<typename _Tv>
  433. + int
  434. + __convert_from_v(char* __out, const int __size, const char* __fmt,
  435. +#ifdef __UCLIBC_HAS_XLOCALE__
  436. + _Tv __v, const __c_locale& __cloc, int __prec = -1)
  437. + {
  438. + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
  439. +#else
  440. + _Tv __v, const __c_locale&, int __prec = -1)
  441. + {
  442. +# ifdef __UCLIBC_HAS_LOCALE__
  443. + char* __old = std::setlocale(LC_ALL, NULL);
  444. + char* __sav = new char[std::strlen(__old) + 1];
  445. + std::strcpy(__sav, __old);
  446. + std::setlocale(LC_ALL, "C");
  447. +# endif
  448. +#endif
  449. +
  450. + int __ret;
  451. + if (__prec >= 0)
  452. + __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
  453. + else
  454. + __ret = std::snprintf(__out, __size, __fmt, __v);
  455. +
  456. +#ifdef __UCLIBC_HAS_XLOCALE__
  457. + __gnu_cxx::__uselocale(__old);
  458. +#elif defined __UCLIBC_HAS_LOCALE__
  459. + std::setlocale(LC_ALL, __sav);
  460. + delete [] __sav;
  461. +#endif
  462. + return __ret;
  463. + }
  464. +}
  465. +
  466. +#endif
  467. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
  468. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
  469. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2004-08-12 17:08:19.000000000 -0500
  470. @@ -0,0 +1,306 @@
  471. +// std::codecvt implementation details, GNU version -*- C++ -*-
  472. +
  473. +// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
  474. +//
  475. +// This file is part of the GNU ISO C++ Library. This library is free
  476. +// software; you can redistribute it and/or modify it under the
  477. +// terms of the GNU General Public License as published by the
  478. +// Free Software Foundation; either version 2, or (at your option)
  479. +// any later version.
  480. +
  481. +// This library is distributed in the hope that it will be useful,
  482. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  483. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  484. +// GNU General Public License for more details.
  485. +
  486. +// You should have received a copy of the GNU General Public License along
  487. +// with this library; see the file COPYING. If not, write to the Free
  488. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  489. +// USA.
  490. +
  491. +// As a special exception, you may use this file as part of a free software
  492. +// library without restriction. Specifically, if other files instantiate
  493. +// templates or use macros or inline functions from this file, or you compile
  494. +// this file and link it with other files to produce an executable, this
  495. +// file does not by itself cause the resulting executable to be covered by
  496. +// the GNU General Public License. This exception does not however
  497. +// invalidate any other reasons why the executable file might be covered by
  498. +// the GNU General Public License.
  499. +
  500. +//
  501. +// ISO C++ 14882: 22.2.1.5 - Template class codecvt
  502. +//
  503. +
  504. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  505. +
  506. +#include <locale>
  507. +#include <bits/c++locale_internal.h>
  508. +
  509. +namespace std
  510. +{
  511. + // Specializations.
  512. +#ifdef _GLIBCXX_USE_WCHAR_T
  513. + codecvt_base::result
  514. + codecvt<wchar_t, char, mbstate_t>::
  515. + do_out(state_type& __state, const intern_type* __from,
  516. + const intern_type* __from_end, const intern_type*& __from_next,
  517. + extern_type* __to, extern_type* __to_end,
  518. + extern_type*& __to_next) const
  519. + {
  520. + result __ret = ok;
  521. + state_type __tmp_state(__state);
  522. +
  523. +#ifdef __UCLIBC_HAS_XLOCALE__
  524. + __c_locale __old = __uselocale(_M_c_locale_codecvt);
  525. +#endif
  526. +
  527. + // wcsnrtombs is *very* fast but stops if encounters NUL characters:
  528. + // in case we fall back to wcrtomb and then continue, in a loop.
  529. + // NB: wcsnrtombs is a GNU extension
  530. + for (__from_next = __from, __to_next = __to;
  531. + __from_next < __from_end && __to_next < __to_end
  532. + && __ret == ok;)
  533. + {
  534. + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
  535. + __from_end - __from_next);
  536. + if (!__from_chunk_end)
  537. + __from_chunk_end = __from_end;
  538. +
  539. + __from = __from_next;
  540. + const size_t __conv = wcsnrtombs(__to_next, &__from_next,
  541. + __from_chunk_end - __from_next,
  542. + __to_end - __to_next, &__state);
  543. + if (__conv == static_cast<size_t>(-1))
  544. + {
  545. + // In case of error, in order to stop at the exact place we
  546. + // have to start again from the beginning with a series of
  547. + // wcrtomb.
  548. + for (; __from < __from_next; ++__from)
  549. + __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
  550. + __state = __tmp_state;
  551. + __ret = error;
  552. + }
  553. + else if (__from_next && __from_next < __from_chunk_end)
  554. + {
  555. + __to_next += __conv;
  556. + __ret = partial;
  557. + }
  558. + else
  559. + {
  560. + __from_next = __from_chunk_end;
  561. + __to_next += __conv;
  562. + }
  563. +
  564. + if (__from_next < __from_end && __ret == ok)
  565. + {
  566. + extern_type __buf[MB_LEN_MAX];
  567. + __tmp_state = __state;
  568. + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
  569. + if (__conv > static_cast<size_t>(__to_end - __to_next))
  570. + __ret = partial;
  571. + else
  572. + {
  573. + memcpy(__to_next, __buf, __conv);
  574. + __state = __tmp_state;
  575. + __to_next += __conv;
  576. + ++__from_next;
  577. + }
  578. + }
  579. + }
  580. +
  581. +#ifdef __UCLIBC_HAS_XLOCALE__
  582. + __uselocale(__old);
  583. +#endif
  584. +
  585. + return __ret;
  586. + }
  587. +
  588. + codecvt_base::result
  589. + codecvt<wchar_t, char, mbstate_t>::
  590. + do_in(state_type& __state, const extern_type* __from,
  591. + const extern_type* __from_end, const extern_type*& __from_next,
  592. + intern_type* __to, intern_type* __to_end,
  593. + intern_type*& __to_next) const
  594. + {
  595. + result __ret = ok;
  596. + state_type __tmp_state(__state);
  597. +
  598. +#ifdef __UCLIBC_HAS_XLOCALE__
  599. + __c_locale __old = __uselocale(_M_c_locale_codecvt);
  600. +#endif
  601. +
  602. + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
  603. + // in case we store a L'\0' and then continue, in a loop.
  604. + // NB: mbsnrtowcs is a GNU extension
  605. + for (__from_next = __from, __to_next = __to;
  606. + __from_next < __from_end && __to_next < __to_end
  607. + && __ret == ok;)
  608. + {
  609. + const extern_type* __from_chunk_end;
  610. + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
  611. + __from_end
  612. + - __from_next));
  613. + if (!__from_chunk_end)
  614. + __from_chunk_end = __from_end;
  615. +
  616. + __from = __from_next;
  617. + size_t __conv = mbsnrtowcs(__to_next, &__from_next,
  618. + __from_chunk_end - __from_next,
  619. + __to_end - __to_next, &__state);
  620. + if (__conv == static_cast<size_t>(-1))
  621. + {
  622. + // In case of error, in order to stop at the exact place we
  623. + // have to start again from the beginning with a series of
  624. + // mbrtowc.
  625. + for (;; ++__to_next, __from += __conv)
  626. + {
  627. + __conv = mbrtowc(__to_next, __from, __from_end - __from,
  628. + &__tmp_state);
  629. + if (__conv == static_cast<size_t>(-1)
  630. + || __conv == static_cast<size_t>(-2))
  631. + break;
  632. + }
  633. + __from_next = __from;
  634. + __state = __tmp_state;
  635. + __ret = error;
  636. + }
  637. + else if (__from_next && __from_next < __from_chunk_end)
  638. + {
  639. + // It is unclear what to return in this case (see DR 382).
  640. + __to_next += __conv;
  641. + __ret = partial;
  642. + }
  643. + else
  644. + {
  645. + __from_next = __from_chunk_end;
  646. + __to_next += __conv;
  647. + }
  648. +
  649. + if (__from_next < __from_end && __ret == ok)
  650. + {
  651. + if (__to_next < __to_end)
  652. + {
  653. + // XXX Probably wrong for stateful encodings
  654. + __tmp_state = __state;
  655. + ++__from_next;
  656. + *__to_next++ = L'\0';
  657. + }
  658. + else
  659. + __ret = partial;
  660. + }
  661. + }
  662. +
  663. +#ifdef __UCLIBC_HAS_XLOCALE__
  664. + __uselocale(__old);
  665. +#endif
  666. +
  667. + return __ret;
  668. + }
  669. +
  670. + int
  671. + codecvt<wchar_t, char, mbstate_t>::
  672. + do_encoding() const throw()
  673. + {
  674. + // XXX This implementation assumes that the encoding is
  675. + // stateless and is either single-byte or variable-width.
  676. + int __ret = 0;
  677. +#ifdef __UCLIBC_HAS_XLOCALE__
  678. + __c_locale __old = __uselocale(_M_c_locale_codecvt);
  679. +#endif
  680. + if (MB_CUR_MAX == 1)
  681. + __ret = 1;
  682. +#ifdef __UCLIBC_HAS_XLOCALE__
  683. + __uselocale(__old);
  684. +#endif
  685. + return __ret;
  686. + }
  687. +
  688. + int
  689. + codecvt<wchar_t, char, mbstate_t>::
  690. + do_max_length() const throw()
  691. + {
  692. +#ifdef __UCLIBC_HAS_XLOCALE__
  693. + __c_locale __old = __uselocale(_M_c_locale_codecvt);
  694. +#endif
  695. + // XXX Probably wrong for stateful encodings.
  696. + int __ret = MB_CUR_MAX;
  697. +#ifdef __UCLIBC_HAS_XLOCALE__
  698. + __uselocale(__old);
  699. +#endif
  700. + return __ret;
  701. + }
  702. +
  703. + int
  704. + codecvt<wchar_t, char, mbstate_t>::
  705. + do_length(state_type& __state, const extern_type* __from,
  706. + const extern_type* __end, size_t __max) const
  707. + {
  708. + int __ret = 0;
  709. + state_type __tmp_state(__state);
  710. +
  711. +#ifdef __UCLIBC_HAS_XLOCALE__
  712. + __c_locale __old = __uselocale(_M_c_locale_codecvt);
  713. +#endif
  714. +
  715. + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
  716. + // in case we advance past it and then continue, in a loop.
  717. + // NB: mbsnrtowcs is a GNU extension
  718. +
  719. + // A dummy internal buffer is needed in order for mbsnrtocws to consider
  720. + // its fourth parameter (it wouldn't with NULL as first parameter).
  721. + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
  722. + * __max));
  723. + while (__from < __end && __max)
  724. + {
  725. + const extern_type* __from_chunk_end;
  726. + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
  727. + __end
  728. + - __from));
  729. + if (!__from_chunk_end)
  730. + __from_chunk_end = __end;
  731. +
  732. + const extern_type* __tmp_from = __from;
  733. + size_t __conv = mbsnrtowcs(__to, &__from,
  734. + __from_chunk_end - __from,
  735. + __max, &__state);
  736. + if (__conv == static_cast<size_t>(-1))
  737. + {
  738. + // In case of error, in order to stop at the exact place we
  739. + // have to start again from the beginning with a series of
  740. + // mbrtowc.
  741. + for (__from = __tmp_from;; __from += __conv)
  742. + {
  743. + __conv = mbrtowc(NULL, __from, __end - __from,
  744. + &__tmp_state);
  745. + if (__conv == static_cast<size_t>(-1)
  746. + || __conv == static_cast<size_t>(-2))
  747. + break;
  748. + }
  749. + __state = __tmp_state;
  750. + __ret += __from - __tmp_from;
  751. + break;
  752. + }
  753. + if (!__from)
  754. + __from = __from_chunk_end;
  755. +
  756. + __ret += __from - __tmp_from;
  757. + __max -= __conv;
  758. +
  759. + if (__from < __end && __max)
  760. + {
  761. + // XXX Probably wrong for stateful encodings
  762. + __tmp_state = __state;
  763. + ++__from;
  764. + ++__ret;
  765. + --__max;
  766. + }
  767. + }
  768. +
  769. +#ifdef __UCLIBC_HAS_XLOCALE__
  770. + __uselocale(__old);
  771. +#endif
  772. +
  773. + return __ret;
  774. + }
  775. +#endif
  776. +}
  777. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
  778. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
  779. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2004-08-12 17:08:19.000000000 -0500
  780. @@ -0,0 +1,80 @@
  781. +// std::collate implementation details, GNU version -*- C++ -*-
  782. +
  783. +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
  784. +//
  785. +// This file is part of the GNU ISO C++ Library. This library is free
  786. +// software; you can redistribute it and/or modify it under the
  787. +// terms of the GNU General Public License as published by the
  788. +// Free Software Foundation; either version 2, or (at your option)
  789. +// any later version.
  790. +
  791. +// This library is distributed in the hope that it will be useful,
  792. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  793. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  794. +// GNU General Public License for more details.
  795. +
  796. +// You should have received a copy of the GNU General Public License along
  797. +// with this library; see the file COPYING. If not, write to the Free
  798. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  799. +// USA.
  800. +
  801. +// As a special exception, you may use this file as part of a free software
  802. +// library without restriction. Specifically, if other files instantiate
  803. +// templates or use macros or inline functions from this file, or you compile
  804. +// this file and link it with other files to produce an executable, this
  805. +// file does not by itself cause the resulting executable to be covered by
  806. +// the GNU General Public License. This exception does not however
  807. +// invalidate any other reasons why the executable file might be covered by
  808. +// the GNU General Public License.
  809. +
  810. +//
  811. +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
  812. +//
  813. +
  814. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  815. +
  816. +#include <locale>
  817. +#include <bits/c++locale_internal.h>
  818. +
  819. +#ifndef __UCLIBC_HAS_XLOCALE__
  820. +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
  821. +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
  822. +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
  823. +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
  824. +#endif
  825. +
  826. +namespace std
  827. +{
  828. + // These are basically extensions to char_traits, and perhaps should
  829. + // be put there instead of here.
  830. + template<>
  831. + int
  832. + collate<char>::_M_compare(const char* __one, const char* __two) const
  833. + {
  834. + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
  835. + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
  836. + }
  837. +
  838. + template<>
  839. + size_t
  840. + collate<char>::_M_transform(char* __to, const char* __from,
  841. + size_t __n) const
  842. + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
  843. +
  844. +#ifdef _GLIBCXX_USE_WCHAR_T
  845. + template<>
  846. + int
  847. + collate<wchar_t>::_M_compare(const wchar_t* __one,
  848. + const wchar_t* __two) const
  849. + {
  850. + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
  851. + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
  852. + }
  853. +
  854. + template<>
  855. + size_t
  856. + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
  857. + size_t __n) const
  858. + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
  859. +#endif
  860. +}
  861. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
  862. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
  863. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2004-08-12 17:08:19.000000000 -0500
  864. @@ -0,0 +1,300 @@
  865. +// std::ctype implementation details, GNU version -*- C++ -*-
  866. +
  867. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  868. +//
  869. +// This file is part of the GNU ISO C++ Library. This library is free
  870. +// software; you can redistribute it and/or modify it under the
  871. +// terms of the GNU General Public License as published by the
  872. +// Free Software Foundation; either version 2, or (at your option)
  873. +// any later version.
  874. +
  875. +// This library is distributed in the hope that it will be useful,
  876. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  877. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  878. +// GNU General Public License for more details.
  879. +
  880. +// You should have received a copy of the GNU General Public License along
  881. +// with this library; see the file COPYING. If not, write to the Free
  882. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  883. +// USA.
  884. +
  885. +// As a special exception, you may use this file as part of a free software
  886. +// library without restriction. Specifically, if other files instantiate
  887. +// templates or use macros or inline functions from this file, or you compile
  888. +// this file and link it with other files to produce an executable, this
  889. +// file does not by itself cause the resulting executable to be covered by
  890. +// the GNU General Public License. This exception does not however
  891. +// invalidate any other reasons why the executable file might be covered by
  892. +// the GNU General Public License.
  893. +
  894. +//
  895. +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
  896. +//
  897. +
  898. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  899. +
  900. +#define _LIBC
  901. +#include <locale>
  902. +#undef _LIBC
  903. +#include <bits/c++locale_internal.h>
  904. +
  905. +#ifndef __UCLIBC_HAS_XLOCALE__
  906. +#define __wctype_l(S, L) wctype((S))
  907. +#define __towupper_l(C, L) towupper((C))
  908. +#define __towlower_l(C, L) towlower((C))
  909. +#define __iswctype_l(C, M, L) iswctype((C), (M))
  910. +#endif
  911. +
  912. +namespace std
  913. +{
  914. + // NB: The other ctype<char> specializations are in src/locale.cc and
  915. + // various /config/os/* files.
  916. + template<>
  917. + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
  918. + : ctype<char>(0, false, __refs)
  919. + {
  920. + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
  921. + {
  922. + _S_destroy_c_locale(_M_c_locale_ctype);
  923. + _S_create_c_locale(_M_c_locale_ctype, __s);
  924. +#ifdef __UCLIBC_HAS_XLOCALE__
  925. + _M_toupper = _M_c_locale_ctype->__ctype_toupper;
  926. + _M_tolower = _M_c_locale_ctype->__ctype_tolower;
  927. + _M_table = _M_c_locale_ctype->__ctype_b;
  928. +#endif
  929. + }
  930. + }
  931. +
  932. +#ifdef _GLIBCXX_USE_WCHAR_T
  933. + ctype<wchar_t>::__wmask_type
  934. + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
  935. + {
  936. + __wmask_type __ret;
  937. + switch (__m)
  938. + {
  939. + case space:
  940. + __ret = __wctype_l("space", _M_c_locale_ctype);
  941. + break;
  942. + case print:
  943. + __ret = __wctype_l("print", _M_c_locale_ctype);
  944. + break;
  945. + case cntrl:
  946. + __ret = __wctype_l("cntrl", _M_c_locale_ctype);
  947. + break;
  948. + case upper:
  949. + __ret = __wctype_l("upper", _M_c_locale_ctype);
  950. + break;
  951. + case lower:
  952. + __ret = __wctype_l("lower", _M_c_locale_ctype);
  953. + break;
  954. + case alpha:
  955. + __ret = __wctype_l("alpha", _M_c_locale_ctype);
  956. + break;
  957. + case digit:
  958. + __ret = __wctype_l("digit", _M_c_locale_ctype);
  959. + break;
  960. + case punct:
  961. + __ret = __wctype_l("punct", _M_c_locale_ctype);
  962. + break;
  963. + case xdigit:
  964. + __ret = __wctype_l("xdigit", _M_c_locale_ctype);
  965. + break;
  966. + case alnum:
  967. + __ret = __wctype_l("alnum", _M_c_locale_ctype);
  968. + break;
  969. + case graph:
  970. + __ret = __wctype_l("graph", _M_c_locale_ctype);
  971. + break;
  972. + default:
  973. + __ret = 0;
  974. + }
  975. + return __ret;
  976. + }
  977. +
  978. + wchar_t
  979. + ctype<wchar_t>::do_toupper(wchar_t __c) const
  980. + { return __towupper_l(__c, _M_c_locale_ctype); }
  981. +
  982. + const wchar_t*
  983. + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
  984. + {
  985. + while (__lo < __hi)
  986. + {
  987. + *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
  988. + ++__lo;
  989. + }
  990. + return __hi;
  991. + }
  992. +
  993. + wchar_t
  994. + ctype<wchar_t>::do_tolower(wchar_t __c) const
  995. + { return __towlower_l(__c, _M_c_locale_ctype); }
  996. +
  997. + const wchar_t*
  998. + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
  999. + {
  1000. + while (__lo < __hi)
  1001. + {
  1002. + *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
  1003. + ++__lo;
  1004. + }
  1005. + return __hi;
  1006. + }
  1007. +
  1008. + bool
  1009. + ctype<wchar_t>::
  1010. + do_is(mask __m, wchar_t __c) const
  1011. + {
  1012. + // Highest bitmask in ctype_base == 10, but extra in "C"
  1013. + // library for blank.
  1014. + bool __ret = false;
  1015. + const size_t __bitmasksize = 11;
  1016. + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
  1017. + if (__m & _M_bit[__bitcur]
  1018. + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
  1019. + {
  1020. + __ret = true;
  1021. + break;
  1022. + }
  1023. + return __ret;
  1024. + }
  1025. +
  1026. + const wchar_t*
  1027. + ctype<wchar_t>::
  1028. + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
  1029. + {
  1030. + for (; __lo < __hi; ++__vec, ++__lo)
  1031. + {
  1032. + // Highest bitmask in ctype_base == 10, but extra in "C"
  1033. + // library for blank.
  1034. + const size_t __bitmasksize = 11;
  1035. + mask __m = 0;
  1036. + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
  1037. + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
  1038. + __m |= _M_bit[__bitcur];
  1039. + *__vec = __m;
  1040. + }
  1041. + return __hi;
  1042. + }
  1043. +
  1044. + const wchar_t*
  1045. + ctype<wchar_t>::
  1046. + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
  1047. + {
  1048. + while (__lo < __hi && !this->do_is(__m, *__lo))
  1049. + ++__lo;
  1050. + return __lo;
  1051. + }
  1052. +
  1053. + const wchar_t*
  1054. + ctype<wchar_t>::
  1055. + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
  1056. + {
  1057. + while (__lo < __hi && this->do_is(__m, *__lo) != 0)
  1058. + ++__lo;
  1059. + return __lo;
  1060. + }
  1061. +
  1062. + wchar_t
  1063. + ctype<wchar_t>::
  1064. + do_widen(char __c) const
  1065. + { return _M_widen[static_cast<unsigned char>(__c)]; }
  1066. +
  1067. + const char*
  1068. + ctype<wchar_t>::
  1069. + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
  1070. + {
  1071. + while (__lo < __hi)
  1072. + {
  1073. + *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
  1074. + ++__lo;
  1075. + ++__dest;
  1076. + }
  1077. + return __hi;
  1078. + }
  1079. +
  1080. + char
  1081. + ctype<wchar_t>::
  1082. + do_narrow(wchar_t __wc, char __dfault) const
  1083. + {
  1084. + if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
  1085. + return _M_narrow[__wc];
  1086. +#ifdef __UCLIBC_HAS_XLOCALE__
  1087. + __c_locale __old = __uselocale(_M_c_locale_ctype);
  1088. +#endif
  1089. + const int __c = wctob(__wc);
  1090. +#ifdef __UCLIBC_HAS_XLOCALE__
  1091. + __uselocale(__old);
  1092. +#endif
  1093. + return (__c == EOF ? __dfault : static_cast<char>(__c));
  1094. + }
  1095. +
  1096. + const wchar_t*
  1097. + ctype<wchar_t>::
  1098. + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
  1099. + char* __dest) const
  1100. + {
  1101. +#ifdef __UCLIBC_HAS_XLOCALE__
  1102. + __c_locale __old = __uselocale(_M_c_locale_ctype);
  1103. +#endif
  1104. + if (_M_narrow_ok)
  1105. + while (__lo < __hi)
  1106. + {
  1107. + if (*__lo >= 0 && *__lo < 128)
  1108. + *__dest = _M_narrow[*__lo];
  1109. + else
  1110. + {
  1111. + const int __c = wctob(*__lo);
  1112. + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
  1113. + }
  1114. + ++__lo;
  1115. + ++__dest;
  1116. + }
  1117. + else
  1118. + while (__lo < __hi)
  1119. + {
  1120. + const int __c = wctob(*__lo);
  1121. + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
  1122. + ++__lo;
  1123. + ++__dest;
  1124. + }
  1125. +#ifdef __UCLIBC_HAS_XLOCALE__
  1126. + __uselocale(__old);
  1127. +#endif
  1128. + return __hi;
  1129. + }
  1130. +
  1131. + void
  1132. + ctype<wchar_t>::_M_initialize_ctype()
  1133. + {
  1134. +#ifdef __UCLIBC_HAS_XLOCALE__
  1135. + __c_locale __old = __uselocale(_M_c_locale_ctype);
  1136. +#endif
  1137. + wint_t __i;
  1138. + for (__i = 0; __i < 128; ++__i)
  1139. + {
  1140. + const int __c = wctob(__i);
  1141. + if (__c == EOF)
  1142. + break;
  1143. + else
  1144. + _M_narrow[__i] = static_cast<char>(__c);
  1145. + }
  1146. + if (__i == 128)
  1147. + _M_narrow_ok = true;
  1148. + else
  1149. + _M_narrow_ok = false;
  1150. + for (size_t __i = 0;
  1151. + __i < sizeof(_M_widen) / sizeof(wint_t); ++__i)
  1152. + _M_widen[__i] = btowc(__i);
  1153. +
  1154. + for (size_t __i = 0; __i <= 11; ++__i)
  1155. + {
  1156. + _M_bit[__i] = static_cast<mask>(_ISbit(__i));
  1157. + _M_wmask[__i] = _M_convert_to_wmask(_M_bit[__i]);
  1158. + }
  1159. +#ifdef __UCLIBC_HAS_XLOCALE__
  1160. + __uselocale(__old);
  1161. +#endif
  1162. + }
  1163. +#endif // _GLIBCXX_USE_WCHAR_T
  1164. +}
  1165. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
  1166. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
  1167. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2004-08-12 17:08:19.000000000 -0500
  1168. @@ -0,0 +1,100 @@
  1169. +// std::messages implementation details, GNU version -*- C++ -*-
  1170. +
  1171. +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
  1172. +//
  1173. +// This file is part of the GNU ISO C++ Library. This library is free
  1174. +// software; you can redistribute it and/or modify it under the
  1175. +// terms of the GNU General Public License as published by the
  1176. +// Free Software Foundation; either version 2, or (at your option)
  1177. +// any later version.
  1178. +
  1179. +// This library is distributed in the hope that it will be useful,
  1180. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  1181. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1182. +// GNU General Public License for more details.
  1183. +
  1184. +// You should have received a copy of the GNU General Public License along
  1185. +// with this library; see the file COPYING. If not, write to the Free
  1186. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  1187. +// USA.
  1188. +
  1189. +// As a special exception, you may use this file as part of a free software
  1190. +// library without restriction. Specifically, if other files instantiate
  1191. +// templates or use macros or inline functions from this file, or you compile
  1192. +// this file and link it with other files to produce an executable, this
  1193. +// file does not by itself cause the resulting executable to be covered by
  1194. +// the GNU General Public License. This exception does not however
  1195. +// invalidate any other reasons why the executable file might be covered by
  1196. +// the GNU General Public License.
  1197. +
  1198. +//
  1199. +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
  1200. +//
  1201. +
  1202. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  1203. +
  1204. +#include <locale>
  1205. +#include <bits/c++locale_internal.h>
  1206. +
  1207. +#ifdef __UCLIBC_MJN3_ONLY__
  1208. +#warning fix gettext stuff
  1209. +#endif
  1210. +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  1211. +extern "C" char *__dcgettext(const char *domainname,
  1212. + const char *msgid, int category);
  1213. +#undef gettext
  1214. +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
  1215. +#else
  1216. +#undef gettext
  1217. +#define gettext(msgid) (msgid)
  1218. +#endif
  1219. +
  1220. +namespace std
  1221. +{
  1222. + // Specializations.
  1223. + template<>
  1224. + string
  1225. + messages<char>::do_get(catalog, int, int, const string& __dfault) const
  1226. + {
  1227. +#ifdef __UCLIBC_HAS_XLOCALE__
  1228. + __c_locale __old = __uselocale(_M_c_locale_messages);
  1229. + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
  1230. + __uselocale(__old);
  1231. + return string(__msg);
  1232. +#elif defined __UCLIBC_HAS_LOCALE__
  1233. + char* __old = strdup(setlocale(LC_ALL, NULL));
  1234. + setlocale(LC_ALL, _M_name_messages);
  1235. + const char* __msg = gettext(__dfault.c_str());
  1236. + setlocale(LC_ALL, __old);
  1237. + free(__old);
  1238. + return string(__msg);
  1239. +#else
  1240. + const char* __msg = gettext(__dfault.c_str());
  1241. + return string(__msg);
  1242. +#endif
  1243. + }
  1244. +
  1245. +#ifdef _GLIBCXX_USE_WCHAR_T
  1246. + template<>
  1247. + wstring
  1248. + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
  1249. + {
  1250. +# ifdef __UCLIBC_HAS_XLOCALE__
  1251. + __c_locale __old = __uselocale(_M_c_locale_messages);
  1252. + char* __msg = gettext(_M_convert_to_char(__dfault));
  1253. + __uselocale(__old);
  1254. + return _M_convert_from_char(__msg);
  1255. +# elif defined __UCLIBC_HAS_LOCALE__
  1256. + char* __old = strdup(setlocale(LC_ALL, NULL));
  1257. + setlocale(LC_ALL, _M_name_messages);
  1258. + char* __msg = gettext(_M_convert_to_char(__dfault));
  1259. + setlocale(LC_ALL, __old);
  1260. + free(__old);
  1261. + return _M_convert_from_char(__msg);
  1262. +# else
  1263. + char* __msg = gettext(_M_convert_to_char(__dfault));
  1264. + return _M_convert_from_char(__msg);
  1265. +# endif
  1266. + }
  1267. +#endif
  1268. +}
  1269. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.h
  1270. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
  1271. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2004-08-12 17:08:19.000000000 -0500
  1272. @@ -0,0 +1,109 @@
  1273. +// std::messages implementation details, GNU version -*- C++ -*-
  1274. +
  1275. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  1276. +//
  1277. +// This file is part of the GNU ISO C++ Library. This library is free
  1278. +// software; you can redistribute it and/or modify it under the
  1279. +// terms of the GNU General Public License as published by the
  1280. +// Free Software Foundation; either version 2, or (at your option)
  1281. +// any later version.
  1282. +
  1283. +// This library is distributed in the hope that it will be useful,
  1284. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  1285. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1286. +// GNU General Public License for more details.
  1287. +
  1288. +// You should have received a copy of the GNU General Public License along
  1289. +// with this library; see the file COPYING. If not, write to the Free
  1290. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  1291. +// USA.
  1292. +
  1293. +// As a special exception, you may use this file as part of a free software
  1294. +// library without restriction. Specifically, if other files instantiate
  1295. +// templates or use macros or inline functions from this file, or you compile
  1296. +// this file and link it with other files to produce an executable, this
  1297. +// file does not by itself cause the resulting executable to be covered by
  1298. +// the GNU General Public License. This exception does not however
  1299. +// invalidate any other reasons why the executable file might be covered by
  1300. +// the GNU General Public License.
  1301. +
  1302. +//
  1303. +// ISO C++ 14882: 22.2.7.1.2 messages functions
  1304. +//
  1305. +
  1306. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  1307. +
  1308. +#ifdef __UCLIBC_MJN3_ONLY__
  1309. +#warning fix prototypes for *textdomain funcs
  1310. +#endif
  1311. +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
  1312. +extern "C" char *__textdomain(const char *domainname);
  1313. +extern "C" char *__bindtextdomain(const char *domainname,
  1314. + const char *dirname);
  1315. +#else
  1316. +#undef __textdomain
  1317. +#undef __bindtextdomain
  1318. +#define __textdomain(D) ((void)0)
  1319. +#define __bindtextdomain(D,P) ((void)0)
  1320. +#endif
  1321. +
  1322. + // Non-virtual member functions.
  1323. + template<typename _CharT>
  1324. + messages<_CharT>::messages(size_t __refs)
  1325. + : facet(__refs)
  1326. + {
  1327. + _M_c_locale_messages = _S_get_c_locale();
  1328. + }
  1329. +
  1330. + template<typename _CharT>
  1331. + messages<_CharT>::messages(__c_locale __cloc,
  1332. + const char* __s __attribute__ ((__unused__)),
  1333. + size_t __refs)
  1334. + : facet(__refs)
  1335. + {
  1336. + _M_c_locale_messages = _S_clone_c_locale(__cloc);
  1337. + }
  1338. +
  1339. + template<typename _CharT>
  1340. + typename messages<_CharT>::catalog
  1341. + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
  1342. + const char* __dir) const
  1343. + {
  1344. + __bindtextdomain(__s.c_str(), __dir);
  1345. + return this->do_open(__s, __loc);
  1346. + }
  1347. +
  1348. + // Virtual member functions.
  1349. + template<typename _CharT>
  1350. + messages<_CharT>::~messages()
  1351. + {
  1352. + _S_destroy_c_locale(_M_c_locale_messages);
  1353. + }
  1354. +
  1355. + template<typename _CharT>
  1356. + typename messages<_CharT>::catalog
  1357. + messages<_CharT>::do_open(const basic_string<char>& __s,
  1358. + const locale&) const
  1359. + {
  1360. + // No error checking is done, assume the catalog exists and can
  1361. + // be used.
  1362. + __textdomain(__s.c_str());
  1363. + return 0;
  1364. + }
  1365. +
  1366. + template<typename _CharT>
  1367. + void
  1368. + messages<_CharT>::do_close(catalog) const
  1369. + { }
  1370. +
  1371. + // messages_byname
  1372. + template<typename _CharT>
  1373. + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
  1374. + : messages<_CharT>(__refs)
  1375. + {
  1376. + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
  1377. + {
  1378. + _S_destroy_c_locale(this->_M_c_locale_messages);
  1379. + _S_create_c_locale(this->_M_c_locale_messages, __s);
  1380. + }
  1381. + }
  1382. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
  1383. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
  1384. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2004-08-12 17:08:19.000000000 -0500
  1385. @@ -0,0 +1,698 @@
  1386. +// std::moneypunct implementation details, GNU version -*- C++ -*-
  1387. +
  1388. +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  1389. +//
  1390. +// This file is part of the GNU ISO C++ Library. This library is free
  1391. +// software; you can redistribute it and/or modify it under the
  1392. +// terms of the GNU General Public License as published by the
  1393. +// Free Software Foundation; either version 2, or (at your option)
  1394. +// any later version.
  1395. +
  1396. +// This library is distributed in the hope that it will be useful,
  1397. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  1398. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1399. +// GNU General Public License for more details.
  1400. +
  1401. +// You should have received a copy of the GNU General Public License along
  1402. +// with this library; see the file COPYING. If not, write to the Free
  1403. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  1404. +// USA.
  1405. +
  1406. +// As a special exception, you may use this file as part of a free software
  1407. +// library without restriction. Specifically, if other files instantiate
  1408. +// templates or use macros or inline functions from this file, or you compile
  1409. +// this file and link it with other files to produce an executable, this
  1410. +// file does not by itself cause the resulting executable to be covered by
  1411. +// the GNU General Public License. This exception does not however
  1412. +// invalidate any other reasons why the executable file might be covered by
  1413. +// the GNU General Public License.
  1414. +
  1415. +//
  1416. +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
  1417. +//
  1418. +
  1419. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  1420. +
  1421. +#define _LIBC
  1422. +#include <locale>
  1423. +#undef _LIBC
  1424. +#include <bits/c++locale_internal.h>
  1425. +
  1426. +#ifdef __UCLIBC_MJN3_ONLY__
  1427. +#warning optimize this for uclibc
  1428. +#warning tailor for stub locale support
  1429. +#endif
  1430. +
  1431. +#ifndef __UCLIBC_HAS_XLOCALE__
  1432. +#define __nl_langinfo_l(N, L) nl_langinfo((N))
  1433. +#endif
  1434. +
  1435. +namespace std
  1436. +{
  1437. + // Construct and return valid pattern consisting of some combination of:
  1438. + // space none symbol sign value
  1439. + money_base::pattern
  1440. + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
  1441. + {
  1442. + pattern __ret;
  1443. +
  1444. + // This insanely complicated routine attempts to construct a valid
  1445. + // pattern for use with monyepunct. A couple of invariants:
  1446. +
  1447. + // if (__precedes) symbol -> value
  1448. + // else value -> symbol
  1449. +
  1450. + // if (__space) space
  1451. + // else none
  1452. +
  1453. + // none == never first
  1454. + // space never first or last
  1455. +
  1456. + // Any elegant implementations of this are welcome.
  1457. + switch (__posn)
  1458. + {
  1459. + case 0:
  1460. + case 1:
  1461. + // 1 The sign precedes the value and symbol.
  1462. + __ret.field[0] = sign;
  1463. + if (__space)
  1464. + {
  1465. + // Pattern starts with sign.
  1466. + if (__precedes)
  1467. + {
  1468. + __ret.field[1] = symbol;
  1469. + __ret.field[3] = value;
  1470. + }
  1471. + else
  1472. + {
  1473. + __ret.field[1] = value;
  1474. + __ret.field[3] = symbol;
  1475. + }
  1476. + __ret.field[2] = space;
  1477. + }
  1478. + else
  1479. + {
  1480. + // Pattern starts with sign and ends with none.
  1481. + if (__precedes)
  1482. + {
  1483. + __ret.field[1] = symbol;
  1484. + __ret.field[2] = value;
  1485. + }
  1486. + else
  1487. + {
  1488. + __ret.field[1] = value;
  1489. + __ret.field[2] = symbol;
  1490. + }
  1491. + __ret.field[3] = none;
  1492. + }
  1493. + break;
  1494. + case 2:
  1495. + // 2 The sign follows the value and symbol.
  1496. + if (__space)
  1497. + {
  1498. + // Pattern either ends with sign.
  1499. + if (__precedes)
  1500. + {
  1501. + __ret.field[0] = symbol;
  1502. + __ret.field[2] = value;
  1503. + }
  1504. + else
  1505. + {
  1506. + __ret.field[0] = value;
  1507. + __ret.field[2] = symbol;
  1508. + }
  1509. + __ret.field[1] = space;
  1510. + __ret.field[3] = sign;
  1511. + }
  1512. + else
  1513. + {
  1514. + // Pattern ends with sign then none.
  1515. + if (__precedes)
  1516. + {
  1517. + __ret.field[0] = symbol;
  1518. + __ret.field[1] = value;
  1519. + }
  1520. + else
  1521. + {
  1522. + __ret.field[0] = value;
  1523. + __ret.field[1] = symbol;
  1524. + }
  1525. + __ret.field[2] = sign;
  1526. + __ret.field[3] = none;
  1527. + }
  1528. + break;
  1529. + case 3:
  1530. + // 3 The sign immediately precedes the symbol.
  1531. + if (__precedes)
  1532. + {
  1533. + __ret.field[0] = sign;
  1534. + __ret.field[1] = symbol;
  1535. + if (__space)
  1536. + {
  1537. + __ret.field[2] = space;
  1538. + __ret.field[3] = value;
  1539. + }
  1540. + else
  1541. + {
  1542. + __ret.field[2] = value;
  1543. + __ret.field[3] = none;
  1544. + }
  1545. + }
  1546. + else
  1547. + {
  1548. + __ret.field[0] = value;
  1549. + if (__space)
  1550. + {
  1551. + __ret.field[1] = space;
  1552. + __ret.field[2] = sign;
  1553. + __ret.field[3] = symbol;
  1554. + }
  1555. + else
  1556. + {
  1557. + __ret.field[1] = sign;
  1558. + __ret.field[2] = symbol;
  1559. + __ret.field[3] = none;
  1560. + }
  1561. + }
  1562. + break;
  1563. + case 4:
  1564. + // 4 The sign immediately follows the symbol.
  1565. + if (__precedes)
  1566. + {
  1567. + __ret.field[0] = symbol;
  1568. + __ret.field[1] = sign;
  1569. + if (__space)
  1570. + {
  1571. + __ret.field[2] = space;
  1572. + __ret.field[3] = value;
  1573. + }
  1574. + else
  1575. + {
  1576. + __ret.field[2] = value;
  1577. + __ret.field[3] = none;
  1578. + }
  1579. + }
  1580. + else
  1581. + {
  1582. + __ret.field[0] = value;
  1583. + if (__space)
  1584. + {
  1585. + __ret.field[1] = space;
  1586. + __ret.field[2] = symbol;
  1587. + __ret.field[3] = sign;
  1588. + }
  1589. + else
  1590. + {
  1591. + __ret.field[1] = symbol;
  1592. + __ret.field[2] = sign;
  1593. + __ret.field[3] = none;
  1594. + }
  1595. + }
  1596. + break;
  1597. + default:
  1598. + ;
  1599. + }
  1600. + return __ret;
  1601. + }
  1602. +
  1603. + template<>
  1604. + void
  1605. + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
  1606. + const char*)
  1607. + {
  1608. + if (!_M_data)
  1609. + _M_data = new __moneypunct_cache<char, true>;
  1610. +
  1611. + if (!__cloc)
  1612. + {
  1613. + // "C" locale
  1614. + _M_data->_M_decimal_point = '.';
  1615. + _M_data->_M_thousands_sep = ',';
  1616. + _M_data->_M_grouping = "";
  1617. + _M_data->_M_grouping_size = 0;
  1618. + _M_data->_M_curr_symbol = "";
  1619. + _M_data->_M_curr_symbol_size = 0;
  1620. + _M_data->_M_positive_sign = "";
  1621. + _M_data->_M_positive_sign_size = 0;
  1622. + _M_data->_M_negative_sign = "";
  1623. + _M_data->_M_negative_sign_size = 0;
  1624. + _M_data->_M_frac_digits = 0;
  1625. + _M_data->_M_pos_format = money_base::_S_default_pattern;
  1626. + _M_data->_M_neg_format = money_base::_S_default_pattern;
  1627. +
  1628. + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
  1629. + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
  1630. + }
  1631. + else
  1632. + {
  1633. + // Named locale.
  1634. + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
  1635. + __cloc));
  1636. + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
  1637. + __cloc));
  1638. + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
  1639. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  1640. + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
  1641. + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
  1642. +
  1643. + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
  1644. + if (!__nposn)
  1645. + _M_data->_M_negative_sign = "()";
  1646. + else
  1647. + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
  1648. + __cloc);
  1649. + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
  1650. +
  1651. + // _Intl == true
  1652. + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
  1653. + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
  1654. + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
  1655. + __cloc));
  1656. + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
  1657. + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
  1658. + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
  1659. + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
  1660. + __pposn);
  1661. + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
  1662. + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
  1663. + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
  1664. + __nposn);
  1665. + }
  1666. + }
  1667. +
  1668. + template<>
  1669. + void
  1670. + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
  1671. + const char*)
  1672. + {
  1673. + if (!_M_data)
  1674. + _M_data = new __moneypunct_cache<char, false>;
  1675. +
  1676. + if (!__cloc)
  1677. + {
  1678. + // "C" locale
  1679. + _M_data->_M_decimal_point = '.';
  1680. + _M_data->_M_thousands_sep = ',';
  1681. + _M_data->_M_grouping = "";
  1682. + _M_data->_M_grouping_size = 0;
  1683. + _M_data->_M_curr_symbol = "";
  1684. + _M_data->_M_curr_symbol_size = 0;
  1685. + _M_data->_M_positive_sign = "";
  1686. + _M_data->_M_positive_sign_size = 0;
  1687. + _M_data->_M_negative_sign = "";
  1688. + _M_data->_M_negative_sign_size = 0;
  1689. + _M_data->_M_frac_digits = 0;
  1690. + _M_data->_M_pos_format = money_base::_S_default_pattern;
  1691. + _M_data->_M_neg_format = money_base::_S_default_pattern;
  1692. +
  1693. + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
  1694. + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
  1695. + }
  1696. + else
  1697. + {
  1698. + // Named locale.
  1699. + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
  1700. + __cloc));
  1701. + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
  1702. + __cloc));
  1703. + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
  1704. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  1705. + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
  1706. + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
  1707. +
  1708. + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
  1709. + if (!__nposn)
  1710. + _M_data->_M_negative_sign = "()";
  1711. + else
  1712. + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
  1713. + __cloc);
  1714. + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
  1715. +
  1716. + // _Intl == false
  1717. + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
  1718. + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
  1719. + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
  1720. + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
  1721. + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
  1722. + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
  1723. + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
  1724. + __pposn);
  1725. + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
  1726. + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
  1727. + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
  1728. + __nposn);
  1729. + }
  1730. + }
  1731. +
  1732. + template<>
  1733. + moneypunct<char, true>::~moneypunct()
  1734. + { delete _M_data; }
  1735. +
  1736. + template<>
  1737. + moneypunct<char, false>::~moneypunct()
  1738. + { delete _M_data; }
  1739. +
  1740. +#ifdef _GLIBCXX_USE_WCHAR_T
  1741. + template<>
  1742. + void
  1743. + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
  1744. +#ifdef __UCLIBC_HAS_XLOCALE__
  1745. + const char*)
  1746. +#else
  1747. + const char* __name)
  1748. +#endif
  1749. + {
  1750. + if (!_M_data)
  1751. + _M_data = new __moneypunct_cache<wchar_t, true>;
  1752. +
  1753. + if (!__cloc)
  1754. + {
  1755. + // "C" locale
  1756. + _M_data->_M_decimal_point = L'.';
  1757. + _M_data->_M_thousands_sep = L',';
  1758. + _M_data->_M_grouping = "";
  1759. + _M_data->_M_grouping_size = 0;
  1760. + _M_data->_M_curr_symbol = L"";
  1761. + _M_data->_M_curr_symbol_size = 0;
  1762. + _M_data->_M_positive_sign = L"";
  1763. + _M_data->_M_positive_sign_size = 0;
  1764. + _M_data->_M_negative_sign = L"";
  1765. + _M_data->_M_negative_sign_size = 0;
  1766. + _M_data->_M_frac_digits = 0;
  1767. + _M_data->_M_pos_format = money_base::_S_default_pattern;
  1768. + _M_data->_M_neg_format = money_base::_S_default_pattern;
  1769. +
  1770. + // Use ctype::widen code without the facet...
  1771. + unsigned char uc;
  1772. + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
  1773. + {
  1774. + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
  1775. + _M_data->_M_atoms[__i] = btowc(uc);
  1776. + }
  1777. + }
  1778. + else
  1779. + {
  1780. + // Named locale.
  1781. +#ifdef __UCLIBC_HAS_XLOCALE__
  1782. + __c_locale __old = __uselocale(__cloc);
  1783. +#else
  1784. + // Switch to named locale so that mbsrtowcs will work.
  1785. + char* __old = strdup(setlocale(LC_ALL, NULL));
  1786. + setlocale(LC_ALL, __name);
  1787. +#endif
  1788. +
  1789. +#ifdef __UCLIBC_MJN3_ONLY__
  1790. +#warning fix this... should be monetary
  1791. +#endif
  1792. +#ifdef __UCLIBC__
  1793. +# ifdef __UCLIBC_HAS_XLOCALE__
  1794. + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  1795. + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  1796. +# else
  1797. + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  1798. + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  1799. +# endif
  1800. +#else
  1801. + union __s_and_w { const char *__s; unsigned int __w; } __u;
  1802. + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
  1803. + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
  1804. +
  1805. + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
  1806. + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
  1807. +#endif
  1808. + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
  1809. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  1810. +
  1811. + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
  1812. + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
  1813. + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
  1814. +
  1815. + wchar_t* __wcs_ps = 0;
  1816. + wchar_t* __wcs_ns = 0;
  1817. + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
  1818. + try
  1819. + {
  1820. + mbstate_t __state;
  1821. + size_t __len = strlen(__cpossign);
  1822. + if (__len)
  1823. + {
  1824. + ++__len;
  1825. + memset(&__state, 0, sizeof(mbstate_t));
  1826. + __wcs_ps = new wchar_t[__len];
  1827. + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
  1828. + _M_data->_M_positive_sign = __wcs_ps;
  1829. + }
  1830. + else
  1831. + _M_data->_M_positive_sign = L"";
  1832. + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
  1833. +
  1834. + __len = strlen(__cnegsign);
  1835. + if (!__nposn)
  1836. + _M_data->_M_negative_sign = L"()";
  1837. + else if (__len)
  1838. + {
  1839. + ++__len;
  1840. + memset(&__state, 0, sizeof(mbstate_t));
  1841. + __wcs_ns = new wchar_t[__len];
  1842. + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
  1843. + _M_data->_M_negative_sign = __wcs_ns;
  1844. + }
  1845. + else
  1846. + _M_data->_M_negative_sign = L"";
  1847. + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
  1848. +
  1849. + // _Intl == true.
  1850. + __len = strlen(__ccurr);
  1851. + if (__len)
  1852. + {
  1853. + ++__len;
  1854. + memset(&__state, 0, sizeof(mbstate_t));
  1855. + wchar_t* __wcs = new wchar_t[__len];
  1856. + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
  1857. + _M_data->_M_curr_symbol = __wcs;
  1858. + }
  1859. + else
  1860. + _M_data->_M_curr_symbol = L"";
  1861. + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
  1862. + }
  1863. + catch (...)
  1864. + {
  1865. + delete _M_data;
  1866. + _M_data = 0;
  1867. + delete __wcs_ps;
  1868. + delete __wcs_ns;
  1869. +#ifdef __UCLIBC_HAS_XLOCALE__
  1870. + __uselocale(__old);
  1871. +#else
  1872. + setlocale(LC_ALL, __old);
  1873. + free(__old);
  1874. +#endif
  1875. + __throw_exception_again;
  1876. + }
  1877. +
  1878. + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
  1879. + __cloc));
  1880. + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
  1881. + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
  1882. + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
  1883. + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
  1884. + __pposn);
  1885. + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
  1886. + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
  1887. + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
  1888. + __nposn);
  1889. +
  1890. +#ifdef __UCLIBC_HAS_XLOCALE__
  1891. + __uselocale(__old);
  1892. +#else
  1893. + setlocale(LC_ALL, __old);
  1894. + free(__old);
  1895. +#endif
  1896. + }
  1897. + }
  1898. +
  1899. + template<>
  1900. + void
  1901. + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
  1902. +#ifdef __UCLIBC_HAS_XLOCALE__
  1903. + const char*)
  1904. +#else
  1905. + const char* __name)
  1906. +#endif
  1907. + {
  1908. + if (!_M_data)
  1909. + _M_data = new __moneypunct_cache<wchar_t, false>;
  1910. +
  1911. + if (!__cloc)
  1912. + {
  1913. + // "C" locale
  1914. + _M_data->_M_decimal_point = L'.';
  1915. + _M_data->_M_thousands_sep = L',';
  1916. + _M_data->_M_grouping = "";
  1917. + _M_data->_M_grouping_size = 0;
  1918. + _M_data->_M_curr_symbol = L"";
  1919. + _M_data->_M_curr_symbol_size = 0;
  1920. + _M_data->_M_positive_sign = L"";
  1921. + _M_data->_M_positive_sign_size = 0;
  1922. + _M_data->_M_negative_sign = L"";
  1923. + _M_data->_M_negative_sign_size = 0;
  1924. + _M_data->_M_frac_digits = 0;
  1925. + _M_data->_M_pos_format = money_base::_S_default_pattern;
  1926. + _M_data->_M_neg_format = money_base::_S_default_pattern;
  1927. +
  1928. + // Use ctype::widen code without the facet...
  1929. + unsigned char uc;
  1930. + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
  1931. + {
  1932. + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
  1933. + _M_data->_M_atoms[__i] = btowc(uc);
  1934. + }
  1935. + }
  1936. + else
  1937. + {
  1938. + // Named locale.
  1939. +#ifdef __UCLIBC_HAS_XLOCALE__
  1940. + __c_locale __old = __uselocale(__cloc);
  1941. +#else
  1942. + // Switch to named locale so that mbsrtowcs will work.
  1943. + char* __old = strdup(setlocale(LC_ALL, NULL));
  1944. + setlocale(LC_ALL, __name);
  1945. +#endif
  1946. +
  1947. +#ifdef __UCLIBC_MJN3_ONLY__
  1948. +#warning fix this... should be monetary
  1949. +#endif
  1950. +#ifdef __UCLIBC__
  1951. +# ifdef __UCLIBC_HAS_XLOCALE__
  1952. + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  1953. + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  1954. +# else
  1955. + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  1956. + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  1957. +# endif
  1958. +#else
  1959. + union __s_and_w { const char *__s; unsigned int __w; } __u;
  1960. + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
  1961. + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
  1962. +
  1963. + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
  1964. + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
  1965. +#endif
  1966. + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
  1967. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  1968. +
  1969. + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
  1970. + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
  1971. + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
  1972. +
  1973. + wchar_t* __wcs_ps = 0;
  1974. + wchar_t* __wcs_ns = 0;
  1975. + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
  1976. + try
  1977. + {
  1978. + mbstate_t __state;
  1979. + size_t __len;
  1980. + __len = strlen(__cpossign);
  1981. + if (__len)
  1982. + {
  1983. + ++__len;
  1984. + memset(&__state, 0, sizeof(mbstate_t));
  1985. + __wcs_ps = new wchar_t[__len];
  1986. + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
  1987. + _M_data->_M_positive_sign = __wcs_ps;
  1988. + }
  1989. + else
  1990. + _M_data->_M_positive_sign = L"";
  1991. + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
  1992. +
  1993. + __len = strlen(__cnegsign);
  1994. + if (!__nposn)
  1995. + _M_data->_M_negative_sign = L"()";
  1996. + else if (__len)
  1997. + {
  1998. + ++__len;
  1999. + memset(&__state, 0, sizeof(mbstate_t));
  2000. + __wcs_ns = new wchar_t[__len];
  2001. + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
  2002. + _M_data->_M_negative_sign = __wcs_ns;
  2003. + }
  2004. + else
  2005. + _M_data->_M_negative_sign = L"";
  2006. + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
  2007. +
  2008. + // _Intl == true.
  2009. + __len = strlen(__ccurr);
  2010. + if (__len)
  2011. + {
  2012. + ++__len;
  2013. + memset(&__state, 0, sizeof(mbstate_t));
  2014. + wchar_t* __wcs = new wchar_t[__len];
  2015. + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
  2016. + _M_data->_M_curr_symbol = __wcs;
  2017. + }
  2018. + else
  2019. + _M_data->_M_curr_symbol = L"";
  2020. + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
  2021. + }
  2022. + catch (...)
  2023. + {
  2024. + delete _M_data;
  2025. + _M_data = 0;
  2026. + delete __wcs_ps;
  2027. + delete __wcs_ns;
  2028. +#ifdef __UCLIBC_HAS_XLOCALE__
  2029. + __uselocale(__old);
  2030. +#else
  2031. + setlocale(LC_ALL, __old);
  2032. + free(__old);
  2033. +#endif
  2034. + __throw_exception_again;
  2035. + }
  2036. +
  2037. + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
  2038. + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
  2039. + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
  2040. + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
  2041. + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
  2042. + __pposn);
  2043. + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
  2044. + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
  2045. + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
  2046. + __nposn);
  2047. +
  2048. +#ifdef __UCLIBC_HAS_XLOCALE__
  2049. + __uselocale(__old);
  2050. +#else
  2051. + setlocale(LC_ALL, __old);
  2052. + free(__old);
  2053. +#endif
  2054. + }
  2055. + }
  2056. +
  2057. + template<>
  2058. + moneypunct<wchar_t, true>::~moneypunct()
  2059. + {
  2060. + if (_M_data->_M_positive_sign_size)
  2061. + delete [] _M_data->_M_positive_sign;
  2062. + if (_M_data->_M_negative_sign_size
  2063. + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
  2064. + delete [] _M_data->_M_negative_sign;
  2065. + if (_M_data->_M_curr_symbol_size)
  2066. + delete [] _M_data->_M_curr_symbol;
  2067. + delete _M_data;
  2068. + }
  2069. +
  2070. + template<>
  2071. + moneypunct<wchar_t, false>::~moneypunct()
  2072. + {
  2073. + if (_M_data->_M_positive_sign_size)
  2074. + delete [] _M_data->_M_positive_sign;
  2075. + if (_M_data->_M_negative_sign_size
  2076. + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
  2077. + delete [] _M_data->_M_negative_sign;
  2078. + if (_M_data->_M_curr_symbol_size)
  2079. + delete [] _M_data->_M_curr_symbol;
  2080. + delete _M_data;
  2081. + }
  2082. +#endif
  2083. +}
  2084. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  2085. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
  2086. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2004-08-12 17:15:14.000000000 -0500
  2087. @@ -0,0 +1,181 @@
  2088. +// std::numpunct implementation details, GNU version -*- C++ -*-
  2089. +
  2090. +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  2091. +//
  2092. +// This file is part of the GNU ISO C++ Library. This library is free
  2093. +// software; you can redistribute it and/or modify it under the
  2094. +// terms of the GNU General Public License as published by the
  2095. +// Free Software Foundation; either version 2, or (at your option)
  2096. +// any later version.
  2097. +
  2098. +// This library is distributed in the hope that it will be useful,
  2099. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2100. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2101. +// GNU General Public License for more details.
  2102. +
  2103. +// You should have received a copy of the GNU General Public License along
  2104. +// with this library; see the file COPYING. If not, write to the Free
  2105. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2106. +// USA.
  2107. +
  2108. +// As a special exception, you may use this file as part of a free software
  2109. +// library without restriction. Specifically, if other files instantiate
  2110. +// templates or use macros or inline functions from this file, or you compile
  2111. +// this file and link it with other files to produce an executable, this
  2112. +// file does not by itself cause the resulting executable to be covered by
  2113. +// the GNU General Public License. This exception does not however
  2114. +// invalidate any other reasons why the executable file might be covered by
  2115. +// the GNU General Public License.
  2116. +
  2117. +//
  2118. +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
  2119. +//
  2120. +
  2121. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  2122. +
  2123. +#define _LIBC
  2124. +#include <locale>
  2125. +#undef _LIBC
  2126. +#include <bits/c++locale_internal.h>
  2127. +
  2128. +#ifdef __UCLIBC_MJN3_ONLY__
  2129. +#warning tailor for stub locale support
  2130. +#endif
  2131. +#ifndef __UCLIBC_HAS_XLOCALE__
  2132. +#define __nl_langinfo_l(N, L) nl_langinfo((N))
  2133. +#endif
  2134. +
  2135. +namespace std
  2136. +{
  2137. + template<>
  2138. + void
  2139. + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
  2140. + {
  2141. + if (!_M_data)
  2142. + _M_data = new __numpunct_cache<char>;
  2143. +
  2144. + if (!__cloc)
  2145. + {
  2146. + // "C" locale
  2147. + _M_data->_M_grouping = "";
  2148. + _M_data->_M_grouping_size = 0;
  2149. + _M_data->_M_use_grouping = false;
  2150. +
  2151. + _M_data->_M_decimal_point = '.';
  2152. + _M_data->_M_thousands_sep = ',';
  2153. +
  2154. + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
  2155. + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
  2156. +
  2157. + for (size_t __i = 0; __i < __num_base::_S_iend; ++__i)
  2158. + _M_data->_M_atoms_in[__i] = __num_base::_S_atoms_in[__i];
  2159. + }
  2160. + else
  2161. + {
  2162. + // Named locale.
  2163. + _M_data->_M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
  2164. + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
  2165. +
  2166. + // Check for NULL, which implies no grouping.
  2167. + if (_M_data->_M_thousands_sep == '\0')
  2168. + _M_data->_M_grouping = "";
  2169. + else
  2170. + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
  2171. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  2172. + }
  2173. +
  2174. + // NB: There is no way to extact this info from posix locales.
  2175. + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
  2176. + _M_data->_M_truename = "true";
  2177. + _M_data->_M_truename_size = strlen(_M_data->_M_truename);
  2178. + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
  2179. + _M_data->_M_falsename = "false";
  2180. + _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
  2181. + }
  2182. +
  2183. + template<>
  2184. + numpunct<char>::~numpunct()
  2185. + { delete _M_data; }
  2186. +
  2187. +#ifdef _GLIBCXX_USE_WCHAR_T
  2188. + template<>
  2189. + void
  2190. + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
  2191. + {
  2192. + if (!_M_data)
  2193. + _M_data = new __numpunct_cache<wchar_t>;
  2194. +
  2195. + if (!__cloc)
  2196. + {
  2197. + // "C" locale
  2198. + _M_data->_M_grouping = "";
  2199. + _M_data->_M_grouping_size = 0;
  2200. + _M_data->_M_use_grouping = false;
  2201. +
  2202. + _M_data->_M_decimal_point = L'.';
  2203. + _M_data->_M_thousands_sep = L',';
  2204. +
  2205. +#ifdef __UCLIBC_HAS_XLOCALE__
  2206. + __c_locale __old = __uselocale(_S_get_c_locale());
  2207. +#endif
  2208. + // Use ctype::widen code without the facet...
  2209. + unsigned char uc;
  2210. + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
  2211. + {
  2212. + uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
  2213. + _M_data->_M_atoms_out[__i] = btowc(uc);
  2214. + }
  2215. +
  2216. + for (size_t __i = 0; __i < __num_base::_S_iend; ++__i)
  2217. + {
  2218. + uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__i]);
  2219. + _M_data->_M_atoms_in[__i] = btowc(uc);
  2220. + }
  2221. +#ifdef __UCLIBC_HAS_XLOCALE__
  2222. + __uselocale(__old);
  2223. +#endif
  2224. + }
  2225. + else
  2226. + {
  2227. + // Named locale.
  2228. +#ifdef __UCLIBC_MJN3_ONLY__
  2229. +#warning fix this
  2230. +#endif
  2231. +#ifdef __UCLIBC__
  2232. +# ifdef __UCLIBC_HAS_XLOCALE__
  2233. + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  2234. + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  2235. +# else
  2236. + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  2237. + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  2238. +# endif
  2239. +#else
  2240. + union __s_and_w { const char *__s; unsigned int __w; } __u;
  2241. + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  2242. + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
  2243. +
  2244. + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  2245. + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
  2246. +#endif
  2247. +
  2248. + if (_M_data->_M_thousands_sep == L'\0')
  2249. + _M_data->_M_grouping = "";
  2250. + else
  2251. + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
  2252. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  2253. + }
  2254. +
  2255. + // NB: There is no way to extact this info from posix locales.
  2256. + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
  2257. + _M_data->_M_truename = L"true";
  2258. + _M_data->_M_truename_size = wcslen(_M_data->_M_truename);
  2259. + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
  2260. + _M_data->_M_falsename = L"false";
  2261. + _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
  2262. + }
  2263. +
  2264. + template<>
  2265. + numpunct<wchar_t>::~numpunct()
  2266. + { delete _M_data; }
  2267. + #endif
  2268. +}
  2269. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.cc
  2270. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
  2271. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-08-12 17:08:19.000000000 -0500
  2272. @@ -0,0 +1,347 @@
  2273. +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
  2274. +
  2275. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  2276. +//
  2277. +// This file is part of the GNU ISO C++ Library. This library is free
  2278. +// software; you can redistribute it and/or modify it under the
  2279. +// terms of the GNU General Public License as published by the
  2280. +// Free Software Foundation; either version 2, or (at your option)
  2281. +// any later version.
  2282. +
  2283. +// This library is distributed in the hope that it will be useful,
  2284. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2285. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2286. +// GNU General Public License for more details.
  2287. +
  2288. +// You should have received a copy of the GNU General Public License along
  2289. +// with this library; see the file COPYING. If not, write to the Free
  2290. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2291. +// USA.
  2292. +
  2293. +// As a special exception, you may use this file as part of a free software
  2294. +// library without restriction. Specifically, if other files instantiate
  2295. +// templates or use macros or inline functions from this file, or you compile
  2296. +// this file and link it with other files to produce an executable, this
  2297. +// file does not by itself cause the resulting executable to be covered by
  2298. +// the GNU General Public License. This exception does not however
  2299. +// invalidate any other reasons why the executable file might be covered by
  2300. +// the GNU General Public License.
  2301. +
  2302. +//
  2303. +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
  2304. +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
  2305. +//
  2306. +
  2307. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  2308. +
  2309. +#include <locale>
  2310. +#include <bits/c++locale_internal.h>
  2311. +
  2312. +#ifdef __UCLIBC_MJN3_ONLY__
  2313. +#warning tailor for stub locale support
  2314. +#endif
  2315. +#ifndef __UCLIBC_HAS_XLOCALE__
  2316. +#define __nl_langinfo_l(N, L) nl_langinfo((N))
  2317. +#endif
  2318. +
  2319. +namespace std
  2320. +{
  2321. + template<>
  2322. + void
  2323. + __timepunct<char>::
  2324. + _M_put(char* __s, size_t __maxlen, const char* __format,
  2325. + const tm* __tm) const
  2326. + {
  2327. +#ifdef __UCLIBC_HAS_XLOCALE__
  2328. + __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
  2329. +#else
  2330. + char* __old = strdup(setlocale(LC_ALL, NULL));
  2331. + setlocale(LC_ALL, _M_name_timepunct);
  2332. + strftime(__s, __maxlen, __format, __tm);
  2333. + setlocale(LC_ALL, __old);
  2334. + free(__old);
  2335. +#endif
  2336. + }
  2337. +
  2338. + template<>
  2339. + void
  2340. + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
  2341. + {
  2342. + if (!_M_data)
  2343. + _M_data = new __timepunct_cache<char>;
  2344. +
  2345. + if (!__cloc)
  2346. + {
  2347. + // "C" locale
  2348. + _M_c_locale_timepunct = _S_get_c_locale();
  2349. +
  2350. + _M_data->_M_date_format = "%m/%d/%y";
  2351. + _M_data->_M_date_era_format = "%m/%d/%y";
  2352. + _M_data->_M_time_format = "%H:%M:%S";
  2353. + _M_data->_M_time_era_format = "%H:%M:%S";
  2354. + _M_data->_M_date_time_format = "";
  2355. + _M_data->_M_date_time_era_format = "";
  2356. + _M_data->_M_am = "AM";
  2357. + _M_data->_M_pm = "PM";
  2358. + _M_data->_M_am_pm_format = "";
  2359. +
  2360. + // Day names, starting with "C"'s Sunday.
  2361. + _M_data->_M_day1 = "Sunday";
  2362. + _M_data->_M_day2 = "Monday";
  2363. + _M_data->_M_day3 = "Tuesday";
  2364. + _M_data->_M_day4 = "Wednesday";
  2365. + _M_data->_M_day5 = "Thursday";
  2366. + _M_data->_M_day6 = "Friday";
  2367. + _M_data->_M_day7 = "Saturday";
  2368. +
  2369. + // Abbreviated day names, starting with "C"'s Sun.
  2370. + _M_data->_M_aday1 = "Sun";
  2371. + _M_data->_M_aday2 = "Mon";
  2372. + _M_data->_M_aday3 = "Tue";
  2373. + _M_data->_M_aday4 = "Wed";
  2374. + _M_data->_M_aday5 = "Thu";
  2375. + _M_data->_M_aday6 = "Fri";
  2376. + _M_data->_M_aday7 = "Sat";
  2377. +
  2378. + // Month names, starting with "C"'s January.
  2379. + _M_data->_M_month01 = "January";
  2380. + _M_data->_M_month02 = "February";
  2381. + _M_data->_M_month03 = "March";
  2382. + _M_data->_M_month04 = "April";
  2383. + _M_data->_M_month05 = "May";
  2384. + _M_data->_M_month06 = "June";
  2385. + _M_data->_M_month07 = "July";
  2386. + _M_data->_M_month08 = "August";
  2387. + _M_data->_M_month09 = "September";
  2388. + _M_data->_M_month10 = "October";
  2389. + _M_data->_M_month11 = "November";
  2390. + _M_data->_M_month12 = "December";
  2391. +
  2392. + // Abbreviated month names, starting with "C"'s Jan.
  2393. + _M_data->_M_amonth01 = "Jan";
  2394. + _M_data->_M_amonth02 = "Feb";
  2395. + _M_data->_M_amonth03 = "Mar";
  2396. + _M_data->_M_amonth04 = "Apr";
  2397. + _M_data->_M_amonth05 = "May";
  2398. + _M_data->_M_amonth06 = "Jun";
  2399. + _M_data->_M_amonth07 = "July";
  2400. + _M_data->_M_amonth08 = "Aug";
  2401. + _M_data->_M_amonth09 = "Sep";
  2402. + _M_data->_M_amonth10 = "Oct";
  2403. + _M_data->_M_amonth11 = "Nov";
  2404. + _M_data->_M_amonth12 = "Dec";
  2405. + }
  2406. + else
  2407. + {
  2408. + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
  2409. +
  2410. + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
  2411. + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
  2412. + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
  2413. + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
  2414. + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
  2415. + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
  2416. + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
  2417. + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
  2418. + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
  2419. +
  2420. + // Day names, starting with "C"'s Sunday.
  2421. + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
  2422. + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
  2423. + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
  2424. + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
  2425. + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
  2426. + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
  2427. + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
  2428. +
  2429. + // Abbreviated day names, starting with "C"'s Sun.
  2430. + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
  2431. + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
  2432. + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
  2433. + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
  2434. + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
  2435. + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
  2436. + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
  2437. +
  2438. + // Month names, starting with "C"'s January.
  2439. + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
  2440. + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
  2441. + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
  2442. + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
  2443. + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
  2444. + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
  2445. + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
  2446. + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
  2447. + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
  2448. + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
  2449. + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
  2450. + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
  2451. +
  2452. + // Abbreviated month names, starting with "C"'s Jan.
  2453. + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
  2454. + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
  2455. + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
  2456. + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
  2457. + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
  2458. + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
  2459. + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
  2460. + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
  2461. + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
  2462. + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
  2463. + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
  2464. + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
  2465. + }
  2466. + }
  2467. +
  2468. +#ifdef _GLIBCXX_USE_WCHAR_T
  2469. + template<>
  2470. + void
  2471. + __timepunct<wchar_t>::
  2472. + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
  2473. + const tm* __tm) const
  2474. + {
  2475. +#ifdef __UCLIBC_HAS_XLOCALE__
  2476. + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
  2477. +#else
  2478. + char* __old = strdup(setlocale(LC_ALL, NULL));
  2479. + setlocale(LC_ALL, _M_name_timepunct);
  2480. + wcsftime(__s, __maxlen, __format, __tm);
  2481. + setlocale(LC_ALL, __old);
  2482. + free(__old);
  2483. +#endif
  2484. + }
  2485. +
  2486. + template<>
  2487. + void
  2488. + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
  2489. + {
  2490. + if (!_M_data)
  2491. + _M_data = new __timepunct_cache<wchar_t>;
  2492. +
  2493. +#warning wide time stuff
  2494. +// if (!__cloc)
  2495. + {
  2496. + // "C" locale
  2497. + _M_c_locale_timepunct = _S_get_c_locale();
  2498. +
  2499. + _M_data->_M_date_format = L"%m/%d/%y";
  2500. + _M_data->_M_date_era_format = L"%m/%d/%y";
  2501. + _M_data->_M_time_format = L"%H:%M:%S";
  2502. + _M_data->_M_time_era_format = L"%H:%M:%S";
  2503. + _M_data->_M_date_time_format = L"";
  2504. + _M_data->_M_date_time_era_format = L"";
  2505. + _M_data->_M_am = L"AM";
  2506. + _M_data->_M_pm = L"PM";
  2507. + _M_data->_M_am_pm_format = L"";
  2508. +
  2509. + // Day names, starting with "C"'s Sunday.
  2510. + _M_data->_M_day1 = L"Sunday";
  2511. + _M_data->_M_day2 = L"Monday";
  2512. + _M_data->_M_day3 = L"Tuesday";
  2513. + _M_data->_M_day4 = L"Wednesday";
  2514. + _M_data->_M_day5 = L"Thursday";
  2515. + _M_data->_M_day6 = L"Friday";
  2516. + _M_data->_M_day7 = L"Saturday";
  2517. +
  2518. + // Abbreviated day names, starting with "C"'s Sun.
  2519. + _M_data->_M_aday1 = L"Sun";
  2520. + _M_data->_M_aday2 = L"Mon";
  2521. + _M_data->_M_aday3 = L"Tue";
  2522. + _M_data->_M_aday4 = L"Wed";
  2523. + _M_data->_M_aday5 = L"Thu";
  2524. + _M_data->_M_aday6 = L"Fri";
  2525. + _M_data->_M_aday7 = L"Sat";
  2526. +
  2527. + // Month names, starting with "C"'s January.
  2528. + _M_data->_M_month01 = L"January";
  2529. + _M_data->_M_month02 = L"February";
  2530. + _M_data->_M_month03 = L"March";
  2531. + _M_data->_M_month04 = L"April";
  2532. + _M_data->_M_month05 = L"May";
  2533. + _M_data->_M_month06 = L"June";
  2534. + _M_data->_M_month07 = L"July";
  2535. + _M_data->_M_month08 = L"August";
  2536. + _M_data->_M_month09 = L"September";
  2537. + _M_data->_M_month10 = L"October";
  2538. + _M_data->_M_month11 = L"November";
  2539. + _M_data->_M_month12 = L"December";
  2540. +
  2541. + // Abbreviated month names, starting with "C"'s Jan.
  2542. + _M_data->_M_amonth01 = L"Jan";
  2543. + _M_data->_M_amonth02 = L"Feb";
  2544. + _M_data->_M_amonth03 = L"Mar";
  2545. + _M_data->_M_amonth04 = L"Apr";
  2546. + _M_data->_M_amonth05 = L"May";
  2547. + _M_data->_M_amonth06 = L"Jun";
  2548. + _M_data->_M_amonth07 = L"July";
  2549. + _M_data->_M_amonth08 = L"Aug";
  2550. + _M_data->_M_amonth09 = L"Sep";
  2551. + _M_data->_M_amonth10 = L"Oct";
  2552. + _M_data->_M_amonth11 = L"Nov";
  2553. + _M_data->_M_amonth12 = L"Dec";
  2554. + }
  2555. +#if 0
  2556. + else
  2557. + {
  2558. + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
  2559. +
  2560. + _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
  2561. + _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
  2562. + _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
  2563. + _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
  2564. + _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
  2565. + _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
  2566. + _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
  2567. + _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
  2568. + _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
  2569. +
  2570. + // Day names, starting with "C"'s Sunday.
  2571. + _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
  2572. + _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
  2573. + _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
  2574. + _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
  2575. + _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
  2576. + _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
  2577. + _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
  2578. +
  2579. + // Abbreviated day names, starting with "C"'s Sun.
  2580. + _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
  2581. + _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
  2582. + _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
  2583. + _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
  2584. + _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
  2585. + _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
  2586. + _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
  2587. +
  2588. + // Month names, starting with "C"'s January.
  2589. + _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
  2590. + _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
  2591. + _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
  2592. + _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
  2593. + _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
  2594. + _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
  2595. + _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
  2596. + _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
  2597. + _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
  2598. + _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
  2599. + _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
  2600. + _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
  2601. +
  2602. + // Abbreviated month names, starting with "C"'s Jan.
  2603. + _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
  2604. + _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
  2605. + _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
  2606. + _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
  2607. + _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
  2608. + _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
  2609. + _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
  2610. + _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
  2611. + _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
  2612. + _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
  2613. + _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
  2614. + _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
  2615. + }
  2616. +#endif // 0
  2617. + }
  2618. +#endif
  2619. +}
  2620. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.h
  2621. --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
  2622. +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.h 2004-08-12 17:08:19.000000000 -0500
  2623. @@ -0,0 +1,80 @@
  2624. +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
  2625. +
  2626. +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
  2627. +//
  2628. +// This file is part of the GNU ISO C++ Library. This library is free
  2629. +// software; you can redistribute it and/or modify it under the
  2630. +// terms of the GNU General Public License as published by the
  2631. +// Free Software Foundation; either version 2, or (at your option)
  2632. +// any later version.
  2633. +
  2634. +// This library is distributed in the hope that it will be useful,
  2635. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2636. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2637. +// GNU General Public License for more details.
  2638. +
  2639. +// You should have received a copy of the GNU General Public License along
  2640. +// with this library; see the file COPYING. If not, write to the Free
  2641. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2642. +// USA.
  2643. +
  2644. +// As a special exception, you may use this file as part of a free software
  2645. +// library without restriction. Specifically, if other files instantiate
  2646. +// templates or use macros or inline functions from this file, or you compile
  2647. +// this file and link it with other files to produce an executable, this
  2648. +// file does not by itself cause the resulting executable to be covered by
  2649. +// the GNU General Public License. This exception does not however
  2650. +// invalidate any other reasons why the executable file might be covered by
  2651. +// the GNU General Public License.
  2652. +
  2653. +//
  2654. +// ISO C++ 14882: 22.2.5.1.2 - time_get functions
  2655. +// ISO C++ 14882: 22.2.5.3.2 - time_put functions
  2656. +//
  2657. +
  2658. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  2659. +
  2660. + template<typename _CharT>
  2661. + __timepunct<_CharT>::__timepunct(size_t __refs)
  2662. + : facet(__refs), _M_data(NULL)
  2663. + {
  2664. +#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
  2665. + _M_name_timepunct = _S_get_c_name();
  2666. +#endif
  2667. + _M_initialize_timepunct();
  2668. + }
  2669. +
  2670. + template<typename _CharT>
  2671. + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
  2672. + : facet(__refs), _M_data(__cache)
  2673. + {
  2674. +#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
  2675. + _M_name_timepunct = _S_get_c_name();
  2676. +#endif
  2677. + _M_initialize_timepunct();
  2678. + }
  2679. +
  2680. + template<typename _CharT>
  2681. + __timepunct<_CharT>::__timepunct(__c_locale __cloc,
  2682. + const char* __s __attribute__ ((__unused__)),
  2683. + size_t __refs)
  2684. + : facet(__refs), _M_data(NULL)
  2685. + {
  2686. +#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
  2687. + char* __tmp = new char[std::strlen(__s) + 1];
  2688. + std::strcpy(__tmp, __s);
  2689. + _M_name_timepunct = __tmp;
  2690. +#endif
  2691. + _M_initialize_timepunct(__cloc);
  2692. + }
  2693. +
  2694. + template<typename _CharT>
  2695. + __timepunct<_CharT>::~__timepunct()
  2696. + {
  2697. +#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
  2698. + if (_M_name_timepunct != _S_get_c_name())
  2699. + delete [] _M_name_timepunct;
  2700. +#endif
  2701. + delete _M_data;
  2702. + _S_destroy_c_locale(_M_c_locale_timepunct);
  2703. + }
  2704. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_base.h
  2705. --- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
  2706. +++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_base.h 2004-08-12 17:08:19.000000000 -0500
  2707. @@ -0,0 +1,58 @@
  2708. +// Locale support -*- C++ -*-
  2709. +
  2710. +// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
  2711. +// Free Software Foundation, Inc.
  2712. +//
  2713. +// This file is part of the GNU ISO C++ Library. This library is free
  2714. +// software; you can redistribute it and/or modify it under the
  2715. +// terms of the GNU General Public License as published by the
  2716. +// Free Software Foundation; either version 2, or (at your option)
  2717. +// any later version.
  2718. +
  2719. +// This library is distributed in the hope that it will be useful,
  2720. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2721. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2722. +// GNU General Public License for more details.
  2723. +
  2724. +// You should have received a copy of the GNU General Public License along
  2725. +// with this library; see the file COPYING. If not, write to the Free
  2726. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2727. +// USA.
  2728. +
  2729. +// As a special exception, you may use this file as part of a free software
  2730. +// library without restriction. Specifically, if other files instantiate
  2731. +// templates or use macros or inline functions from this file, or you compile
  2732. +// this file and link it with other files to produce an executable, this
  2733. +// file does not by itself cause the resulting executable to be covered by
  2734. +// the GNU General Public License. This exception does not however
  2735. +// invalidate any other reasons why the executable file might be covered by
  2736. +// the GNU General Public License.
  2737. +
  2738. +//
  2739. +// ISO C++ 14882: 22.1 Locales
  2740. +//
  2741. +
  2742. +// Information as gleaned from /usr/include/ctype.h
  2743. +
  2744. + struct ctype_base
  2745. + {
  2746. + // Note: In uClibc, the following two types depend on configuration.
  2747. +
  2748. + // Non-standard typedefs.
  2749. + typedef const __ctype_touplow_t* __to_type;
  2750. +
  2751. + // NB: Offsets into ctype<char>::_M_table force a particular size
  2752. + // on the mask type. Because of this, we don't use an enum.
  2753. + typedef __ctype_mask_t mask;
  2754. + static const mask upper = _ISupper;
  2755. + static const mask lower = _ISlower;
  2756. + static const mask alpha = _ISalpha;
  2757. + static const mask digit = _ISdigit;
  2758. + static const mask xdigit = _ISxdigit;
  2759. + static const mask space = _ISspace;
  2760. + static const mask print = _ISprint;
  2761. + static const mask graph = _ISalpha | _ISdigit | _ISpunct;
  2762. + static const mask cntrl = _IScntrl;
  2763. + static const mask punct = _ISpunct;
  2764. + static const mask alnum = _ISalpha | _ISdigit;
  2765. + };
  2766. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
  2767. --- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
  2768. +++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_inline.h 2004-08-12 17:08:19.000000000 -0500
  2769. @@ -0,0 +1,69 @@
  2770. +// Locale support -*- C++ -*-
  2771. +
  2772. +// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
  2773. +//
  2774. +// This file is part of the GNU ISO C++ Library. This library is free
  2775. +// software; you can redistribute it and/or modify it under the
  2776. +// terms of the GNU General Public License as published by the
  2777. +// Free Software Foundation; either version 2, or (at your option)
  2778. +// any later version.
  2779. +
  2780. +// This library is distributed in the hope that it will be useful,
  2781. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2782. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2783. +// GNU General Public License for more details.
  2784. +
  2785. +// You should have received a copy of the GNU General Public License along
  2786. +// with this library; see the file COPYING. If not, write to the Free
  2787. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2788. +// USA.
  2789. +
  2790. +// As a special exception, you may use this file as part of a free software
  2791. +// library without restriction. Specifically, if other files instantiate
  2792. +// templates or use macros or inline functions from this file, or you compile
  2793. +// this file and link it with other files to produce an executable, this
  2794. +// file does not by itself cause the resulting executable to be covered by
  2795. +// the GNU General Public License. This exception does not however
  2796. +// invalidate any other reasons why the executable file might be covered by
  2797. +// the GNU General Public License.
  2798. +
  2799. +//
  2800. +// ISO C++ 14882: 22.1 Locales
  2801. +//
  2802. +
  2803. +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
  2804. +// functions go in ctype.cc
  2805. +
  2806. + bool
  2807. + ctype<char>::
  2808. + is(mask __m, char __c) const
  2809. + { return _M_table[static_cast<unsigned char>(__c)] & __m; }
  2810. +
  2811. + const char*
  2812. + ctype<char>::
  2813. + is(const char* __low, const char* __high, mask* __vec) const
  2814. + {
  2815. + while (__low < __high)
  2816. + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
  2817. + return __high;
  2818. + }
  2819. +
  2820. + const char*
  2821. + ctype<char>::
  2822. + scan_is(mask __m, const char* __low, const char* __high) const
  2823. + {
  2824. + while (__low < __high
  2825. + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
  2826. + ++__low;
  2827. + return __low;
  2828. + }
  2829. +
  2830. + const char*
  2831. + ctype<char>::
  2832. + scan_not(mask __m, const char* __low, const char* __high) const
  2833. + {
  2834. + while (__low < __high
  2835. + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
  2836. + ++__low;
  2837. + return __low;
  2838. + }
  2839. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
  2840. --- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
  2841. +++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2004-08-12 17:08:19.000000000 -0500
  2842. @@ -0,0 +1,96 @@
  2843. +// Locale support -*- C++ -*-
  2844. +
  2845. +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
  2846. +// Free Software Foundation, Inc.
  2847. +//
  2848. +// This file is part of the GNU ISO C++ Library. This library is free
  2849. +// software; you can redistribute it and/or modify it under the
  2850. +// terms of the GNU General Public License as published by the
  2851. +// Free Software Foundation; either version 2, or (at your option)
  2852. +// any later version.
  2853. +
  2854. +// This library is distributed in the hope that it will be useful,
  2855. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2856. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2857. +// GNU General Public License for more details.
  2858. +
  2859. +// You should have received a copy of the GNU General Public License along
  2860. +// with this library; see the file COPYING. If not, write to the Free
  2861. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2862. +// USA.
  2863. +
  2864. +// As a special exception, you may use this file as part of a free software
  2865. +// library without restriction. Specifically, if other files instantiate
  2866. +// templates or use macros or inline functions from this file, or you compile
  2867. +// this file and link it with other files to produce an executable, this
  2868. +// file does not by itself cause the resulting executable to be covered by
  2869. +// the GNU General Public License. This exception does not however
  2870. +// invalidate any other reasons why the executable file might be covered by
  2871. +// the GNU General Public License.
  2872. +
  2873. +//
  2874. +// ISO C++ 14882: 22.1 Locales
  2875. +//
  2876. +
  2877. +// Information as gleaned from /usr/include/ctype.h
  2878. +
  2879. + const ctype_base::mask*
  2880. + ctype<char>::classic_table() throw()
  2881. + { return __C_ctype_b; }
  2882. +
  2883. + ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
  2884. + size_t __refs)
  2885. + : facet(__refs), _M_del(__table != 0 && __del)
  2886. + {
  2887. + _M_c_locale_ctype = _S_clone_c_locale(__cloc);
  2888. + _M_toupper = __C_ctype_toupper;
  2889. + _M_tolower = __C_ctype_tolower;
  2890. + _M_table = __table ? __table : __C_ctype_b;
  2891. + memset(_M_widen, 0, sizeof(_M_widen));
  2892. + _M_widen_ok = 0;
  2893. + memset(_M_narrow, 0, sizeof(_M_narrow));
  2894. + _M_narrow_ok = 0;
  2895. + }
  2896. +
  2897. + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
  2898. + : facet(__refs), _M_del(__table != 0 && __del)
  2899. + {
  2900. + _M_c_locale_ctype = _S_get_c_locale();
  2901. + _M_toupper = __C_ctype_toupper;
  2902. + _M_tolower = __C_ctype_tolower;
  2903. + _M_table = __table ? __table : __C_ctype_b;
  2904. + memset(_M_widen, 0, sizeof(_M_widen));
  2905. + _M_widen_ok = 0;
  2906. + memset(_M_narrow, 0, sizeof(_M_narrow));
  2907. + _M_narrow_ok = 0;
  2908. + }
  2909. +
  2910. + char
  2911. + ctype<char>::do_toupper(char __c) const
  2912. + { return _M_toupper[static_cast<unsigned char>(__c)]; }
  2913. +
  2914. + const char*
  2915. + ctype<char>::do_toupper(char* __low, const char* __high) const
  2916. + {
  2917. + while (__low < __high)
  2918. + {
  2919. + *__low = _M_toupper[static_cast<unsigned char>(*__low)];
  2920. + ++__low;
  2921. + }
  2922. + return __high;
  2923. + }
  2924. +
  2925. + char
  2926. + ctype<char>::do_tolower(char __c) const
  2927. + { return _M_tolower[static_cast<unsigned char>(__c)]; }
  2928. +
  2929. + const char*
  2930. + ctype<char>::do_tolower(char* __low, const char* __high) const
  2931. + {
  2932. + while (__low < __high)
  2933. + {
  2934. + *__low = _M_tolower[static_cast<unsigned char>(*__low)];
  2935. + ++__low;
  2936. + }
  2937. + return __high;
  2938. + }
  2939. diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/os_defines.h
  2940. --- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
  2941. +++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/os_defines.h 2004-08-12 17:08:19.000000000 -0500
  2942. @@ -0,0 +1,44 @@
  2943. +// Specific definitions for GNU/Linux -*- C++ -*-
  2944. +
  2945. +// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
  2946. +//
  2947. +// This file is part of the GNU ISO C++ Library. This library is free
  2948. +// software; you can redistribute it and/or modify it under the
  2949. +// terms of the GNU General Public License as published by the
  2950. +// Free Software Foundation; either version 2, or (at your option)
  2951. +// any later version.
  2952. +
  2953. +// This library is distributed in the hope that it will be useful,
  2954. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2955. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2956. +// GNU General Public License for more details.
  2957. +
  2958. +// You should have received a copy of the GNU General Public License along
  2959. +// with this library; see the file COPYING. If not, write to the Free
  2960. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2961. +// USA.
  2962. +
  2963. +// As a special exception, you may use this file as part of a free software
  2964. +// library without restriction. Specifically, if other files instantiate
  2965. +// templates or use macros or inline functions from this file, or you compile
  2966. +// this file and link it with other files to produce an executable, this
  2967. +// file does not by itself cause the resulting executable to be covered by
  2968. +// the GNU General Public License. This exception does not however
  2969. +// invalidate any other reasons why the executable file might be covered by
  2970. +// the GNU General Public License.
  2971. +
  2972. +#ifndef _GLIBCXX_OS_DEFINES
  2973. +#define _GLIBCXX_OS_DEFINES 1
  2974. +
  2975. +// System-specific #define, typedefs, corrections, etc, go here. This
  2976. +// file will come before all others.
  2977. +
  2978. +// This keeps isanum, et al from being propagated as macros.
  2979. +#define __NO_CTYPE 1
  2980. +
  2981. +#include <features.h>
  2982. +
  2983. +// We must not see the optimized string functions GNU libc defines.
  2984. +#define __NO_STRING_INLINES
  2985. +
  2986. +#endif
  2987. diff -urN gcc-3.4.0-dist/libstdc++-v3/configure gcc-3.4.0/libstdc++-v3/configure
  2988. --- gcc-3.4.0-dist/libstdc++-v3/configure 2004-03-18 11:35:25.000000000 -0600
  2989. +++ gcc-3.4.0/libstdc++-v3/configure 2004-08-12 17:08:58.000000000 -0500
  2990. @@ -3878,6 +3878,11 @@
  2991. lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  2992. ;;
  2993. +linux-uclibc*)
  2994. + lt_cv_deplibs_check_method=pass_all
  2995. + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
  2996. + ;;
  2997. +
  2998. netbsd*)
  2999. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  3000. lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
  3001. @@ -5545,6 +5550,9 @@
  3002. # Default to "generic".
  3003. if test $enable_clocale_flag = auto; then
  3004. case x${target_os} in
  3005. + xlinux-uclibc*)
  3006. + enable_clocale_flag=uclibc
  3007. + ;;
  3008. xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
  3009. cat >conftest.$ac_ext <<_ACEOF
  3010. #line $LINENO "configure"
  3011. @@ -5759,6 +5767,77 @@
  3012. CTIME_CC=config/locale/generic/time_members.cc
  3013. CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  3014. ;;
  3015. + uclibc)
  3016. + echo "$as_me:$LINENO: result: uclibc" >&5
  3017. +echo "${ECHO_T}uclibc" >&6
  3018. +
  3019. + # Declare intention to use gettext, and add support for specific
  3020. + # languages.
  3021. + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  3022. + ALL_LINGUAS="de fr"
  3023. +
  3024. + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  3025. + # Extract the first word of "msgfmt", so it can be a program name with args.
  3026. +set dummy msgfmt; ac_word=$2
  3027. +echo "$as_me:$LINENO: checking for $ac_word" >&5
  3028. +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  3029. +if test "${ac_cv_prog_check_msgfmt+set}" = set; then
  3030. + echo $ECHO_N "(cached) $ECHO_C" >&6
  3031. +else
  3032. + if test -n "$check_msgfmt"; then
  3033. + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
  3034. +else
  3035. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3036. +for as_dir in $PATH
  3037. +do
  3038. + IFS=$as_save_IFS
  3039. + test -z "$as_dir" && as_dir=.
  3040. + for ac_exec_ext in '' $ac_executable_extensions; do
  3041. + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  3042. + ac_cv_prog_check_msgfmt="yes"
  3043. + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  3044. + break 2
  3045. + fi
  3046. +done
  3047. +done
  3048. +
  3049. + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
  3050. +fi
  3051. +fi
  3052. +check_msgfmt=$ac_cv_prog_check_msgfmt
  3053. +if test -n "$check_msgfmt"; then
  3054. + echo "$as_me:$LINENO: result: $check_msgfmt" >&5
  3055. +echo "${ECHO_T}$check_msgfmt" >&6
  3056. +else
  3057. + echo "$as_me:$LINENO: result: no" >&5
  3058. +echo "${ECHO_T}no" >&6
  3059. +fi
  3060. +
  3061. + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  3062. + USE_NLS=yes
  3063. + fi
  3064. + # Export the build objects.
  3065. + for ling in $ALL_LINGUAS; do \
  3066. + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  3067. + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  3068. + done
  3069. +
  3070. +
  3071. +
  3072. + CLOCALE_H=config/locale/uclibc/c_locale.h
  3073. + CLOCALE_CC=config/locale/uclibc/c_locale.cc
  3074. + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
  3075. + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  3076. + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  3077. + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  3078. + CMESSAGES_H=config/locale/uclibc/messages_members.h
  3079. + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  3080. + CMONEY_CC=config/locale/uclibc/monetary_members.cc
  3081. + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  3082. + CTIME_H=config/locale/uclibc/time_members.h
  3083. + CTIME_CC=config/locale/uclibc/time_members.cc
  3084. + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  3085. + ;;
  3086. esac
  3087. # This is where the testsuite looks for locale catalogs, using the
  3088. diff -urN gcc-3.4.0-dist/libstdc++-v3/configure.host gcc-3.4.0/libstdc++-v3/configure.host
  3089. --- gcc-3.4.0-dist/libstdc++-v3/configure.host 2004-03-18 11:36:12.000000000 -0600
  3090. +++ gcc-3.4.0/libstdc++-v3/configure.host 2004-08-12 17:08:19.000000000 -0500
  3091. @@ -217,6 +217,12 @@
  3092. ;;
  3093. esac
  3094. +# Override for uClibc since linux-uclibc gets mishandled above.
  3095. +case "${host_os}" in
  3096. + *-uclibc*)
  3097. + os_include_dir="os/uclibc"
  3098. + ;;
  3099. +esac
  3100. # Set any OS-dependent and CPU-dependent bits.
  3101. # THIS TABLE IS SORTED. KEEP IT THAT WAY.
  3102. diff -urN gcc-3.4.0-dist/libstdc++-v3/crossconfig.m4 gcc-3.4.0/libstdc++-v3/crossconfig.m4
  3103. --- gcc-3.4.0-dist/libstdc++-v3/crossconfig.m4 2004-02-09 01:17:55.000000000 -0600
  3104. +++ gcc-3.4.0/libstdc++-v3/crossconfig.m4 2004-08-12 17:08:19.000000000 -0500
  3105. @@ -122,6 +122,99 @@
  3106. ;;
  3107. esac
  3108. ;;
  3109. + *-uclibc*)
  3110. +# Temporary hack until we implement the float versions of the libm funcs
  3111. + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
  3112. + machine/endian.h machine/param.h sys/machine.h sys/types.h \
  3113. + fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
  3114. + SECTION_FLAGS='-ffunction-sections -fdata-sections'
  3115. + AC_SUBST(SECTION_FLAGS)
  3116. + GLIBCXX_CHECK_LINKER_FEATURES
  3117. + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
  3118. + GLIBCXX_CHECK_WCHAR_T_SUPPORT
  3119. +
  3120. + # For LFS.
  3121. + AC_DEFINE(HAVE_INT64_T)
  3122. + case "$target" in
  3123. + *-uclinux*)
  3124. + # Don't enable LFS with uClinux
  3125. + ;;
  3126. + *)
  3127. + AC_DEFINE(_GLIBCXX_USE_LFS)
  3128. + esac
  3129. +
  3130. + # For showmanyc_helper().
  3131. + AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
  3132. + GLIBCXX_CHECK_POLL
  3133. + GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
  3134. +
  3135. + # For xsputn_2().
  3136. + AC_CHECK_HEADERS(sys/uio.h)
  3137. + GLIBCXX_CHECK_WRITEV
  3138. +
  3139. +# AC_DEFINE(HAVE_ACOSF)
  3140. +# AC_DEFINE(HAVE_ASINF)
  3141. +# AC_DEFINE(HAVE_ATANF)
  3142. +# AC_DEFINE(HAVE_ATAN2F)
  3143. + AC_DEFINE(HAVE_CEILF)
  3144. + AC_DEFINE(HAVE_COPYSIGN)
  3145. +# AC_DEFINE(HAVE_COPYSIGNF)
  3146. +# AC_DEFINE(HAVE_COSF)
  3147. +# AC_DEFINE(HAVE_COSHF)
  3148. +# AC_DEFINE(HAVE_EXPF)
  3149. +# AC_DEFINE(HAVE_FABSF)
  3150. + AC_DEFINE(HAVE_FINITE)
  3151. + AC_DEFINE(HAVE_FINITEF)
  3152. + AC_DEFINE(HAVE_FLOORF)
  3153. +# AC_DEFINE(HAVE_FMODF)
  3154. +# AC_DEFINE(HAVE_FREXPF)
  3155. + AC_DEFINE(HAVE_HYPOT)
  3156. +# AC_DEFINE(HAVE_HYPOTF)
  3157. + AC_DEFINE(HAVE_ISINF)
  3158. + AC_DEFINE(HAVE_ISINFF)
  3159. + AC_DEFINE(HAVE_ISNAN)
  3160. + AC_DEFINE(HAVE_ISNANF)
  3161. +# AC_DEFINE(HAVE_LOGF)
  3162. +# AC_DEFINE(HAVE_LOG10F)
  3163. +# AC_DEFINE(HAVE_MODFF)
  3164. +# AC_DEFINE(HAVE_SINF)
  3165. +# AC_DEFINE(HAVE_SINHF)
  3166. +# AC_DEFINE(HAVE_SINCOS)
  3167. +# AC_DEFINE(HAVE_SINCOSF)
  3168. + AC_DEFINE(HAVE_SQRTF)
  3169. +# AC_DEFINE(HAVE_TANF)
  3170. +# AC_DEFINE(HAVE_TANHF)
  3171. + if test x"long_double_math_on_this_cpu" = x"yes"; then
  3172. + AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
  3173. +# AC_DEFINE(HAVE_ACOSL)
  3174. +# AC_DEFINE(HAVE_ASINL)
  3175. +# AC_DEFINE(HAVE_ATANL)
  3176. +# AC_DEFINE(HAVE_ATAN2L)
  3177. +# AC_DEFINE(HAVE_CEILL)
  3178. +# AC_DEFINE(HAVE_COPYSIGNL)
  3179. +# AC_DEFINE(HAVE_COSL)
  3180. +# AC_DEFINE(HAVE_COSHL)
  3181. +# AC_DEFINE(HAVE_EXPL)
  3182. +# AC_DEFINE(HAVE_FABSL)
  3183. +# AC_DEFINE(HAVE_FINITEL)
  3184. +# AC_DEFINE(HAVE_FLOORL)
  3185. +# AC_DEFINE(HAVE_FMODL)
  3186. +# AC_DEFINE(HAVE_FREXPL)
  3187. +# AC_DEFINE(HAVE_HYPOTL)
  3188. +# AC_DEFINE(HAVE_ISINFL)
  3189. +# AC_DEFINE(HAVE_ISNANL)
  3190. +# AC_DEFINE(HAVE_LOGL)
  3191. +# AC_DEFINE(HAVE_LOG10L)
  3192. +# AC_DEFINE(HAVE_MODFL)
  3193. +# AC_DEFINE(HAVE_POWL)
  3194. +# AC_DEFINE(HAVE_SINL)
  3195. +# AC_DEFINE(HAVE_SINHL)
  3196. +# AC_DEFINE(HAVE_SINCOSL)
  3197. +# AC_DEFINE(HAVE_SQRTL)
  3198. +# AC_DEFINE(HAVE_TANL)
  3199. +# AC_DEFINE(HAVE_TANHL)
  3200. + fi
  3201. + ;;
  3202. *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
  3203. AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
  3204. machine/endian.h machine/param.h sys/machine.h sys/types.h \
  3205. @@ -136,7 +229,7 @@
  3206. AC_DEFINE(HAVE_INT64_T)
  3207. case "$target" in
  3208. *-uclinux*)
  3209. - # Don't enable LFS with uClibc
  3210. + # Don't enable LFS with uClinux
  3211. ;;
  3212. *)
  3213. AC_DEFINE(_GLIBCXX_USE_LFS)
  3214. diff -urN gcc-3.4.0-dist/libstdc++-v3/include/c_compatibility/wchar.h gcc-3.4.0/libstdc++-v3/include/c_compatibility/wchar.h
  3215. --- gcc-3.4.0-dist/libstdc++-v3/include/c_compatibility/wchar.h 2003-12-08 21:51:45.000000000 -0600
  3216. +++ gcc-3.4.0/libstdc++-v3/include/c_compatibility/wchar.h 2004-08-12 17:14:36.000000000 -0500
  3217. @@ -101,7 +101,9 @@
  3218. using std::wmemcpy;
  3219. using std::wmemmove;
  3220. using std::wmemset;
  3221. +#if __GLIBCXX_HAVE_WCSFTIME
  3222. using std::wcsftime;
  3223. +#endif
  3224. #if _GLIBCXX_USE_C99
  3225. using std::wcstold;
  3226. diff -urN gcc-3.4.0-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.4.0/libstdc++-v3/include/c_std/std_cwchar.h
  3227. --- gcc-3.4.0-dist/libstdc++-v3/include/c_std/std_cwchar.h 2003-12-08 21:44:35.000000000 -0600
  3228. +++ gcc-3.4.0/libstdc++-v3/include/c_std/std_cwchar.h 2004-08-12 17:08:19.000000000 -0500
  3229. @@ -179,7 +179,9 @@
  3230. using ::wcscoll;
  3231. using ::wcscpy;
  3232. using ::wcscspn;
  3233. +#if _GLIBCXX_HAVE_WCSFTIME
  3234. using ::wcsftime;
  3235. +#endif
  3236. using ::wcslen;
  3237. using ::wcsncat;
  3238. using ::wcsncmp;