200-uclibc-locale.patch 111 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241
  1. diff -urN gcc-3.4.1-dist/libstdc++-v3/acinclude.m4 gcc-3.4.1/libstdc++-v3/acinclude.m4
  2. --- gcc-3.4.1-dist/libstdc++-v3/acinclude.m4 2004-05-14 05:53:11.000000000 -0500
  3. +++ gcc-3.4.1/libstdc++-v3/acinclude.m4 2004-08-12 15:54:48.000000000 -0500
  4. @@ -996,7 +996,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. @@ -1012,6 +1012,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. @@ -1138,6 +1141,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.1-dist/libstdc++-v3/aclocal.m4 gcc-3.4.1/libstdc++-v3/aclocal.m4
  64. --- gcc-3.4.1-dist/libstdc++-v3/aclocal.m4 2004-05-15 15:43:59.000000000 -0500
  65. +++ gcc-3.4.1/libstdc++-v3/aclocal.m4 2004-08-12 16:14:37.000000000 -0500
  66. @@ -1025,6 +1025,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. @@ -1151,6 +1154,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.1-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
  118. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
  119. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2004-08-12 15:54:48.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.1-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
  181. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
  182. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2004-08-12 15:54:48.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.1-dist/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c_locale.h
  345. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
  346. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2004-08-12 15:54:48.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.1-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
  468. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
  469. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2004-08-12 15:54:48.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.1-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
  778. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
  779. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2004-08-12 15:54:48.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.1-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
  862. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
  863. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2004-08-12 15:54:48.000000000 -0500
  864. @@ -0,0 +1,300 @@
  865. +// std::ctype implementation details, GNU version -*- C++ -*-
  866. +
  867. +// Copyright (C) 2001, 2002, 2003, 2004 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. + this->_S_destroy_c_locale(this->_M_c_locale_ctype);
  923. + this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
  924. +#ifdef __UCLIBC_HAS_XLOCALE__
  925. + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
  926. + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
  927. + this->_M_table = this->_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 __j = 0;
  1151. + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
  1152. + _M_widen[__j] = btowc(__j);
  1153. +
  1154. + for (size_t __k = 0; __k <= 11; ++__k)
  1155. + {
  1156. + _M_bit[__k] = static_cast<mask>(_ISbit(__k));
  1157. + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
  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.1-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
  1166. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
  1167. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2004-08-12 15:54:48.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.1-dist/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.4.1/libstdc++-v3/config/locale/uclibc/messages_members.h
  1270. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
  1271. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2004-08-12 15:54:48.000000000 -0500
  1272. @@ -0,0 +1,118 @@
  1273. +// std::messages implementation details, GNU version -*- C++ -*-
  1274. +
  1275. +// Copyright (C) 2001, 2002, 2003, 2004 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), _M_c_locale_messages(_S_get_c_locale()),
  1326. + _M_name_messages(_S_get_c_name())
  1327. + { }
  1328. +
  1329. + template<typename _CharT>
  1330. + messages<_CharT>::messages(__c_locale __cloc, const char* __s,
  1331. + size_t __refs)
  1332. + : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
  1333. + _M_name_messages(__s)
  1334. + {
  1335. + char* __tmp = new char[std::strlen(__s) + 1];
  1336. + std::strcpy(__tmp, __s);
  1337. + _M_name_messages = __tmp;
  1338. + }
  1339. +
  1340. + template<typename _CharT>
  1341. + typename messages<_CharT>::catalog
  1342. + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
  1343. + const char* __dir) const
  1344. + {
  1345. + __bindtextdomain(__s.c_str(), __dir);
  1346. + return this->do_open(__s, __loc);
  1347. + }
  1348. +
  1349. + // Virtual member functions.
  1350. + template<typename _CharT>
  1351. + messages<_CharT>::~messages()
  1352. + {
  1353. + if (_M_name_messages != _S_get_c_name())
  1354. + delete [] _M_name_messages;
  1355. + _S_destroy_c_locale(_M_c_locale_messages);
  1356. + }
  1357. +
  1358. + template<typename _CharT>
  1359. + typename messages<_CharT>::catalog
  1360. + messages<_CharT>::do_open(const basic_string<char>& __s,
  1361. + const locale&) const
  1362. + {
  1363. + // No error checking is done, assume the catalog exists and can
  1364. + // be used.
  1365. + __textdomain(__s.c_str());
  1366. + return 0;
  1367. + }
  1368. +
  1369. + template<typename _CharT>
  1370. + void
  1371. + messages<_CharT>::do_close(catalog) const
  1372. + { }
  1373. +
  1374. + // messages_byname
  1375. + template<typename _CharT>
  1376. + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
  1377. + : messages<_CharT>(__refs)
  1378. + {
  1379. + if (this->_M_name_messages != locale::facet::_S_get_c_name())
  1380. + delete [] this->_M_name_messages;
  1381. + char* __tmp = new char[std::strlen(__s) + 1];
  1382. + std::strcpy(__tmp, __s);
  1383. + this->_M_name_messages = __tmp;
  1384. +
  1385. + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
  1386. + {
  1387. + this->_S_destroy_c_locale(this->_M_c_locale_messages);
  1388. + this->_S_create_c_locale(this->_M_c_locale_messages, __s);
  1389. + }
  1390. + }
  1391. diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
  1392. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
  1393. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2004-08-12 15:54:48.000000000 -0500
  1394. @@ -0,0 +1,698 @@
  1395. +// std::moneypunct implementation details, GNU version -*- C++ -*-
  1396. +
  1397. +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  1398. +//
  1399. +// This file is part of the GNU ISO C++ Library. This library is free
  1400. +// software; you can redistribute it and/or modify it under the
  1401. +// terms of the GNU General Public License as published by the
  1402. +// Free Software Foundation; either version 2, or (at your option)
  1403. +// any later version.
  1404. +
  1405. +// This library is distributed in the hope that it will be useful,
  1406. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  1407. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  1408. +// GNU General Public License for more details.
  1409. +
  1410. +// You should have received a copy of the GNU General Public License along
  1411. +// with this library; see the file COPYING. If not, write to the Free
  1412. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  1413. +// USA.
  1414. +
  1415. +// As a special exception, you may use this file as part of a free software
  1416. +// library without restriction. Specifically, if other files instantiate
  1417. +// templates or use macros or inline functions from this file, or you compile
  1418. +// this file and link it with other files to produce an executable, this
  1419. +// file does not by itself cause the resulting executable to be covered by
  1420. +// the GNU General Public License. This exception does not however
  1421. +// invalidate any other reasons why the executable file might be covered by
  1422. +// the GNU General Public License.
  1423. +
  1424. +//
  1425. +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
  1426. +//
  1427. +
  1428. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  1429. +
  1430. +#define _LIBC
  1431. +#include <locale>
  1432. +#undef _LIBC
  1433. +#include <bits/c++locale_internal.h>
  1434. +
  1435. +#ifdef __UCLIBC_MJN3_ONLY__
  1436. +#warning optimize this for uclibc
  1437. +#warning tailor for stub locale support
  1438. +#endif
  1439. +
  1440. +#ifndef __UCLIBC_HAS_XLOCALE__
  1441. +#define __nl_langinfo_l(N, L) nl_langinfo((N))
  1442. +#endif
  1443. +
  1444. +namespace std
  1445. +{
  1446. + // Construct and return valid pattern consisting of some combination of:
  1447. + // space none symbol sign value
  1448. + money_base::pattern
  1449. + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
  1450. + {
  1451. + pattern __ret;
  1452. +
  1453. + // This insanely complicated routine attempts to construct a valid
  1454. + // pattern for use with monyepunct. A couple of invariants:
  1455. +
  1456. + // if (__precedes) symbol -> value
  1457. + // else value -> symbol
  1458. +
  1459. + // if (__space) space
  1460. + // else none
  1461. +
  1462. + // none == never first
  1463. + // space never first or last
  1464. +
  1465. + // Any elegant implementations of this are welcome.
  1466. + switch (__posn)
  1467. + {
  1468. + case 0:
  1469. + case 1:
  1470. + // 1 The sign precedes the value and symbol.
  1471. + __ret.field[0] = sign;
  1472. + if (__space)
  1473. + {
  1474. + // Pattern starts with sign.
  1475. + if (__precedes)
  1476. + {
  1477. + __ret.field[1] = symbol;
  1478. + __ret.field[3] = value;
  1479. + }
  1480. + else
  1481. + {
  1482. + __ret.field[1] = value;
  1483. + __ret.field[3] = symbol;
  1484. + }
  1485. + __ret.field[2] = space;
  1486. + }
  1487. + else
  1488. + {
  1489. + // Pattern starts with sign and ends with none.
  1490. + if (__precedes)
  1491. + {
  1492. + __ret.field[1] = symbol;
  1493. + __ret.field[2] = value;
  1494. + }
  1495. + else
  1496. + {
  1497. + __ret.field[1] = value;
  1498. + __ret.field[2] = symbol;
  1499. + }
  1500. + __ret.field[3] = none;
  1501. + }
  1502. + break;
  1503. + case 2:
  1504. + // 2 The sign follows the value and symbol.
  1505. + if (__space)
  1506. + {
  1507. + // Pattern either ends with sign.
  1508. + if (__precedes)
  1509. + {
  1510. + __ret.field[0] = symbol;
  1511. + __ret.field[2] = value;
  1512. + }
  1513. + else
  1514. + {
  1515. + __ret.field[0] = value;
  1516. + __ret.field[2] = symbol;
  1517. + }
  1518. + __ret.field[1] = space;
  1519. + __ret.field[3] = sign;
  1520. + }
  1521. + else
  1522. + {
  1523. + // Pattern ends with sign then none.
  1524. + if (__precedes)
  1525. + {
  1526. + __ret.field[0] = symbol;
  1527. + __ret.field[1] = value;
  1528. + }
  1529. + else
  1530. + {
  1531. + __ret.field[0] = value;
  1532. + __ret.field[1] = symbol;
  1533. + }
  1534. + __ret.field[2] = sign;
  1535. + __ret.field[3] = none;
  1536. + }
  1537. + break;
  1538. + case 3:
  1539. + // 3 The sign immediately precedes the symbol.
  1540. + if (__precedes)
  1541. + {
  1542. + __ret.field[0] = sign;
  1543. + __ret.field[1] = symbol;
  1544. + if (__space)
  1545. + {
  1546. + __ret.field[2] = space;
  1547. + __ret.field[3] = value;
  1548. + }
  1549. + else
  1550. + {
  1551. + __ret.field[2] = value;
  1552. + __ret.field[3] = none;
  1553. + }
  1554. + }
  1555. + else
  1556. + {
  1557. + __ret.field[0] = value;
  1558. + if (__space)
  1559. + {
  1560. + __ret.field[1] = space;
  1561. + __ret.field[2] = sign;
  1562. + __ret.field[3] = symbol;
  1563. + }
  1564. + else
  1565. + {
  1566. + __ret.field[1] = sign;
  1567. + __ret.field[2] = symbol;
  1568. + __ret.field[3] = none;
  1569. + }
  1570. + }
  1571. + break;
  1572. + case 4:
  1573. + // 4 The sign immediately follows the symbol.
  1574. + if (__precedes)
  1575. + {
  1576. + __ret.field[0] = symbol;
  1577. + __ret.field[1] = sign;
  1578. + if (__space)
  1579. + {
  1580. + __ret.field[2] = space;
  1581. + __ret.field[3] = value;
  1582. + }
  1583. + else
  1584. + {
  1585. + __ret.field[2] = value;
  1586. + __ret.field[3] = none;
  1587. + }
  1588. + }
  1589. + else
  1590. + {
  1591. + __ret.field[0] = value;
  1592. + if (__space)
  1593. + {
  1594. + __ret.field[1] = space;
  1595. + __ret.field[2] = symbol;
  1596. + __ret.field[3] = sign;
  1597. + }
  1598. + else
  1599. + {
  1600. + __ret.field[1] = symbol;
  1601. + __ret.field[2] = sign;
  1602. + __ret.field[3] = none;
  1603. + }
  1604. + }
  1605. + break;
  1606. + default:
  1607. + ;
  1608. + }
  1609. + return __ret;
  1610. + }
  1611. +
  1612. + template<>
  1613. + void
  1614. + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
  1615. + const char*)
  1616. + {
  1617. + if (!_M_data)
  1618. + _M_data = new __moneypunct_cache<char, true>;
  1619. +
  1620. + if (!__cloc)
  1621. + {
  1622. + // "C" locale
  1623. + _M_data->_M_decimal_point = '.';
  1624. + _M_data->_M_thousands_sep = ',';
  1625. + _M_data->_M_grouping = "";
  1626. + _M_data->_M_grouping_size = 0;
  1627. + _M_data->_M_curr_symbol = "";
  1628. + _M_data->_M_curr_symbol_size = 0;
  1629. + _M_data->_M_positive_sign = "";
  1630. + _M_data->_M_positive_sign_size = 0;
  1631. + _M_data->_M_negative_sign = "";
  1632. + _M_data->_M_negative_sign_size = 0;
  1633. + _M_data->_M_frac_digits = 0;
  1634. + _M_data->_M_pos_format = money_base::_S_default_pattern;
  1635. + _M_data->_M_neg_format = money_base::_S_default_pattern;
  1636. +
  1637. + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
  1638. + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
  1639. + }
  1640. + else
  1641. + {
  1642. + // Named locale.
  1643. + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
  1644. + __cloc));
  1645. + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
  1646. + __cloc));
  1647. + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
  1648. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  1649. + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
  1650. + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
  1651. +
  1652. + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
  1653. + if (!__nposn)
  1654. + _M_data->_M_negative_sign = "()";
  1655. + else
  1656. + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
  1657. + __cloc);
  1658. + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
  1659. +
  1660. + // _Intl == true
  1661. + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
  1662. + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
  1663. + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
  1664. + __cloc));
  1665. + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
  1666. + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
  1667. + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
  1668. + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
  1669. + __pposn);
  1670. + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
  1671. + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
  1672. + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
  1673. + __nposn);
  1674. + }
  1675. + }
  1676. +
  1677. + template<>
  1678. + void
  1679. + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
  1680. + const char*)
  1681. + {
  1682. + if (!_M_data)
  1683. + _M_data = new __moneypunct_cache<char, false>;
  1684. +
  1685. + if (!__cloc)
  1686. + {
  1687. + // "C" locale
  1688. + _M_data->_M_decimal_point = '.';
  1689. + _M_data->_M_thousands_sep = ',';
  1690. + _M_data->_M_grouping = "";
  1691. + _M_data->_M_grouping_size = 0;
  1692. + _M_data->_M_curr_symbol = "";
  1693. + _M_data->_M_curr_symbol_size = 0;
  1694. + _M_data->_M_positive_sign = "";
  1695. + _M_data->_M_positive_sign_size = 0;
  1696. + _M_data->_M_negative_sign = "";
  1697. + _M_data->_M_negative_sign_size = 0;
  1698. + _M_data->_M_frac_digits = 0;
  1699. + _M_data->_M_pos_format = money_base::_S_default_pattern;
  1700. + _M_data->_M_neg_format = money_base::_S_default_pattern;
  1701. +
  1702. + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
  1703. + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
  1704. + }
  1705. + else
  1706. + {
  1707. + // Named locale.
  1708. + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
  1709. + __cloc));
  1710. + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
  1711. + __cloc));
  1712. + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
  1713. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  1714. + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
  1715. + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
  1716. +
  1717. + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
  1718. + if (!__nposn)
  1719. + _M_data->_M_negative_sign = "()";
  1720. + else
  1721. + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
  1722. + __cloc);
  1723. + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
  1724. +
  1725. + // _Intl == false
  1726. + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
  1727. + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
  1728. + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
  1729. + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
  1730. + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
  1731. + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
  1732. + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
  1733. + __pposn);
  1734. + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
  1735. + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
  1736. + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
  1737. + __nposn);
  1738. + }
  1739. + }
  1740. +
  1741. + template<>
  1742. + moneypunct<char, true>::~moneypunct()
  1743. + { delete _M_data; }
  1744. +
  1745. + template<>
  1746. + moneypunct<char, false>::~moneypunct()
  1747. + { delete _M_data; }
  1748. +
  1749. +#ifdef _GLIBCXX_USE_WCHAR_T
  1750. + template<>
  1751. + void
  1752. + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
  1753. +#ifdef __UCLIBC_HAS_XLOCALE__
  1754. + const char*)
  1755. +#else
  1756. + const char* __name)
  1757. +#endif
  1758. + {
  1759. + if (!_M_data)
  1760. + _M_data = new __moneypunct_cache<wchar_t, true>;
  1761. +
  1762. + if (!__cloc)
  1763. + {
  1764. + // "C" locale
  1765. + _M_data->_M_decimal_point = L'.';
  1766. + _M_data->_M_thousands_sep = L',';
  1767. + _M_data->_M_grouping = "";
  1768. + _M_data->_M_grouping_size = 0;
  1769. + _M_data->_M_curr_symbol = L"";
  1770. + _M_data->_M_curr_symbol_size = 0;
  1771. + _M_data->_M_positive_sign = L"";
  1772. + _M_data->_M_positive_sign_size = 0;
  1773. + _M_data->_M_negative_sign = L"";
  1774. + _M_data->_M_negative_sign_size = 0;
  1775. + _M_data->_M_frac_digits = 0;
  1776. + _M_data->_M_pos_format = money_base::_S_default_pattern;
  1777. + _M_data->_M_neg_format = money_base::_S_default_pattern;
  1778. +
  1779. + // Use ctype::widen code without the facet...
  1780. + unsigned char uc;
  1781. + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
  1782. + {
  1783. + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
  1784. + _M_data->_M_atoms[__i] = btowc(uc);
  1785. + }
  1786. + }
  1787. + else
  1788. + {
  1789. + // Named locale.
  1790. +#ifdef __UCLIBC_HAS_XLOCALE__
  1791. + __c_locale __old = __uselocale(__cloc);
  1792. +#else
  1793. + // Switch to named locale so that mbsrtowcs will work.
  1794. + char* __old = strdup(setlocale(LC_ALL, NULL));
  1795. + setlocale(LC_ALL, __name);
  1796. +#endif
  1797. +
  1798. +#ifdef __UCLIBC_MJN3_ONLY__
  1799. +#warning fix this... should be monetary
  1800. +#endif
  1801. +#ifdef __UCLIBC__
  1802. +# ifdef __UCLIBC_HAS_XLOCALE__
  1803. + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  1804. + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  1805. +# else
  1806. + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  1807. + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  1808. +# endif
  1809. +#else
  1810. + union __s_and_w { const char *__s; unsigned int __w; } __u;
  1811. + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
  1812. + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
  1813. +
  1814. + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
  1815. + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
  1816. +#endif
  1817. + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
  1818. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  1819. +
  1820. + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
  1821. + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
  1822. + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
  1823. +
  1824. + wchar_t* __wcs_ps = 0;
  1825. + wchar_t* __wcs_ns = 0;
  1826. + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
  1827. + try
  1828. + {
  1829. + mbstate_t __state;
  1830. + size_t __len = strlen(__cpossign);
  1831. + if (__len)
  1832. + {
  1833. + ++__len;
  1834. + memset(&__state, 0, sizeof(mbstate_t));
  1835. + __wcs_ps = new wchar_t[__len];
  1836. + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
  1837. + _M_data->_M_positive_sign = __wcs_ps;
  1838. + }
  1839. + else
  1840. + _M_data->_M_positive_sign = L"";
  1841. + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
  1842. +
  1843. + __len = strlen(__cnegsign);
  1844. + if (!__nposn)
  1845. + _M_data->_M_negative_sign = L"()";
  1846. + else if (__len)
  1847. + {
  1848. + ++__len;
  1849. + memset(&__state, 0, sizeof(mbstate_t));
  1850. + __wcs_ns = new wchar_t[__len];
  1851. + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
  1852. + _M_data->_M_negative_sign = __wcs_ns;
  1853. + }
  1854. + else
  1855. + _M_data->_M_negative_sign = L"";
  1856. + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
  1857. +
  1858. + // _Intl == true.
  1859. + __len = strlen(__ccurr);
  1860. + if (__len)
  1861. + {
  1862. + ++__len;
  1863. + memset(&__state, 0, sizeof(mbstate_t));
  1864. + wchar_t* __wcs = new wchar_t[__len];
  1865. + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
  1866. + _M_data->_M_curr_symbol = __wcs;
  1867. + }
  1868. + else
  1869. + _M_data->_M_curr_symbol = L"";
  1870. + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
  1871. + }
  1872. + catch (...)
  1873. + {
  1874. + delete _M_data;
  1875. + _M_data = 0;
  1876. + delete __wcs_ps;
  1877. + delete __wcs_ns;
  1878. +#ifdef __UCLIBC_HAS_XLOCALE__
  1879. + __uselocale(__old);
  1880. +#else
  1881. + setlocale(LC_ALL, __old);
  1882. + free(__old);
  1883. +#endif
  1884. + __throw_exception_again;
  1885. + }
  1886. +
  1887. + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
  1888. + __cloc));
  1889. + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
  1890. + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
  1891. + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
  1892. + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
  1893. + __pposn);
  1894. + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
  1895. + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
  1896. + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
  1897. + __nposn);
  1898. +
  1899. +#ifdef __UCLIBC_HAS_XLOCALE__
  1900. + __uselocale(__old);
  1901. +#else
  1902. + setlocale(LC_ALL, __old);
  1903. + free(__old);
  1904. +#endif
  1905. + }
  1906. + }
  1907. +
  1908. + template<>
  1909. + void
  1910. + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
  1911. +#ifdef __UCLIBC_HAS_XLOCALE__
  1912. + const char*)
  1913. +#else
  1914. + const char* __name)
  1915. +#endif
  1916. + {
  1917. + if (!_M_data)
  1918. + _M_data = new __moneypunct_cache<wchar_t, false>;
  1919. +
  1920. + if (!__cloc)
  1921. + {
  1922. + // "C" locale
  1923. + _M_data->_M_decimal_point = L'.';
  1924. + _M_data->_M_thousands_sep = L',';
  1925. + _M_data->_M_grouping = "";
  1926. + _M_data->_M_grouping_size = 0;
  1927. + _M_data->_M_curr_symbol = L"";
  1928. + _M_data->_M_curr_symbol_size = 0;
  1929. + _M_data->_M_positive_sign = L"";
  1930. + _M_data->_M_positive_sign_size = 0;
  1931. + _M_data->_M_negative_sign = L"";
  1932. + _M_data->_M_negative_sign_size = 0;
  1933. + _M_data->_M_frac_digits = 0;
  1934. + _M_data->_M_pos_format = money_base::_S_default_pattern;
  1935. + _M_data->_M_neg_format = money_base::_S_default_pattern;
  1936. +
  1937. + // Use ctype::widen code without the facet...
  1938. + unsigned char uc;
  1939. + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
  1940. + {
  1941. + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
  1942. + _M_data->_M_atoms[__i] = btowc(uc);
  1943. + }
  1944. + }
  1945. + else
  1946. + {
  1947. + // Named locale.
  1948. +#ifdef __UCLIBC_HAS_XLOCALE__
  1949. + __c_locale __old = __uselocale(__cloc);
  1950. +#else
  1951. + // Switch to named locale so that mbsrtowcs will work.
  1952. + char* __old = strdup(setlocale(LC_ALL, NULL));
  1953. + setlocale(LC_ALL, __name);
  1954. +#endif
  1955. +
  1956. +#ifdef __UCLIBC_MJN3_ONLY__
  1957. +#warning fix this... should be monetary
  1958. +#endif
  1959. +#ifdef __UCLIBC__
  1960. +# ifdef __UCLIBC_HAS_XLOCALE__
  1961. + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  1962. + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  1963. +# else
  1964. + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  1965. + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  1966. +# endif
  1967. +#else
  1968. + union __s_and_w { const char *__s; unsigned int __w; } __u;
  1969. + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
  1970. + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
  1971. +
  1972. + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
  1973. + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
  1974. +#endif
  1975. + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
  1976. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  1977. +
  1978. + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
  1979. + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
  1980. + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
  1981. +
  1982. + wchar_t* __wcs_ps = 0;
  1983. + wchar_t* __wcs_ns = 0;
  1984. + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
  1985. + try
  1986. + {
  1987. + mbstate_t __state;
  1988. + size_t __len;
  1989. + __len = strlen(__cpossign);
  1990. + if (__len)
  1991. + {
  1992. + ++__len;
  1993. + memset(&__state, 0, sizeof(mbstate_t));
  1994. + __wcs_ps = new wchar_t[__len];
  1995. + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
  1996. + _M_data->_M_positive_sign = __wcs_ps;
  1997. + }
  1998. + else
  1999. + _M_data->_M_positive_sign = L"";
  2000. + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
  2001. +
  2002. + __len = strlen(__cnegsign);
  2003. + if (!__nposn)
  2004. + _M_data->_M_negative_sign = L"()";
  2005. + else if (__len)
  2006. + {
  2007. + ++__len;
  2008. + memset(&__state, 0, sizeof(mbstate_t));
  2009. + __wcs_ns = new wchar_t[__len];
  2010. + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
  2011. + _M_data->_M_negative_sign = __wcs_ns;
  2012. + }
  2013. + else
  2014. + _M_data->_M_negative_sign = L"";
  2015. + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
  2016. +
  2017. + // _Intl == true.
  2018. + __len = strlen(__ccurr);
  2019. + if (__len)
  2020. + {
  2021. + ++__len;
  2022. + memset(&__state, 0, sizeof(mbstate_t));
  2023. + wchar_t* __wcs = new wchar_t[__len];
  2024. + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
  2025. + _M_data->_M_curr_symbol = __wcs;
  2026. + }
  2027. + else
  2028. + _M_data->_M_curr_symbol = L"";
  2029. + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
  2030. + }
  2031. + catch (...)
  2032. + {
  2033. + delete _M_data;
  2034. + _M_data = 0;
  2035. + delete __wcs_ps;
  2036. + delete __wcs_ns;
  2037. +#ifdef __UCLIBC_HAS_XLOCALE__
  2038. + __uselocale(__old);
  2039. +#else
  2040. + setlocale(LC_ALL, __old);
  2041. + free(__old);
  2042. +#endif
  2043. + __throw_exception_again;
  2044. + }
  2045. +
  2046. + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
  2047. + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
  2048. + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
  2049. + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
  2050. + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
  2051. + __pposn);
  2052. + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
  2053. + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
  2054. + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
  2055. + __nposn);
  2056. +
  2057. +#ifdef __UCLIBC_HAS_XLOCALE__
  2058. + __uselocale(__old);
  2059. +#else
  2060. + setlocale(LC_ALL, __old);
  2061. + free(__old);
  2062. +#endif
  2063. + }
  2064. + }
  2065. +
  2066. + template<>
  2067. + moneypunct<wchar_t, true>::~moneypunct()
  2068. + {
  2069. + if (_M_data->_M_positive_sign_size)
  2070. + delete [] _M_data->_M_positive_sign;
  2071. + if (_M_data->_M_negative_sign_size
  2072. + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
  2073. + delete [] _M_data->_M_negative_sign;
  2074. + if (_M_data->_M_curr_symbol_size)
  2075. + delete [] _M_data->_M_curr_symbol;
  2076. + delete _M_data;
  2077. + }
  2078. +
  2079. + template<>
  2080. + moneypunct<wchar_t, false>::~moneypunct()
  2081. + {
  2082. + if (_M_data->_M_positive_sign_size)
  2083. + delete [] _M_data->_M_positive_sign;
  2084. + if (_M_data->_M_negative_sign_size
  2085. + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
  2086. + delete [] _M_data->_M_negative_sign;
  2087. + if (_M_data->_M_curr_symbol_size)
  2088. + delete [] _M_data->_M_curr_symbol;
  2089. + delete _M_data;
  2090. + }
  2091. +#endif
  2092. +}
  2093. diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
  2094. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
  2095. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2004-08-12 16:13:31.000000000 -0500
  2096. @@ -0,0 +1,183 @@
  2097. +// std::numpunct implementation details, GNU version -*- C++ -*-
  2098. +
  2099. +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  2100. +//
  2101. +// This file is part of the GNU ISO C++ Library. This library is free
  2102. +// software; you can redistribute it and/or modify it under the
  2103. +// terms of the GNU General Public License as published by the
  2104. +// Free Software Foundation; either version 2, or (at your option)
  2105. +// any later version.
  2106. +
  2107. +// This library is distributed in the hope that it will be useful,
  2108. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2109. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2110. +// GNU General Public License for more details.
  2111. +
  2112. +// You should have received a copy of the GNU General Public License along
  2113. +// with this library; see the file COPYING. If not, write to the Free
  2114. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2115. +// USA.
  2116. +
  2117. +// As a special exception, you may use this file as part of a free software
  2118. +// library without restriction. Specifically, if other files instantiate
  2119. +// templates or use macros or inline functions from this file, or you compile
  2120. +// this file and link it with other files to produce an executable, this
  2121. +// file does not by itself cause the resulting executable to be covered by
  2122. +// the GNU General Public License. This exception does not however
  2123. +// invalidate any other reasons why the executable file might be covered by
  2124. +// the GNU General Public License.
  2125. +
  2126. +//
  2127. +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
  2128. +//
  2129. +
  2130. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  2131. +
  2132. +#define _LIBC
  2133. +#include <locale>
  2134. +#undef _LIBC
  2135. +#include <bits/c++locale_internal.h>
  2136. +
  2137. +#ifdef __UCLIBC_MJN3_ONLY__
  2138. +#warning tailor for stub locale support
  2139. +#endif
  2140. +#ifndef __UCLIBC_HAS_XLOCALE__
  2141. +#define __nl_langinfo_l(N, L) nl_langinfo((N))
  2142. +#endif
  2143. +
  2144. +namespace std
  2145. +{
  2146. + template<>
  2147. + void
  2148. + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
  2149. + {
  2150. + if (!_M_data)
  2151. + _M_data = new __numpunct_cache<char>;
  2152. +
  2153. + if (!__cloc)
  2154. + {
  2155. + // "C" locale
  2156. + _M_data->_M_grouping = "";
  2157. + _M_data->_M_grouping_size = 0;
  2158. + _M_data->_M_use_grouping = false;
  2159. +
  2160. + _M_data->_M_decimal_point = '.';
  2161. + _M_data->_M_thousands_sep = ',';
  2162. +
  2163. + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
  2164. + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
  2165. +
  2166. + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
  2167. + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
  2168. + }
  2169. + else
  2170. + {
  2171. + // Named locale.
  2172. + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
  2173. + __cloc));
  2174. + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
  2175. + __cloc));
  2176. +
  2177. + // Check for NULL, which implies no grouping.
  2178. + if (_M_data->_M_thousands_sep == '\0')
  2179. + _M_data->_M_grouping = "";
  2180. + else
  2181. + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
  2182. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  2183. + }
  2184. +
  2185. + // NB: There is no way to extact this info from posix locales.
  2186. + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
  2187. + _M_data->_M_truename = "true";
  2188. + _M_data->_M_truename_size = strlen(_M_data->_M_truename);
  2189. + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
  2190. + _M_data->_M_falsename = "false";
  2191. + _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
  2192. + }
  2193. +
  2194. + template<>
  2195. + numpunct<char>::~numpunct()
  2196. + { delete _M_data; }
  2197. +
  2198. +#ifdef _GLIBCXX_USE_WCHAR_T
  2199. + template<>
  2200. + void
  2201. + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
  2202. + {
  2203. + if (!_M_data)
  2204. + _M_data = new __numpunct_cache<wchar_t>;
  2205. +
  2206. + if (!__cloc)
  2207. + {
  2208. + // "C" locale
  2209. + _M_data->_M_grouping = "";
  2210. + _M_data->_M_grouping_size = 0;
  2211. + _M_data->_M_use_grouping = false;
  2212. +
  2213. + _M_data->_M_decimal_point = L'.';
  2214. + _M_data->_M_thousands_sep = L',';
  2215. +
  2216. +#ifdef __UCLIBC_HAS_XLOCALE__
  2217. + __c_locale __old = __uselocale(_S_get_c_locale());
  2218. +#endif
  2219. + // Use ctype::widen code without the facet...
  2220. + unsigned char uc;
  2221. + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
  2222. + {
  2223. + uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
  2224. + _M_data->_M_atoms_out[__i] = btowc(uc);
  2225. + }
  2226. +
  2227. + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
  2228. + {
  2229. + uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__j]);
  2230. + _M_data->_M_atoms_in[__j] = btowc(uc);
  2231. + }
  2232. +#ifdef __UCLIBC_HAS_XLOCALE__
  2233. + __uselocale(__old);
  2234. +#endif
  2235. + }
  2236. + else
  2237. + {
  2238. + // Named locale.
  2239. +#ifdef __UCLIBC_MJN3_ONLY__
  2240. +#warning fix this
  2241. +#endif
  2242. +#ifdef __UCLIBC__
  2243. +# ifdef __UCLIBC_HAS_XLOCALE__
  2244. + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
  2245. + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
  2246. +# else
  2247. + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
  2248. + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
  2249. +# endif
  2250. +#else
  2251. + union __s_and_w { const char *__s; unsigned int __w; } __u;
  2252. + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
  2253. + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
  2254. +
  2255. + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
  2256. + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
  2257. +#endif
  2258. +
  2259. + if (_M_data->_M_thousands_sep == L'\0')
  2260. + _M_data->_M_grouping = "";
  2261. + else
  2262. + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
  2263. + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
  2264. + }
  2265. +
  2266. + // NB: There is no way to extact this info from posix locales.
  2267. + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
  2268. + _M_data->_M_truename = L"true";
  2269. + _M_data->_M_truename_size = wcslen(_M_data->_M_truename);
  2270. + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
  2271. + _M_data->_M_falsename = L"false";
  2272. + _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
  2273. + }
  2274. +
  2275. + template<>
  2276. + numpunct<wchar_t>::~numpunct()
  2277. + { delete _M_data; }
  2278. + #endif
  2279. +}
  2280. diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.4.1/libstdc++-v3/config/locale/uclibc/time_members.cc
  2281. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
  2282. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-08-12 15:54:48.000000000 -0500
  2283. @@ -0,0 +1,347 @@
  2284. +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
  2285. +
  2286. +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  2287. +//
  2288. +// This file is part of the GNU ISO C++ Library. This library is free
  2289. +// software; you can redistribute it and/or modify it under the
  2290. +// terms of the GNU General Public License as published by the
  2291. +// Free Software Foundation; either version 2, or (at your option)
  2292. +// any later version.
  2293. +
  2294. +// This library is distributed in the hope that it will be useful,
  2295. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2296. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2297. +// GNU General Public License for more details.
  2298. +
  2299. +// You should have received a copy of the GNU General Public License along
  2300. +// with this library; see the file COPYING. If not, write to the Free
  2301. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2302. +// USA.
  2303. +
  2304. +// As a special exception, you may use this file as part of a free software
  2305. +// library without restriction. Specifically, if other files instantiate
  2306. +// templates or use macros or inline functions from this file, or you compile
  2307. +// this file and link it with other files to produce an executable, this
  2308. +// file does not by itself cause the resulting executable to be covered by
  2309. +// the GNU General Public License. This exception does not however
  2310. +// invalidate any other reasons why the executable file might be covered by
  2311. +// the GNU General Public License.
  2312. +
  2313. +//
  2314. +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
  2315. +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
  2316. +//
  2317. +
  2318. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  2319. +
  2320. +#include <locale>
  2321. +#include <bits/c++locale_internal.h>
  2322. +
  2323. +#ifdef __UCLIBC_MJN3_ONLY__
  2324. +#warning tailor for stub locale support
  2325. +#endif
  2326. +#ifndef __UCLIBC_HAS_XLOCALE__
  2327. +#define __nl_langinfo_l(N, L) nl_langinfo((N))
  2328. +#endif
  2329. +
  2330. +namespace std
  2331. +{
  2332. + template<>
  2333. + void
  2334. + __timepunct<char>::
  2335. + _M_put(char* __s, size_t __maxlen, const char* __format,
  2336. + const tm* __tm) const
  2337. + {
  2338. +#ifdef __UCLIBC_HAS_XLOCALE__
  2339. + __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
  2340. +#else
  2341. + char* __old = strdup(setlocale(LC_ALL, NULL));
  2342. + setlocale(LC_ALL, _M_name_timepunct);
  2343. + strftime(__s, __maxlen, __format, __tm);
  2344. + setlocale(LC_ALL, __old);
  2345. + free(__old);
  2346. +#endif
  2347. + }
  2348. +
  2349. + template<>
  2350. + void
  2351. + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
  2352. + {
  2353. + if (!_M_data)
  2354. + _M_data = new __timepunct_cache<char>;
  2355. +
  2356. + if (!__cloc)
  2357. + {
  2358. + // "C" locale
  2359. + _M_c_locale_timepunct = _S_get_c_locale();
  2360. +
  2361. + _M_data->_M_date_format = "%m/%d/%y";
  2362. + _M_data->_M_date_era_format = "%m/%d/%y";
  2363. + _M_data->_M_time_format = "%H:%M:%S";
  2364. + _M_data->_M_time_era_format = "%H:%M:%S";
  2365. + _M_data->_M_date_time_format = "";
  2366. + _M_data->_M_date_time_era_format = "";
  2367. + _M_data->_M_am = "AM";
  2368. + _M_data->_M_pm = "PM";
  2369. + _M_data->_M_am_pm_format = "";
  2370. +
  2371. + // Day names, starting with "C"'s Sunday.
  2372. + _M_data->_M_day1 = "Sunday";
  2373. + _M_data->_M_day2 = "Monday";
  2374. + _M_data->_M_day3 = "Tuesday";
  2375. + _M_data->_M_day4 = "Wednesday";
  2376. + _M_data->_M_day5 = "Thursday";
  2377. + _M_data->_M_day6 = "Friday";
  2378. + _M_data->_M_day7 = "Saturday";
  2379. +
  2380. + // Abbreviated day names, starting with "C"'s Sun.
  2381. + _M_data->_M_aday1 = "Sun";
  2382. + _M_data->_M_aday2 = "Mon";
  2383. + _M_data->_M_aday3 = "Tue";
  2384. + _M_data->_M_aday4 = "Wed";
  2385. + _M_data->_M_aday5 = "Thu";
  2386. + _M_data->_M_aday6 = "Fri";
  2387. + _M_data->_M_aday7 = "Sat";
  2388. +
  2389. + // Month names, starting with "C"'s January.
  2390. + _M_data->_M_month01 = "January";
  2391. + _M_data->_M_month02 = "February";
  2392. + _M_data->_M_month03 = "March";
  2393. + _M_data->_M_month04 = "April";
  2394. + _M_data->_M_month05 = "May";
  2395. + _M_data->_M_month06 = "June";
  2396. + _M_data->_M_month07 = "July";
  2397. + _M_data->_M_month08 = "August";
  2398. + _M_data->_M_month09 = "September";
  2399. + _M_data->_M_month10 = "October";
  2400. + _M_data->_M_month11 = "November";
  2401. + _M_data->_M_month12 = "December";
  2402. +
  2403. + // Abbreviated month names, starting with "C"'s Jan.
  2404. + _M_data->_M_amonth01 = "Jan";
  2405. + _M_data->_M_amonth02 = "Feb";
  2406. + _M_data->_M_amonth03 = "Mar";
  2407. + _M_data->_M_amonth04 = "Apr";
  2408. + _M_data->_M_amonth05 = "May";
  2409. + _M_data->_M_amonth06 = "Jun";
  2410. + _M_data->_M_amonth07 = "Jul";
  2411. + _M_data->_M_amonth08 = "Aug";
  2412. + _M_data->_M_amonth09 = "Sep";
  2413. + _M_data->_M_amonth10 = "Oct";
  2414. + _M_data->_M_amonth11 = "Nov";
  2415. + _M_data->_M_amonth12 = "Dec";
  2416. + }
  2417. + else
  2418. + {
  2419. + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
  2420. +
  2421. + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
  2422. + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
  2423. + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
  2424. + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
  2425. + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
  2426. + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
  2427. + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
  2428. + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
  2429. + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
  2430. +
  2431. + // Day names, starting with "C"'s Sunday.
  2432. + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
  2433. + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
  2434. + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
  2435. + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
  2436. + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
  2437. + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
  2438. + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
  2439. +
  2440. + // Abbreviated day names, starting with "C"'s Sun.
  2441. + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
  2442. + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
  2443. + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
  2444. + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
  2445. + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
  2446. + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
  2447. + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
  2448. +
  2449. + // Month names, starting with "C"'s January.
  2450. + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
  2451. + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
  2452. + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
  2453. + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
  2454. + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
  2455. + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
  2456. + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
  2457. + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
  2458. + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
  2459. + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
  2460. + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
  2461. + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
  2462. +
  2463. + // Abbreviated month names, starting with "C"'s Jan.
  2464. + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
  2465. + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
  2466. + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
  2467. + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
  2468. + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
  2469. + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
  2470. + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
  2471. + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
  2472. + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
  2473. + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
  2474. + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
  2475. + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
  2476. + }
  2477. + }
  2478. +
  2479. +#ifdef _GLIBCXX_USE_WCHAR_T
  2480. + template<>
  2481. + void
  2482. + __timepunct<wchar_t>::
  2483. + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
  2484. + const tm* __tm) const
  2485. + {
  2486. +#ifdef __UCLIBC_HAS_XLOCALE__
  2487. + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
  2488. +#else
  2489. + char* __old = strdup(setlocale(LC_ALL, NULL));
  2490. + setlocale(LC_ALL, _M_name_timepunct);
  2491. + wcsftime(__s, __maxlen, __format, __tm);
  2492. + setlocale(LC_ALL, __old);
  2493. + free(__old);
  2494. +#endif
  2495. + }
  2496. +
  2497. + template<>
  2498. + void
  2499. + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
  2500. + {
  2501. + if (!_M_data)
  2502. + _M_data = new __timepunct_cache<wchar_t>;
  2503. +
  2504. +#warning wide time stuff
  2505. +// if (!__cloc)
  2506. + {
  2507. + // "C" locale
  2508. + _M_c_locale_timepunct = _S_get_c_locale();
  2509. +
  2510. + _M_data->_M_date_format = L"%m/%d/%y";
  2511. + _M_data->_M_date_era_format = L"%m/%d/%y";
  2512. + _M_data->_M_time_format = L"%H:%M:%S";
  2513. + _M_data->_M_time_era_format = L"%H:%M:%S";
  2514. + _M_data->_M_date_time_format = L"";
  2515. + _M_data->_M_date_time_era_format = L"";
  2516. + _M_data->_M_am = L"AM";
  2517. + _M_data->_M_pm = L"PM";
  2518. + _M_data->_M_am_pm_format = L"";
  2519. +
  2520. + // Day names, starting with "C"'s Sunday.
  2521. + _M_data->_M_day1 = L"Sunday";
  2522. + _M_data->_M_day2 = L"Monday";
  2523. + _M_data->_M_day3 = L"Tuesday";
  2524. + _M_data->_M_day4 = L"Wednesday";
  2525. + _M_data->_M_day5 = L"Thursday";
  2526. + _M_data->_M_day6 = L"Friday";
  2527. + _M_data->_M_day7 = L"Saturday";
  2528. +
  2529. + // Abbreviated day names, starting with "C"'s Sun.
  2530. + _M_data->_M_aday1 = L"Sun";
  2531. + _M_data->_M_aday2 = L"Mon";
  2532. + _M_data->_M_aday3 = L"Tue";
  2533. + _M_data->_M_aday4 = L"Wed";
  2534. + _M_data->_M_aday5 = L"Thu";
  2535. + _M_data->_M_aday6 = L"Fri";
  2536. + _M_data->_M_aday7 = L"Sat";
  2537. +
  2538. + // Month names, starting with "C"'s January.
  2539. + _M_data->_M_month01 = L"January";
  2540. + _M_data->_M_month02 = L"February";
  2541. + _M_data->_M_month03 = L"March";
  2542. + _M_data->_M_month04 = L"April";
  2543. + _M_data->_M_month05 = L"May";
  2544. + _M_data->_M_month06 = L"June";
  2545. + _M_data->_M_month07 = L"July";
  2546. + _M_data->_M_month08 = L"August";
  2547. + _M_data->_M_month09 = L"September";
  2548. + _M_data->_M_month10 = L"October";
  2549. + _M_data->_M_month11 = L"November";
  2550. + _M_data->_M_month12 = L"December";
  2551. +
  2552. + // Abbreviated month names, starting with "C"'s Jan.
  2553. + _M_data->_M_amonth01 = L"Jan";
  2554. + _M_data->_M_amonth02 = L"Feb";
  2555. + _M_data->_M_amonth03 = L"Mar";
  2556. + _M_data->_M_amonth04 = L"Apr";
  2557. + _M_data->_M_amonth05 = L"May";
  2558. + _M_data->_M_amonth06 = L"Jun";
  2559. + _M_data->_M_amonth07 = L"Jul";
  2560. + _M_data->_M_amonth08 = L"Aug";
  2561. + _M_data->_M_amonth09 = L"Sep";
  2562. + _M_data->_M_amonth10 = L"Oct";
  2563. + _M_data->_M_amonth11 = L"Nov";
  2564. + _M_data->_M_amonth12 = L"Dec";
  2565. + }
  2566. +#if 0
  2567. + else
  2568. + {
  2569. + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
  2570. +
  2571. + _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
  2572. + _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
  2573. + _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
  2574. + _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
  2575. + _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
  2576. + _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
  2577. + _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
  2578. + _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
  2579. + _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
  2580. +
  2581. + // Day names, starting with "C"'s Sunday.
  2582. + _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
  2583. + _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
  2584. + _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
  2585. + _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
  2586. + _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
  2587. + _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
  2588. + _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
  2589. +
  2590. + // Abbreviated day names, starting with "C"'s Sun.
  2591. + _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
  2592. + _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
  2593. + _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
  2594. + _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
  2595. + _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
  2596. + _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
  2597. + _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
  2598. +
  2599. + // Month names, starting with "C"'s January.
  2600. + _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
  2601. + _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
  2602. + _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
  2603. + _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
  2604. + _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
  2605. + _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
  2606. + _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
  2607. + _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
  2608. + _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
  2609. + _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
  2610. + _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
  2611. + _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
  2612. +
  2613. + // Abbreviated month names, starting with "C"'s Jan.
  2614. + _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
  2615. + _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
  2616. + _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
  2617. + _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
  2618. + _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
  2619. + _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
  2620. + _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
  2621. + _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
  2622. + _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
  2623. + _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
  2624. + _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
  2625. + _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
  2626. + }
  2627. +#endif // 0
  2628. + }
  2629. +#endif
  2630. +}
  2631. diff -urN gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.4.1/libstdc++-v3/config/locale/uclibc/time_members.h
  2632. --- gcc-3.4.1-dist/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
  2633. +++ gcc-3.4.1/libstdc++-v3/config/locale/uclibc/time_members.h 2004-08-12 15:54:48.000000000 -0500
  2634. @@ -0,0 +1,68 @@
  2635. +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
  2636. +
  2637. +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
  2638. +//
  2639. +// This file is part of the GNU ISO C++ Library. This library is free
  2640. +// software; you can redistribute it and/or modify it under the
  2641. +// terms of the GNU General Public License as published by the
  2642. +// Free Software Foundation; either version 2, or (at your option)
  2643. +// any later version.
  2644. +
  2645. +// This library is distributed in the hope that it will be useful,
  2646. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2647. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2648. +// GNU General Public License for more details.
  2649. +
  2650. +// You should have received a copy of the GNU General Public License along
  2651. +// with this library; see the file COPYING. If not, write to the Free
  2652. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2653. +// USA.
  2654. +
  2655. +// As a special exception, you may use this file as part of a free software
  2656. +// library without restriction. Specifically, if other files instantiate
  2657. +// templates or use macros or inline functions from this file, or you compile
  2658. +// this file and link it with other files to produce an executable, this
  2659. +// file does not by itself cause the resulting executable to be covered by
  2660. +// the GNU General Public License. This exception does not however
  2661. +// invalidate any other reasons why the executable file might be covered by
  2662. +// the GNU General Public License.
  2663. +
  2664. +//
  2665. +// ISO C++ 14882: 22.2.5.1.2 - time_get functions
  2666. +// ISO C++ 14882: 22.2.5.3.2 - time_put functions
  2667. +//
  2668. +
  2669. +// Written by Benjamin Kosnik <bkoz@redhat.com>
  2670. +
  2671. + template<typename _CharT>
  2672. + __timepunct<_CharT>::__timepunct(size_t __refs)
  2673. + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
  2674. + _M_name_timepunct(_S_get_c_name())
  2675. + { _M_initialize_timepunct(); }
  2676. +
  2677. + template<typename _CharT>
  2678. + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
  2679. + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
  2680. + _M_name_timepunct(_S_get_c_name())
  2681. + { _M_initialize_timepunct(); }
  2682. +
  2683. + template<typename _CharT>
  2684. + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
  2685. + size_t __refs)
  2686. + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
  2687. + _M_name_timepunct(__s)
  2688. + {
  2689. + char* __tmp = new char[std::strlen(__s) + 1];
  2690. + std::strcpy(__tmp, __s);
  2691. + _M_name_timepunct = __tmp;
  2692. + _M_initialize_timepunct(__cloc);
  2693. + }
  2694. +
  2695. + template<typename _CharT>
  2696. + __timepunct<_CharT>::~__timepunct()
  2697. + {
  2698. + if (_M_name_timepunct != _S_get_c_name())
  2699. + delete [] _M_name_timepunct;
  2700. + delete _M_data;
  2701. + _S_destroy_c_locale(_M_c_locale_timepunct);
  2702. + }
  2703. diff -urN gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_base.h
  2704. --- gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
  2705. +++ gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_base.h 2004-08-12 15:54:48.000000000 -0500
  2706. @@ -0,0 +1,58 @@
  2707. +// Locale support -*- C++ -*-
  2708. +
  2709. +// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
  2710. +// Free Software Foundation, Inc.
  2711. +//
  2712. +// This file is part of the GNU ISO C++ Library. This library is free
  2713. +// software; you can redistribute it and/or modify it under the
  2714. +// terms of the GNU General Public License as published by the
  2715. +// Free Software Foundation; either version 2, or (at your option)
  2716. +// any later version.
  2717. +
  2718. +// This library is distributed in the hope that it will be useful,
  2719. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2720. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2721. +// GNU General Public License for more details.
  2722. +
  2723. +// You should have received a copy of the GNU General Public License along
  2724. +// with this library; see the file COPYING. If not, write to the Free
  2725. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2726. +// USA.
  2727. +
  2728. +// As a special exception, you may use this file as part of a free software
  2729. +// library without restriction. Specifically, if other files instantiate
  2730. +// templates or use macros or inline functions from this file, or you compile
  2731. +// this file and link it with other files to produce an executable, this
  2732. +// file does not by itself cause the resulting executable to be covered by
  2733. +// the GNU General Public License. This exception does not however
  2734. +// invalidate any other reasons why the executable file might be covered by
  2735. +// the GNU General Public License.
  2736. +
  2737. +//
  2738. +// ISO C++ 14882: 22.1 Locales
  2739. +//
  2740. +
  2741. +// Information as gleaned from /usr/include/ctype.h
  2742. +
  2743. + struct ctype_base
  2744. + {
  2745. + // Note: In uClibc, the following two types depend on configuration.
  2746. +
  2747. + // Non-standard typedefs.
  2748. + typedef const __ctype_touplow_t* __to_type;
  2749. +
  2750. + // NB: Offsets into ctype<char>::_M_table force a particular size
  2751. + // on the mask type. Because of this, we don't use an enum.
  2752. + typedef __ctype_mask_t mask;
  2753. + static const mask upper = _ISupper;
  2754. + static const mask lower = _ISlower;
  2755. + static const mask alpha = _ISalpha;
  2756. + static const mask digit = _ISdigit;
  2757. + static const mask xdigit = _ISxdigit;
  2758. + static const mask space = _ISspace;
  2759. + static const mask print = _ISprint;
  2760. + static const mask graph = _ISalpha | _ISdigit | _ISpunct;
  2761. + static const mask cntrl = _IScntrl;
  2762. + static const mask punct = _ISpunct;
  2763. + static const mask alnum = _ISalpha | _ISdigit;
  2764. + };
  2765. diff -urN gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_inline.h
  2766. --- gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
  2767. +++ gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_inline.h 2004-08-12 15:54:48.000000000 -0500
  2768. @@ -0,0 +1,69 @@
  2769. +// Locale support -*- C++ -*-
  2770. +
  2771. +// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
  2772. +//
  2773. +// This file is part of the GNU ISO C++ Library. This library is free
  2774. +// software; you can redistribute it and/or modify it under the
  2775. +// terms of the GNU General Public License as published by the
  2776. +// Free Software Foundation; either version 2, or (at your option)
  2777. +// any later version.
  2778. +
  2779. +// This library is distributed in the hope that it will be useful,
  2780. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2781. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2782. +// GNU General Public License for more details.
  2783. +
  2784. +// You should have received a copy of the GNU General Public License along
  2785. +// with this library; see the file COPYING. If not, write to the Free
  2786. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2787. +// USA.
  2788. +
  2789. +// As a special exception, you may use this file as part of a free software
  2790. +// library without restriction. Specifically, if other files instantiate
  2791. +// templates or use macros or inline functions from this file, or you compile
  2792. +// this file and link it with other files to produce an executable, this
  2793. +// file does not by itself cause the resulting executable to be covered by
  2794. +// the GNU General Public License. This exception does not however
  2795. +// invalidate any other reasons why the executable file might be covered by
  2796. +// the GNU General Public License.
  2797. +
  2798. +//
  2799. +// ISO C++ 14882: 22.1 Locales
  2800. +//
  2801. +
  2802. +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
  2803. +// functions go in ctype.cc
  2804. +
  2805. + bool
  2806. + ctype<char>::
  2807. + is(mask __m, char __c) const
  2808. + { return _M_table[static_cast<unsigned char>(__c)] & __m; }
  2809. +
  2810. + const char*
  2811. + ctype<char>::
  2812. + is(const char* __low, const char* __high, mask* __vec) const
  2813. + {
  2814. + while (__low < __high)
  2815. + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
  2816. + return __high;
  2817. + }
  2818. +
  2819. + const char*
  2820. + ctype<char>::
  2821. + scan_is(mask __m, const char* __low, const char* __high) const
  2822. + {
  2823. + while (__low < __high
  2824. + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
  2825. + ++__low;
  2826. + return __low;
  2827. + }
  2828. +
  2829. + const char*
  2830. + ctype<char>::
  2831. + scan_not(mask __m, const char* __low, const char* __high) const
  2832. + {
  2833. + while (__low < __high
  2834. + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
  2835. + ++__low;
  2836. + return __low;
  2837. + }
  2838. diff -urN gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_noninline.h
  2839. --- gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
  2840. +++ gcc-3.4.1/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2004-08-12 15:54:48.000000000 -0500
  2841. @@ -0,0 +1,92 @@
  2842. +// Locale support -*- C++ -*-
  2843. +
  2844. +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
  2845. +// Free Software Foundation, Inc.
  2846. +//
  2847. +// This file is part of the GNU ISO C++ Library. This library is free
  2848. +// software; you can redistribute it and/or modify it under the
  2849. +// terms of the GNU General Public License as published by the
  2850. +// Free Software Foundation; either version 2, or (at your option)
  2851. +// any later version.
  2852. +
  2853. +// This library is distributed in the hope that it will be useful,
  2854. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2855. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2856. +// GNU General Public License for more details.
  2857. +
  2858. +// You should have received a copy of the GNU General Public License along
  2859. +// with this library; see the file COPYING. If not, write to the Free
  2860. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2861. +// USA.
  2862. +
  2863. +// As a special exception, you may use this file as part of a free software
  2864. +// library without restriction. Specifically, if other files instantiate
  2865. +// templates or use macros or inline functions from this file, or you compile
  2866. +// this file and link it with other files to produce an executable, this
  2867. +// file does not by itself cause the resulting executable to be covered by
  2868. +// the GNU General Public License. This exception does not however
  2869. +// invalidate any other reasons why the executable file might be covered by
  2870. +// the GNU General Public License.
  2871. +
  2872. +//
  2873. +// ISO C++ 14882: 22.1 Locales
  2874. +//
  2875. +
  2876. +// Information as gleaned from /usr/include/ctype.h
  2877. +
  2878. + const ctype_base::mask*
  2879. + ctype<char>::classic_table() throw()
  2880. + { return __C_ctype_b; }
  2881. +
  2882. + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
  2883. + size_t __refs)
  2884. + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
  2885. + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
  2886. + {
  2887. + _M_toupper = __C_ctype_toupper;
  2888. + _M_tolower = __C_ctype_tolower;
  2889. + _M_table = __table ? __table : __C_ctype_b;
  2890. + memset(_M_widen, 0, sizeof(_M_widen));
  2891. + memset(_M_narrow, 0, sizeof(_M_narrow));
  2892. + }
  2893. +
  2894. + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
  2895. + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
  2896. + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
  2897. + {
  2898. + _M_toupper = __C_ctype_toupper;
  2899. + _M_tolower = __C_ctype_tolower;
  2900. + _M_table = __table ? __table : __C_ctype_b;
  2901. + memset(_M_widen, 0, sizeof(_M_widen));
  2902. + memset(_M_narrow, 0, sizeof(_M_narrow));
  2903. + }
  2904. +
  2905. + char
  2906. + ctype<char>::do_toupper(char __c) const
  2907. + { return _M_toupper[static_cast<unsigned char>(__c)]; }
  2908. +
  2909. + const char*
  2910. + ctype<char>::do_toupper(char* __low, const char* __high) const
  2911. + {
  2912. + while (__low < __high)
  2913. + {
  2914. + *__low = _M_toupper[static_cast<unsigned char>(*__low)];
  2915. + ++__low;
  2916. + }
  2917. + return __high;
  2918. + }
  2919. +
  2920. + char
  2921. + ctype<char>::do_tolower(char __c) const
  2922. + { return _M_tolower[static_cast<unsigned char>(__c)]; }
  2923. +
  2924. + const char*
  2925. + ctype<char>::do_tolower(char* __low, const char* __high) const
  2926. + {
  2927. + while (__low < __high)
  2928. + {
  2929. + *__low = _M_tolower[static_cast<unsigned char>(*__low)];
  2930. + ++__low;
  2931. + }
  2932. + return __high;
  2933. + }
  2934. diff -urN gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.4.1/libstdc++-v3/config/os/uclibc/os_defines.h
  2935. --- gcc-3.4.1-dist/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
  2936. +++ gcc-3.4.1/libstdc++-v3/config/os/uclibc/os_defines.h 2004-08-12 15:54:48.000000000 -0500
  2937. @@ -0,0 +1,44 @@
  2938. +// Specific definitions for GNU/Linux -*- C++ -*-
  2939. +
  2940. +// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
  2941. +//
  2942. +// This file is part of the GNU ISO C++ Library. This library is free
  2943. +// software; you can redistribute it and/or modify it under the
  2944. +// terms of the GNU General Public License as published by the
  2945. +// Free Software Foundation; either version 2, or (at your option)
  2946. +// any later version.
  2947. +
  2948. +// This library is distributed in the hope that it will be useful,
  2949. +// but WITHOUT ANY WARRANTY; without even the implied warranty of
  2950. +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  2951. +// GNU General Public License for more details.
  2952. +
  2953. +// You should have received a copy of the GNU General Public License along
  2954. +// with this library; see the file COPYING. If not, write to the Free
  2955. +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
  2956. +// USA.
  2957. +
  2958. +// As a special exception, you may use this file as part of a free software
  2959. +// library without restriction. Specifically, if other files instantiate
  2960. +// templates or use macros or inline functions from this file, or you compile
  2961. +// this file and link it with other files to produce an executable, this
  2962. +// file does not by itself cause the resulting executable to be covered by
  2963. +// the GNU General Public License. This exception does not however
  2964. +// invalidate any other reasons why the executable file might be covered by
  2965. +// the GNU General Public License.
  2966. +
  2967. +#ifndef _GLIBCXX_OS_DEFINES
  2968. +#define _GLIBCXX_OS_DEFINES 1
  2969. +
  2970. +// System-specific #define, typedefs, corrections, etc, go here. This
  2971. +// file will come before all others.
  2972. +
  2973. +// This keeps isanum, et al from being propagated as macros.
  2974. +#define __NO_CTYPE 1
  2975. +
  2976. +#include <features.h>
  2977. +
  2978. +// We must not see the optimized string functions GNU libc defines.
  2979. +#define __NO_STRING_INLINES
  2980. +
  2981. +#endif
  2982. diff -urN gcc-3.4.1-dist/libstdc++-v3/configure gcc-3.4.1/libstdc++-v3/configure
  2983. --- gcc-3.4.1-dist/libstdc++-v3/configure 2004-06-25 17:02:47.000000000 -0500
  2984. +++ gcc-3.4.1/libstdc++-v3/configure 2004-08-12 16:20:43.000000000 -0500
  2985. @@ -3878,6 +3878,11 @@
  2986. lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
  2987. ;;
  2988. +linux-uclibc*)
  2989. + lt_cv_deplibs_check_method=pass_all
  2990. + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
  2991. + ;;
  2992. +
  2993. netbsd*)
  2994. if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
  2995. lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
  2996. @@ -5545,6 +5550,9 @@
  2997. # Default to "generic".
  2998. if test $enable_clocale_flag = auto; then
  2999. case x${target_os} in
  3000. + xlinux-uclibc*)
  3001. + enable_clocale_flag=uclibc
  3002. + ;;
  3003. xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
  3004. cat >conftest.$ac_ext <<_ACEOF
  3005. #line $LINENO "configure"
  3006. @@ -5759,6 +5767,77 @@
  3007. CTIME_CC=config/locale/generic/time_members.cc
  3008. CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
  3009. ;;
  3010. + uclibc)
  3011. + echo "$as_me:$LINENO: result: uclibc" >&5
  3012. +echo "${ECHO_T}uclibc" >&6
  3013. +
  3014. + # Declare intention to use gettext, and add support for specific
  3015. + # languages.
  3016. + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
  3017. + ALL_LINGUAS="de fr"
  3018. +
  3019. + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
  3020. + # Extract the first word of "msgfmt", so it can be a program name with args.
  3021. +set dummy msgfmt; ac_word=$2
  3022. +echo "$as_me:$LINENO: checking for $ac_word" >&5
  3023. +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
  3024. +if test "${ac_cv_prog_check_msgfmt+set}" = set; then
  3025. + echo $ECHO_N "(cached) $ECHO_C" >&6
  3026. +else
  3027. + if test -n "$check_msgfmt"; then
  3028. + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
  3029. +else
  3030. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  3031. +for as_dir in $PATH
  3032. +do
  3033. + IFS=$as_save_IFS
  3034. + test -z "$as_dir" && as_dir=.
  3035. + for ac_exec_ext in '' $ac_executable_extensions; do
  3036. + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
  3037. + ac_cv_prog_check_msgfmt="yes"
  3038. + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
  3039. + break 2
  3040. + fi
  3041. +done
  3042. +done
  3043. +
  3044. + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
  3045. +fi
  3046. +fi
  3047. +check_msgfmt=$ac_cv_prog_check_msgfmt
  3048. +if test -n "$check_msgfmt"; then
  3049. + echo "$as_me:$LINENO: result: $check_msgfmt" >&5
  3050. +echo "${ECHO_T}$check_msgfmt" >&6
  3051. +else
  3052. + echo "$as_me:$LINENO: result: no" >&5
  3053. +echo "${ECHO_T}no" >&6
  3054. +fi
  3055. +
  3056. + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
  3057. + USE_NLS=yes
  3058. + fi
  3059. + # Export the build objects.
  3060. + for ling in $ALL_LINGUAS; do \
  3061. + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
  3062. + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
  3063. + done
  3064. +
  3065. +
  3066. +
  3067. + CLOCALE_H=config/locale/uclibc/c_locale.h
  3068. + CLOCALE_CC=config/locale/uclibc/c_locale.cc
  3069. + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
  3070. + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
  3071. + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
  3072. + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
  3073. + CMESSAGES_H=config/locale/uclibc/messages_members.h
  3074. + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
  3075. + CMONEY_CC=config/locale/uclibc/monetary_members.cc
  3076. + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
  3077. + CTIME_H=config/locale/uclibc/time_members.h
  3078. + CTIME_CC=config/locale/uclibc/time_members.cc
  3079. + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
  3080. + ;;
  3081. esac
  3082. # This is where the testsuite looks for locale catalogs, using the
  3083. diff -urN gcc-3.4.1-dist/libstdc++-v3/configure.host gcc-3.4.1/libstdc++-v3/configure.host
  3084. --- gcc-3.4.1-dist/libstdc++-v3/configure.host 2004-03-18 11:36:12.000000000 -0600
  3085. +++ gcc-3.4.1/libstdc++-v3/configure.host 2004-08-12 15:54:48.000000000 -0500
  3086. @@ -217,6 +217,12 @@
  3087. ;;
  3088. esac
  3089. +# Override for uClibc since linux-uclibc gets mishandled above.
  3090. +case "${host_os}" in
  3091. + *-uclibc*)
  3092. + os_include_dir="os/uclibc"
  3093. + ;;
  3094. +esac
  3095. # Set any OS-dependent and CPU-dependent bits.
  3096. # THIS TABLE IS SORTED. KEEP IT THAT WAY.
  3097. diff -urN gcc-3.4.1-dist/libstdc++-v3/crossconfig.m4 gcc-3.4.1/libstdc++-v3/crossconfig.m4
  3098. --- gcc-3.4.1-dist/libstdc++-v3/crossconfig.m4 2004-06-10 12:12:14.000000000 -0500
  3099. +++ gcc-3.4.1/libstdc++-v3/crossconfig.m4 2004-08-12 15:54:48.000000000 -0500
  3100. @@ -122,6 +122,99 @@
  3101. ;;
  3102. esac
  3103. ;;
  3104. + *-uclibc*)
  3105. +# Temporary hack until we implement the float versions of the libm funcs
  3106. + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
  3107. + machine/endian.h machine/param.h sys/machine.h sys/types.h \
  3108. + fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
  3109. + SECTION_FLAGS='-ffunction-sections -fdata-sections'
  3110. + AC_SUBST(SECTION_FLAGS)
  3111. + GLIBCXX_CHECK_LINKER_FEATURES
  3112. + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
  3113. + GLIBCXX_CHECK_WCHAR_T_SUPPORT
  3114. +
  3115. + # For LFS.
  3116. + AC_DEFINE(HAVE_INT64_T)
  3117. + case "$target" in
  3118. + *-uclinux*)
  3119. + # Don't enable LFS with uClinux
  3120. + ;;
  3121. + *)
  3122. + AC_DEFINE(_GLIBCXX_USE_LFS)
  3123. + esac
  3124. +
  3125. + # For showmanyc_helper().
  3126. + AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
  3127. + GLIBCXX_CHECK_POLL
  3128. + GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
  3129. +
  3130. + # For xsputn_2().
  3131. + AC_CHECK_HEADERS(sys/uio.h)
  3132. + GLIBCXX_CHECK_WRITEV
  3133. +
  3134. +# AC_DEFINE(HAVE_ACOSF)
  3135. +# AC_DEFINE(HAVE_ASINF)
  3136. +# AC_DEFINE(HAVE_ATANF)
  3137. +# AC_DEFINE(HAVE_ATAN2F)
  3138. + AC_DEFINE(HAVE_CEILF)
  3139. + AC_DEFINE(HAVE_COPYSIGN)
  3140. +# AC_DEFINE(HAVE_COPYSIGNF)
  3141. +# AC_DEFINE(HAVE_COSF)
  3142. +# AC_DEFINE(HAVE_COSHF)
  3143. +# AC_DEFINE(HAVE_EXPF)
  3144. +# AC_DEFINE(HAVE_FABSF)
  3145. + AC_DEFINE(HAVE_FINITE)
  3146. + AC_DEFINE(HAVE_FINITEF)
  3147. + AC_DEFINE(HAVE_FLOORF)
  3148. +# AC_DEFINE(HAVE_FMODF)
  3149. +# AC_DEFINE(HAVE_FREXPF)
  3150. + AC_DEFINE(HAVE_HYPOT)
  3151. +# AC_DEFINE(HAVE_HYPOTF)
  3152. + AC_DEFINE(HAVE_ISINF)
  3153. + AC_DEFINE(HAVE_ISINFF)
  3154. + AC_DEFINE(HAVE_ISNAN)
  3155. + AC_DEFINE(HAVE_ISNANF)
  3156. +# AC_DEFINE(HAVE_LOGF)
  3157. +# AC_DEFINE(HAVE_LOG10F)
  3158. +# AC_DEFINE(HAVE_MODFF)
  3159. +# AC_DEFINE(HAVE_SINF)
  3160. +# AC_DEFINE(HAVE_SINHF)
  3161. +# AC_DEFINE(HAVE_SINCOS)
  3162. +# AC_DEFINE(HAVE_SINCOSF)
  3163. + AC_DEFINE(HAVE_SQRTF)
  3164. +# AC_DEFINE(HAVE_TANF)
  3165. +# AC_DEFINE(HAVE_TANHF)
  3166. + if test x"long_double_math_on_this_cpu" = x"yes"; then
  3167. + AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
  3168. +# AC_DEFINE(HAVE_ACOSL)
  3169. +# AC_DEFINE(HAVE_ASINL)
  3170. +# AC_DEFINE(HAVE_ATANL)
  3171. +# AC_DEFINE(HAVE_ATAN2L)
  3172. +# AC_DEFINE(HAVE_CEILL)
  3173. +# AC_DEFINE(HAVE_COPYSIGNL)
  3174. +# AC_DEFINE(HAVE_COSL)
  3175. +# AC_DEFINE(HAVE_COSHL)
  3176. +# AC_DEFINE(HAVE_EXPL)
  3177. +# AC_DEFINE(HAVE_FABSL)
  3178. +# AC_DEFINE(HAVE_FINITEL)
  3179. +# AC_DEFINE(HAVE_FLOORL)
  3180. +# AC_DEFINE(HAVE_FMODL)
  3181. +# AC_DEFINE(HAVE_FREXPL)
  3182. +# AC_DEFINE(HAVE_HYPOTL)
  3183. +# AC_DEFINE(HAVE_ISINFL)
  3184. +# AC_DEFINE(HAVE_ISNANL)
  3185. +# AC_DEFINE(HAVE_LOGL)
  3186. +# AC_DEFINE(HAVE_LOG10L)
  3187. +# AC_DEFINE(HAVE_MODFL)
  3188. +# AC_DEFINE(HAVE_POWL)
  3189. +# AC_DEFINE(HAVE_SINL)
  3190. +# AC_DEFINE(HAVE_SINHL)
  3191. +# AC_DEFINE(HAVE_SINCOSL)
  3192. +# AC_DEFINE(HAVE_SQRTL)
  3193. +# AC_DEFINE(HAVE_TANL)
  3194. +# AC_DEFINE(HAVE_TANHL)
  3195. + fi
  3196. + ;;
  3197. *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
  3198. AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
  3199. machine/endian.h machine/param.h sys/machine.h sys/types.h \
  3200. @@ -136,7 +229,7 @@
  3201. AC_DEFINE(HAVE_INT64_T)
  3202. case "$target" in
  3203. *-uclinux*)
  3204. - # Don't enable LFS with uClibc
  3205. + # Don't enable LFS with uClinux
  3206. ;;
  3207. *)
  3208. AC_DEFINE(_GLIBCXX_USE_LFS)
  3209. diff -urN gcc-3.4.1-dist/libstdc++-v3/include/c_compatibility/wchar.h gcc-3.4.1/libstdc++-v3/include/c_compatibility/wchar.h
  3210. --- gcc-3.4.1-dist/libstdc++-v3/include/c_compatibility/wchar.h 2003-12-08 21:51:45.000000000 -0600
  3211. +++ gcc-3.4.1/libstdc++-v3/include/c_compatibility/wchar.h 2004-08-12 16:14:07.000000000 -0500
  3212. @@ -101,7 +101,9 @@
  3213. using std::wmemcpy;
  3214. using std::wmemmove;
  3215. using std::wmemset;
  3216. +#if _GLIBCXX_HAVE_WCSFTIME
  3217. using std::wcsftime;
  3218. +#endif
  3219. #if _GLIBCXX_USE_C99
  3220. using std::wcstold;
  3221. diff -urN gcc-3.4.1-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.4.1/libstdc++-v3/include/c_std/std_cwchar.h
  3222. --- gcc-3.4.1-dist/libstdc++-v3/include/c_std/std_cwchar.h 2003-12-08 21:44:35.000000000 -0600
  3223. +++ gcc-3.4.1/libstdc++-v3/include/c_std/std_cwchar.h 2004-08-12 15:54:48.000000000 -0500
  3224. @@ -179,7 +179,9 @@
  3225. using ::wcscoll;
  3226. using ::wcscpy;
  3227. using ::wcscspn;
  3228. +#if _GLIBCXX_HAVE_WCSFTIME
  3229. using ::wcsftime;
  3230. +#endif
  3231. using ::wcslen;
  3232. using ::wcsncat;
  3233. using ::wcsncmp;