CHANGES 1.1 MB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714177151771617717177181771917720177211772217723177241772517726177271772817729177301773117732177331773417735177361773717738177391774017741177421774317744177451774617747177481774917750177511775217753177541775517756177571775817759177601776117762177631776417765177661776717768177691777017771177721777317774177751777617777177781777917780177811778217783177841778517786177871778817789177901779117792177931779417795177961779717798177991780017801178021780317804178051780617807178081780917810178111781217813178141781517816178171781817819178201782117822178231782417825178261782717828178291783017831178321783317834178351783617837178381783917840178411784217843178441784517846178471784817849178501785117852178531785417855178561785717858178591786017861178621786317864178651786617867178681786917870178711787217873178741787517876178771787817879178801788117882178831788417885178861788717888178891789017891178921789317894178951789617897178981789917900179011790217903179041790517906179071790817909179101791117912179131791417915179161791717918179191792017921179221792317924179251792617927179281792917930179311793217933179341793517936179371793817939179401794117942179431794417945179461794717948179491795017951179521795317954179551795617957179581795917960179611796217963179641796517966179671796817969179701797117972179731797417975179761797717978179791798017981179821798317984179851798617987179881798917990179911799217993179941799517996179971799817999180001800118002180031800418005180061800718008180091801018011180121801318014180151801618017180181801918020180211802218023180241802518026180271802818029180301803118032180331803418035180361803718038180391804018041180421804318044180451804618047180481804918050180511805218053180541805518056180571805818059180601806118062180631806418065180661806718068180691807018071180721807318074180751807618077180781807918080180811808218083180841808518086180871808818089180901809118092180931809418095180961809718098180991810018101181021810318104181051810618107181081810918110181111811218113181141811518116181171811818119181201812118122181231812418125181261812718128181291813018131181321813318134181351813618137181381813918140181411814218143181441814518146181471814818149181501815118152181531815418155181561815718158181591816018161181621816318164181651816618167181681816918170181711817218173181741817518176181771817818179181801818118182181831818418185181861818718188181891819018191181921819318194181951819618197181981819918200182011820218203182041820518206182071820818209182101821118212182131821418215182161821718218182191822018221182221822318224182251822618227182281822918230182311823218233182341823518236182371823818239182401824118242182431824418245182461824718248182491825018251182521825318254182551825618257182581825918260182611826218263182641826518266182671826818269182701827118272182731827418275182761827718278182791828018281182821828318284182851828618287182881828918290182911829218293182941829518296182971829818299183001830118302183031830418305183061830718308183091831018311183121831318314183151831618317183181831918320183211832218323183241832518326183271832818329183301833118332183331833418335183361833718338183391834018341183421834318344183451834618347183481834918350183511835218353183541835518356183571835818359183601836118362183631836418365183661836718368183691837018371183721837318374183751837618377183781837918380183811838218383183841838518386183871838818389183901839118392183931839418395183961839718398183991840018401184021840318404184051840618407184081840918410184111841218413184141841518416184171841818419184201842118422184231842418425184261842718428184291843018431184321843318434184351843618437184381843918440184411844218443184441844518446184471844818449184501845118452184531845418455184561845718458184591846018461184621846318464184651846618467184681846918470184711847218473184741847518476184771847818479184801848118482184831848418485184861848718488184891849018491184921849318494184951849618497184981849918500185011850218503185041850518506185071850818509185101851118512185131851418515185161851718518185191852018521185221852318524185251852618527185281852918530185311853218533185341853518536185371853818539185401854118542185431854418545185461854718548185491855018551185521855318554185551855618557185581855918560185611856218563185641856518566185671856818569185701857118572185731857418575185761857718578185791858018581185821858318584185851858618587185881858918590185911859218593185941859518596185971859818599186001860118602186031860418605186061860718608186091861018611186121861318614186151861618617186181861918620186211862218623186241862518626186271862818629186301863118632186331863418635186361863718638186391864018641186421864318644186451864618647186481864918650186511865218653186541865518656186571865818659186601866118662186631866418665186661866718668186691867018671186721867318674186751867618677186781867918680186811868218683186841868518686186871868818689186901869118692186931869418695186961869718698186991870018701187021870318704187051870618707187081870918710187111871218713187141871518716187171871818719187201872118722187231872418725187261872718728187291873018731187321873318734187351873618737187381873918740187411874218743187441874518746187471874818749187501875118752187531875418755187561875718758187591876018761187621876318764187651876618767187681876918770187711877218773187741877518776187771877818779187801878118782187831878418785187861878718788187891879018791187921879318794187951879618797187981879918800188011880218803188041880518806188071880818809188101881118812188131881418815188161881718818188191882018821188221882318824188251882618827188281882918830188311883218833188341883518836188371883818839188401884118842188431884418845188461884718848188491885018851188521885318854188551885618857188581885918860188611886218863188641886518866188671886818869188701887118872188731887418875188761887718878188791888018881188821888318884188851888618887188881888918890188911889218893188941889518896188971889818899189001890118902189031890418905189061890718908189091891018911189121891318914189151891618917189181891918920189211892218923189241892518926189271892818929189301893118932189331893418935189361893718938189391894018941189421894318944189451894618947189481894918950189511895218953189541895518956189571895818959189601896118962189631896418965189661896718968189691897018971189721897318974189751897618977189781897918980189811898218983189841898518986189871898818989189901899118992189931899418995189961899718998189991900019001190021900319004190051900619007190081900919010190111901219013190141901519016190171901819019190201902119022190231902419025190261902719028190291903019031190321903319034190351903619037190381903919040190411904219043190441904519046190471904819049190501905119052190531905419055190561905719058190591906019061190621906319064190651906619067190681906919070190711907219073190741907519076190771907819079190801908119082190831908419085190861908719088190891909019091190921909319094190951909619097190981909919100191011910219103191041910519106191071910819109191101911119112191131911419115191161911719118191191912019121191221912319124191251912619127191281912919130191311913219133191341913519136191371913819139191401914119142191431914419145191461914719148191491915019151191521915319154191551915619157191581915919160191611916219163191641916519166191671916819169191701917119172191731917419175191761917719178191791918019181191821918319184191851918619187191881918919190191911919219193191941919519196191971919819199192001920119202192031920419205192061920719208192091921019211192121921319214192151921619217192181921919220192211922219223192241922519226192271922819229192301923119232192331923419235192361923719238192391924019241192421924319244192451924619247192481924919250192511925219253192541925519256192571925819259192601926119262192631926419265192661926719268192691927019271192721927319274192751927619277192781927919280192811928219283192841928519286192871928819289192901929119292192931929419295192961929719298192991930019301193021930319304193051930619307193081930919310193111931219313193141931519316193171931819319193201932119322193231932419325193261932719328193291933019331193321933319334193351933619337193381933919340193411934219343193441934519346193471934819349193501935119352193531935419355193561935719358193591936019361193621936319364193651936619367193681936919370193711937219373193741937519376193771937819379193801938119382193831938419385193861938719388193891939019391193921939319394193951939619397193981939919400194011940219403194041940519406194071940819409194101941119412194131941419415194161941719418194191942019421194221942319424194251942619427194281942919430194311943219433194341943519436194371943819439194401944119442194431944419445194461944719448194491945019451194521945319454194551945619457194581945919460194611946219463194641946519466194671946819469194701947119472194731947419475194761947719478194791948019481194821948319484194851948619487194881948919490194911949219493194941949519496194971949819499195001950119502195031950419505195061950719508195091951019511195121951319514195151951619517195181951919520195211952219523195241952519526195271952819529195301953119532195331953419535195361953719538195391954019541195421954319544195451954619547195481954919550195511955219553195541955519556195571955819559195601956119562195631956419565195661956719568195691957019571195721957319574195751957619577195781957919580195811958219583195841958519586195871958819589195901959119592195931959419595195961959719598195991960019601196021960319604196051960619607196081960919610196111961219613196141961519616196171961819619196201962119622196231962419625196261962719628196291963019631196321963319634196351963619637196381963919640196411964219643196441964519646196471964819649196501965119652196531965419655196561965719658196591966019661196621966319664196651966619667196681966919670196711967219673196741967519676196771967819679196801968119682196831968419685196861968719688196891969019691196921969319694196951969619697196981969919700197011970219703197041970519706197071970819709197101971119712197131971419715197161971719718197191972019721197221972319724197251972619727197281972919730197311973219733197341973519736197371973819739197401974119742197431974419745197461974719748197491975019751197521975319754197551975619757197581975919760197611976219763197641976519766197671976819769197701977119772197731977419775197761977719778197791978019781197821978319784197851978619787197881978919790197911979219793197941979519796197971979819799198001980119802198031980419805198061980719808198091981019811198121981319814198151981619817198181981919820198211982219823198241982519826198271982819829198301983119832198331983419835198361983719838198391984019841198421984319844198451984619847198481984919850198511985219853198541985519856198571985819859198601986119862198631986419865198661986719868198691987019871198721987319874198751987619877198781987919880198811988219883198841988519886198871988819889198901989119892198931989419895198961989719898198991990019901199021990319904199051990619907199081990919910199111991219913199141991519916199171991819919199201992119922199231992419925199261992719928199291993019931199321993319934199351993619937199381993919940199411994219943199441994519946199471994819949199501995119952199531995419955199561995719958199591996019961199621996319964199651996619967199681996919970199711997219973199741997519976199771997819979199801998119982199831998419985199861998719988199891999019991199921999319994199951999619997199981999920000200012000220003200042000520006200072000820009200102001120012200132001420015200162001720018200192002020021200222002320024200252002620027200282002920030200312003220033200342003520036200372003820039200402004120042200432004420045200462004720048200492005020051200522005320054200552005620057200582005920060200612006220063200642006520066200672006820069200702007120072200732007420075200762007720078200792008020081200822008320084200852008620087200882008920090200912009220093200942009520096200972009820099201002010120102201032010420105201062010720108201092011020111201122011320114201152011620117201182011920120201212012220123201242012520126201272012820129201302013120132201332013420135201362013720138201392014020141201422014320144201452014620147201482014920150201512015220153201542015520156201572015820159201602016120162201632016420165201662016720168201692017020171201722017320174201752017620177201782017920180201812018220183201842018520186201872018820189201902019120192201932019420195201962019720198201992020020201202022020320204202052020620207202082020920210202112021220213202142021520216202172021820219202202022120222202232022420225202262022720228202292023020231202322023320234202352023620237202382023920240202412024220243202442024520246202472024820249202502025120252202532025420255202562025720258202592026020261202622026320264202652026620267202682026920270202712027220273202742027520276202772027820279202802028120282202832028420285202862028720288202892029020291202922029320294202952029620297202982029920300203012030220303203042030520306203072030820309203102031120312203132031420315203162031720318203192032020321203222032320324203252032620327203282032920330203312033220333203342033520336203372033820339203402034120342203432034420345203462034720348203492035020351203522035320354203552035620357203582035920360203612036220363203642036520366203672036820369203702037120372203732037420375203762037720378203792038020381203822038320384203852038620387203882038920390203912039220393203942039520396203972039820399204002040120402204032040420405204062040720408204092041020411204122041320414204152041620417204182041920420204212042220423204242042520426204272042820429204302043120432204332043420435204362043720438204392044020441204422044320444204452044620447204482044920450204512045220453204542045520456204572045820459204602046120462204632046420465204662046720468204692047020471204722047320474204752047620477204782047920480204812048220483204842048520486204872048820489204902049120492204932049420495204962049720498204992050020501205022050320504205052050620507205082050920510205112051220513205142051520516205172051820519205202052120522205232052420525205262052720528205292053020531205322053320534205352053620537205382053920540205412054220543205442054520546205472054820549205502055120552205532055420555205562055720558205592056020561205622056320564205652056620567205682056920570205712057220573205742057520576205772057820579205802058120582205832058420585205862058720588205892059020591205922059320594205952059620597205982059920600206012060220603206042060520606206072060820609206102061120612206132061420615206162061720618206192062020621206222062320624206252062620627206282062920630206312063220633206342063520636206372063820639206402064120642206432064420645206462064720648206492065020651206522065320654206552065620657206582065920660206612066220663206642066520666206672066820669206702067120672206732067420675206762067720678206792068020681206822068320684206852068620687206882068920690206912069220693206942069520696206972069820699207002070120702207032070420705207062070720708207092071020711207122071320714207152071620717207182071920720207212072220723207242072520726207272072820729207302073120732207332073420735207362073720738207392074020741207422074320744207452074620747207482074920750207512075220753207542075520756207572075820759207602076120762207632076420765207662076720768207692077020771207722077320774207752077620777207782077920780207812078220783207842078520786207872078820789207902079120792207932079420795207962079720798207992080020801208022080320804208052080620807208082080920810208112081220813208142081520816208172081820819208202082120822208232082420825208262082720828208292083020831208322083320834208352083620837208382083920840208412084220843208442084520846208472084820849208502085120852208532085420855208562085720858208592086020861208622086320864208652086620867208682086920870208712087220873208742087520876208772087820879208802088120882208832088420885208862088720888208892089020891208922089320894208952089620897208982089920900209012090220903209042090520906209072090820909209102091120912209132091420915209162091720918209192092020921209222092320924209252092620927209282092920930209312093220933209342093520936209372093820939209402094120942209432094420945209462094720948209492095020951209522095320954209552095620957209582095920960209612096220963209642096520966209672096820969209702097120972209732097420975209762097720978209792098020981209822098320984209852098620987209882098920990209912099220993209942099520996209972099820999210002100121002210032100421005210062100721008210092101021011210122101321014210152101621017210182101921020210212102221023210242102521026210272102821029210302103121032210332103421035210362103721038210392104021041210422104321044210452104621047210482104921050210512105221053210542105521056210572105821059210602106121062210632106421065210662106721068210692107021071210722107321074210752107621077210782107921080210812108221083210842108521086210872108821089210902109121092210932109421095210962109721098210992110021101211022110321104211052110621107211082110921110211112111221113211142111521116211172111821119211202112121122211232112421125211262112721128211292113021131211322113321134211352113621137211382113921140211412114221143211442114521146211472114821149211502115121152211532115421155211562115721158211592116021161211622116321164211652116621167211682116921170211712117221173211742117521176211772117821179211802118121182211832118421185211862118721188211892119021191211922119321194211952119621197211982119921200212012120221203212042120521206212072120821209212102121121212212132121421215212162121721218212192122021221212222122321224212252122621227212282122921230212312123221233212342123521236212372123821239212402124121242212432124421245212462124721248212492125021251212522125321254212552125621257212582125921260212612126221263212642126521266212672126821269212702127121272212732127421275212762127721278212792128021281212822128321284212852128621287212882128921290212912129221293212942129521296212972129821299213002130121302213032130421305213062130721308213092131021311213122131321314213152131621317213182131921320213212132221323213242132521326213272132821329213302133121332213332133421335213362133721338213392134021341213422134321344213452134621347213482134921350213512135221353213542135521356213572135821359213602136121362213632136421365213662136721368213692137021371213722137321374213752137621377213782137921380213812138221383213842138521386213872138821389213902139121392213932139421395213962139721398213992140021401214022140321404214052140621407214082140921410214112141221413214142141521416214172141821419214202142121422214232142421425214262142721428214292143021431214322143321434214352143621437214382143921440214412144221443214442144521446214472144821449214502145121452214532145421455214562145721458214592146021461214622146321464214652146621467214682146921470214712147221473214742147521476214772147821479214802148121482214832148421485214862148721488214892149021491214922149321494214952149621497214982149921500215012150221503215042150521506215072150821509215102151121512215132151421515215162151721518215192152021521215222152321524215252152621527215282152921530215312153221533215342153521536215372153821539215402154121542215432154421545215462154721548215492155021551215522155321554215552155621557215582155921560215612156221563215642156521566215672156821569215702157121572215732157421575215762157721578215792158021581215822158321584215852158621587215882158921590215912159221593215942159521596215972159821599216002160121602216032160421605216062160721608216092161021611216122161321614216152161621617216182161921620216212162221623216242162521626216272162821629216302163121632216332163421635216362163721638216392164021641216422164321644216452164621647216482164921650216512165221653216542165521656216572165821659216602166121662216632166421665216662166721668216692167021671216722167321674216752167621677216782167921680216812168221683216842168521686216872168821689216902169121692216932169421695216962169721698216992170021701217022170321704217052170621707217082170921710217112171221713217142171521716217172171821719217202172121722217232172421725217262172721728217292173021731217322173321734217352173621737217382173921740217412174221743217442174521746217472174821749217502175121752217532175421755217562175721758217592176021761217622176321764217652176621767217682176921770217712177221773217742177521776217772177821779217802178121782217832178421785217862178721788217892179021791217922179321794217952179621797217982179921800218012180221803218042180521806218072180821809218102181121812218132181421815218162181721818218192182021821218222182321824218252182621827218282182921830218312183221833218342183521836218372183821839218402184121842218432184421845218462184721848218492185021851218522185321854218552185621857218582185921860218612186221863218642186521866218672186821869218702187121872218732187421875218762187721878218792188021881218822188321884218852188621887218882188921890218912189221893218942189521896218972189821899219002190121902219032190421905219062190721908219092191021911219122191321914219152191621917219182191921920219212192221923219242192521926219272192821929219302193121932219332193421935219362193721938219392194021941219422194321944219452194621947219482194921950219512195221953219542195521956219572195821959219602196121962219632196421965219662196721968219692197021971219722197321974219752197621977219782197921980219812198221983219842198521986219872198821989219902199121992219932199421995219962199721998219992200022001220022200322004220052200622007220082200922010220112201222013220142201522016220172201822019220202202122022220232202422025220262202722028220292203022031220322203322034220352203622037220382203922040220412204222043220442204522046220472204822049220502205122052220532205422055220562205722058220592206022061220622206322064220652206622067220682206922070220712207222073220742207522076220772207822079220802208122082220832208422085220862208722088220892209022091220922209322094220952209622097220982209922100221012210222103221042210522106221072210822109221102211122112221132211422115221162211722118221192212022121221222212322124221252212622127221282212922130221312213222133221342213522136221372213822139221402214122142221432214422145221462214722148221492215022151221522215322154221552215622157221582215922160221612216222163221642216522166221672216822169221702217122172221732217422175221762217722178221792218022181221822218322184221852218622187221882218922190221912219222193221942219522196221972219822199222002220122202222032220422205222062220722208222092221022211222122221322214222152221622217222182221922220222212222222223222242222522226222272222822229222302223122232222332223422235222362223722238222392224022241222422224322244222452224622247222482224922250222512225222253222542225522256222572225822259222602226122262222632226422265222662226722268222692227022271222722227322274222752227622277222782227922280222812228222283222842228522286222872228822289222902229122292222932229422295222962229722298222992230022301223022230322304223052230622307223082230922310223112231222313223142231522316223172231822319223202232122322223232232422325223262232722328223292233022331223322233322334223352233622337223382233922340223412234222343223442234522346223472234822349223502235122352223532235422355223562235722358223592236022361223622236322364223652236622367223682236922370223712237222373223742237522376223772237822379223802238122382223832238422385223862238722388223892239022391223922239322394223952239622397223982239922400224012240222403224042240522406224072240822409224102241122412224132241422415224162241722418224192242022421224222242322424224252242622427224282242922430224312243222433224342243522436224372243822439224402244122442224432244422445224462244722448224492245022451224522245322454224552245622457224582245922460224612246222463224642246522466224672246822469224702247122472224732247422475224762247722478224792248022481224822248322484224852248622487224882248922490224912249222493224942249522496224972249822499225002250122502225032250422505225062250722508225092251022511225122251322514225152251622517225182251922520225212252222523225242252522526225272252822529225302253122532225332253422535225362253722538225392254022541225422254322544225452254622547225482254922550225512255222553225542255522556225572255822559225602256122562225632256422565225662256722568225692257022571225722257322574225752257622577225782257922580225812258222583225842258522586225872258822589225902259122592225932259422595225962259722598225992260022601226022260322604226052260622607226082260922610226112261222613226142261522616226172261822619226202262122622226232262422625226262262722628226292263022631226322263322634226352263622637226382263922640226412264222643226442264522646226472264822649226502265122652226532265422655226562265722658226592266022661226622266322664226652266622667226682266922670226712267222673226742267522676226772267822679226802268122682226832268422685226862268722688226892269022691226922269322694226952269622697226982269922700227012270222703227042270522706227072270822709227102271122712227132271422715227162271722718227192272022721227222272322724227252272622727227282272922730227312273222733227342273522736227372273822739227402274122742227432274422745227462274722748227492275022751227522275322754227552275622757227582275922760227612276222763227642276522766227672276822769227702277122772227732277422775227762277722778227792278022781227822278322784227852278622787227882278922790227912279222793227942279522796227972279822799228002280122802228032280422805228062280722808228092281022811228122281322814228152281622817228182281922820228212282222823228242282522826228272282822829228302283122832228332283422835228362283722838228392284022841228422284322844228452284622847228482284922850228512285222853228542285522856228572285822859228602286122862228632286422865228662286722868228692287022871228722287322874228752287622877228782287922880228812288222883228842288522886228872288822889228902289122892228932289422895228962289722898228992290022901229022290322904229052290622907229082290922910229112291222913229142291522916229172291822919229202292122922229232292422925229262292722928229292293022931229322293322934229352293622937229382293922940229412294222943229442294522946229472294822949229502295122952229532295422955229562295722958229592296022961229622296322964229652296622967229682296922970229712297222973229742297522976229772297822979229802298122982229832298422985229862298722988229892299022991229922299322994229952299622997229982299923000230012300223003230042300523006230072300823009230102301123012230132301423015230162301723018230192302023021230222302323024230252302623027230282302923030230312303223033230342303523036230372303823039230402304123042230432304423045230462304723048230492305023051230522305323054230552305623057230582305923060230612306223063230642306523066230672306823069230702307123072230732307423075230762307723078230792308023081230822308323084230852308623087230882308923090230912309223093230942309523096230972309823099231002310123102231032310423105231062310723108231092311023111231122311323114231152311623117231182311923120231212312223123231242312523126231272312823129231302313123132231332313423135231362313723138231392314023141231422314323144231452314623147231482314923150231512315223153231542315523156231572315823159231602316123162231632316423165231662316723168231692317023171231722317323174231752317623177231782317923180231812318223183231842318523186231872318823189231902319123192231932319423195231962319723198231992320023201232022320323204232052320623207232082320923210232112321223213232142321523216232172321823219232202322123222232232322423225232262322723228232292323023231232322323323234232352323623237232382323923240232412324223243232442324523246232472324823249232502325123252232532325423255232562325723258232592326023261232622326323264232652326623267232682326923270232712327223273232742327523276232772327823279232802328123282232832328423285232862328723288232892329023291232922329323294232952329623297232982329923300233012330223303233042330523306233072330823309233102331123312233132331423315233162331723318233192332023321233222332323324233252332623327233282332923330233312333223333233342333523336233372333823339233402334123342233432334423345233462334723348233492335023351233522335323354233552335623357233582335923360233612336223363233642336523366233672336823369233702337123372233732337423375233762337723378233792338023381233822338323384233852338623387233882338923390233912339223393233942339523396233972339823399234002340123402234032340423405234062340723408234092341023411234122341323414234152341623417234182341923420234212342223423234242342523426234272342823429234302343123432234332343423435234362343723438234392344023441234422344323444234452344623447234482344923450234512345223453234542345523456234572345823459234602346123462234632346423465234662346723468234692347023471234722347323474234752347623477234782347923480234812348223483234842348523486234872348823489234902349123492234932349423495234962349723498234992350023501235022350323504235052350623507235082350923510235112351223513235142351523516235172351823519235202352123522235232352423525235262352723528235292353023531235322353323534235352353623537235382353923540235412354223543235442354523546235472354823549235502355123552235532355423555235562355723558235592356023561235622356323564235652356623567235682356923570235712357223573235742357523576235772357823579235802358123582235832358423585235862358723588235892359023591235922359323594235952359623597235982359923600236012360223603236042360523606236072360823609236102361123612236132361423615236162361723618236192362023621236222362323624236252362623627236282362923630236312363223633236342363523636236372363823639236402364123642236432364423645236462364723648236492365023651236522365323654236552365623657236582365923660236612366223663236642366523666236672366823669236702367123672236732367423675236762367723678236792368023681236822368323684236852368623687236882368923690236912369223693236942369523696236972369823699237002370123702237032370423705237062370723708237092371023711237122371323714237152371623717237182371923720237212372223723237242372523726237272372823729237302373123732237332373423735237362373723738237392374023741237422374323744237452374623747237482374923750237512375223753237542375523756237572375823759237602376123762237632376423765237662376723768237692377023771237722377323774237752377623777237782377923780237812378223783237842378523786237872378823789237902379123792237932379423795237962379723798237992380023801238022380323804238052380623807238082380923810238112381223813238142381523816238172381823819238202382123822238232382423825238262382723828238292383023831238322383323834238352383623837238382383923840238412384223843238442384523846238472384823849238502385123852238532385423855238562385723858238592386023861238622386323864238652386623867238682386923870238712387223873238742387523876238772387823879238802388123882238832388423885238862388723888238892389023891238922389323894238952389623897238982389923900239012390223903239042390523906239072390823909239102391123912239132391423915239162391723918239192392023921239222392323924239252392623927239282392923930239312393223933239342393523936239372393823939239402394123942239432394423945239462394723948239492395023951239522395323954239552395623957239582395923960239612396223963239642396523966239672396823969239702397123972239732397423975239762397723978239792398023981239822398323984239852398623987239882398923990239912399223993239942399523996239972399823999240002400124002240032400424005240062400724008240092401024011240122401324014240152401624017240182401924020240212402224023240242402524026240272402824029240302403124032240332403424035240362403724038240392404024041240422404324044240452404624047240482404924050240512405224053240542405524056240572405824059240602406124062240632406424065240662406724068240692407024071240722407324074240752407624077240782407924080240812408224083240842408524086240872408824089240902409124092240932409424095240962409724098240992410024101241022410324104241052410624107241082410924110241112411224113241142411524116241172411824119241202412124122241232412424125241262412724128241292413024131241322413324134241352413624137241382413924140241412414224143241442414524146241472414824149241502415124152241532415424155241562415724158241592416024161241622416324164241652416624167241682416924170241712417224173241742417524176241772417824179241802418124182241832418424185241862418724188241892419024191241922419324194241952419624197241982419924200242012420224203242042420524206242072420824209242102421124212242132421424215242162421724218242192422024221242222422324224242252422624227242282422924230242312423224233242342423524236242372423824239242402424124242242432424424245242462424724248242492425024251242522425324254242552425624257242582425924260242612426224263242642426524266242672426824269242702427124272242732427424275242762427724278242792428024281242822428324284242852428624287242882428924290242912429224293242942429524296242972429824299243002430124302243032430424305243062430724308243092431024311243122431324314243152431624317243182431924320243212432224323243242432524326243272432824329243302433124332243332433424335243362433724338243392434024341243422434324344243452434624347243482434924350243512435224353243542435524356243572435824359243602436124362243632436424365243662436724368243692437024371243722437324374243752437624377243782437924380243812438224383243842438524386243872438824389243902439124392243932439424395243962439724398243992440024401244022440324404244052440624407244082440924410244112441224413244142441524416244172441824419244202442124422244232442424425244262442724428244292443024431244322443324434244352443624437244382443924440244412444224443244442444524446244472444824449244502445124452244532445424455244562445724458244592446024461244622446324464244652446624467244682446924470244712447224473244742447524476244772447824479244802448124482244832448424485244862448724488244892449024491244922449324494244952449624497244982449924500245012450224503245042450524506245072450824509245102451124512245132451424515245162451724518245192452024521245222452324524245252452624527245282452924530245312453224533245342453524536245372453824539245402454124542245432454424545245462454724548245492455024551245522455324554245552455624557245582455924560245612456224563245642456524566245672456824569245702457124572245732457424575245762457724578245792458024581245822458324584245852458624587245882458924590245912459224593245942459524596245972459824599246002460124602246032460424605246062460724608246092461024611246122461324614246152461624617246182461924620246212462224623246242462524626246272462824629246302463124632246332463424635246362463724638246392464024641246422464324644246452464624647246482464924650246512465224653246542465524656246572465824659246602466124662246632466424665246662466724668246692467024671246722467324674246752467624677246782467924680246812468224683246842468524686246872468824689246902469124692246932469424695246962469724698246992470024701247022470324704247052470624707247082470924710247112471224713247142471524716247172471824719247202472124722247232472424725247262472724728247292473024731247322473324734247352473624737247382473924740247412474224743247442474524746247472474824749247502475124752247532475424755247562475724758247592476024761247622476324764247652476624767247682476924770247712477224773247742477524776247772477824779247802478124782247832478424785247862478724788247892479024791247922479324794247952479624797247982479924800248012480224803248042480524806248072480824809248102481124812248132481424815248162481724818248192482024821248222482324824248252482624827248282482924830248312483224833248342483524836248372483824839248402484124842248432484424845248462484724848248492485024851248522485324854248552485624857248582485924860248612486224863248642486524866248672486824869248702487124872248732487424875248762487724878248792488024881248822488324884248852488624887248882488924890248912489224893248942489524896248972489824899249002490124902249032490424905249062490724908249092491024911249122491324914249152491624917249182491924920249212492224923249242492524926249272492824929249302493124932249332493424935249362493724938249392494024941249422494324944249452494624947249482494924950249512495224953249542495524956249572495824959249602496124962249632496424965249662496724968249692497024971249722497324974249752497624977249782497924980249812498224983249842498524986249872498824989249902499124992249932499424995249962499724998249992500025001250022500325004250052500625007250082500925010250112501225013250142501525016250172501825019250202502125022250232502425025250262502725028250292503025031250322503325034250352503625037250382503925040250412504225043250442504525046250472504825049250502505125052250532505425055250562505725058250592506025061250622506325064250652506625067250682506925070250712507225073250742507525076250772507825079250802508125082250832508425085250862508725088250892509025091250922509325094250952509625097250982509925100251012510225103251042510525106251072510825109251102511125112251132511425115251162511725118251192512025121251222512325124251252512625127251282512925130251312513225133251342513525136251372513825139251402514125142251432514425145251462514725148251492515025151251522515325154251552515625157251582515925160251612516225163251642516525166251672516825169251702517125172251732517425175251762517725178251792518025181251822518325184251852518625187251882518925190251912519225193251942519525196251972519825199252002520125202252032520425205252062520725208252092521025211252122521325214252152521625217252182521925220252212522225223252242522525226252272522825229252302523125232252332523425235252362523725238252392524025241252422524325244252452524625247252482524925250252512525225253252542525525256252572525825259252602526125262252632526425265252662526725268252692527025271252722527325274252752527625277252782527925280252812528225283252842528525286252872528825289252902529125292252932529425295252962529725298252992530025301253022530325304253052530625307253082530925310253112531225313253142531525316253172531825319253202532125322253232532425325253262532725328253292533025331253322533325334253352533625337253382533925340253412534225343253442534525346253472534825349253502535125352253532535425355253562535725358253592536025361253622536325364253652536625367253682536925370253712537225373253742537525376253772537825379253802538125382253832538425385253862538725388253892539025391253922539325394253952539625397253982539925400254012540225403254042540525406254072540825409254102541125412254132541425415254162541725418254192542025421254222542325424254252542625427254282542925430254312543225433254342543525436254372543825439254402544125442254432544425445254462544725448254492545025451254522545325454254552545625457254582545925460254612546225463254642546525466254672546825469254702547125472254732547425475254762547725478254792548025481254822548325484254852548625487254882548925490254912549225493254942549525496254972549825499255002550125502255032550425505255062550725508255092551025511255122551325514255152551625517255182551925520255212552225523255242552525526255272552825529255302553125532255332553425535255362553725538255392554025541255422554325544255452554625547255482554925550255512555225553255542555525556255572555825559255602556125562255632556425565255662556725568255692557025571255722557325574255752557625577255782557925580255812558225583255842558525586255872558825589255902559125592255932559425595255962559725598255992560025601256022560325604256052560625607256082560925610256112561225613256142561525616256172561825619256202562125622256232562425625256262562725628256292563025631256322563325634256352563625637256382563925640256412564225643256442564525646256472564825649256502565125652256532565425655256562565725658256592566025661256622566325664256652566625667256682566925670256712567225673256742567525676256772567825679256802568125682256832568425685256862568725688256892569025691256922569325694256952569625697256982569925700257012570225703257042570525706257072570825709257102571125712257132571425715257162571725718257192572025721257222572325724257252572625727257282572925730257312573225733257342573525736257372573825739257402574125742257432574425745257462574725748257492575025751257522575325754257552575625757257582575925760257612576225763257642576525766257672576825769257702577125772257732577425775257762577725778257792578025781257822578325784257852578625787257882578925790257912579225793257942579525796257972579825799258002580125802258032580425805258062580725808258092581025811258122581325814258152581625817258182581925820258212582225823258242582525826258272582825829258302583125832258332583425835258362583725838258392584025841258422584325844258452584625847258482584925850258512585225853258542585525856258572585825859258602586125862258632586425865258662586725868258692587025871258722587325874258752587625877258782587925880258812588225883258842588525886258872588825889258902589125892258932589425895258962589725898258992590025901259022590325904259052590625907259082590925910259112591225913259142591525916259172591825919259202592125922259232592425925259262592725928259292593025931259322593325934259352593625937259382593925940259412594225943259442594525946259472594825949259502595125952259532595425955259562595725958259592596025961259622596325964259652596625967259682596925970259712597225973259742597525976259772597825979259802598125982259832598425985259862598725988259892599025991259922599325994259952599625997259982599926000260012600226003260042600526006260072600826009260102601126012260132601426015260162601726018260192602026021260222602326024260252602626027260282602926030260312603226033260342603526036260372603826039260402604126042260432604426045260462604726048260492605026051260522605326054260552605626057260582605926060260612606226063260642606526066260672606826069260702607126072260732607426075260762607726078260792608026081260822608326084260852608626087260882608926090260912609226093260942609526096260972609826099261002610126102261032610426105261062610726108261092611026111261122611326114261152611626117261182611926120261212612226123261242612526126261272612826129261302613126132261332613426135261362613726138261392614026141261422614326144261452614626147261482614926150261512615226153261542615526156261572615826159261602616126162261632616426165261662616726168261692617026171261722617326174261752617626177261782617926180261812618226183261842618526186261872618826189261902619126192261932619426195261962619726198261992620026201262022620326204262052620626207262082620926210262112621226213262142621526216262172621826219262202622126222262232622426225262262622726228262292623026231262322623326234262352623626237262382623926240262412624226243262442624526246262472624826249262502625126252262532625426255262562625726258262592626026261262622626326264262652626626267262682626926270262712627226273262742627526276262772627826279262802628126282262832628426285262862628726288262892629026291262922629326294262952629626297262982629926300263012630226303263042630526306263072630826309263102631126312263132631426315263162631726318263192632026321263222632326324263252632626327263282632926330263312633226333263342633526336263372633826339263402634126342263432634426345263462634726348263492635026351263522635326354263552635626357263582635926360263612636226363263642636526366263672636826369263702637126372263732637426375263762637726378263792638026381263822638326384263852638626387263882638926390263912639226393263942639526396263972639826399264002640126402264032640426405264062640726408264092641026411264122641326414264152641626417264182641926420264212642226423264242642526426264272642826429264302643126432264332643426435264362643726438264392644026441264422644326444264452644626447264482644926450264512645226453264542645526456264572645826459264602646126462264632646426465264662646726468264692647026471264722647326474264752647626477264782647926480264812648226483264842648526486264872648826489264902649126492264932649426495264962649726498264992650026501265022650326504265052650626507265082650926510265112651226513265142651526516265172651826519265202652126522265232652426525265262652726528265292653026531265322653326534265352653626537265382653926540265412654226543265442654526546265472654826549265502655126552265532655426555265562655726558265592656026561265622656326564265652656626567265682656926570265712657226573265742657526576265772657826579265802658126582265832658426585265862658726588265892659026591265922659326594265952659626597265982659926600266012660226603266042660526606266072660826609266102661126612266132661426615266162661726618266192662026621266222662326624266252662626627266282662926630266312663226633266342663526636266372663826639266402664126642266432664426645266462664726648266492665026651266522665326654266552665626657266582665926660266612666226663266642666526666266672666826669266702667126672266732667426675266762667726678266792668026681266822668326684266852668626687266882668926690266912669226693266942669526696266972669826699267002670126702267032670426705267062670726708267092671026711267122671326714267152671626717267182671926720267212672226723267242672526726267272672826729267302673126732267332673426735267362673726738267392674026741267422674326744267452674626747267482674926750267512675226753267542675526756267572675826759267602676126762267632676426765267662676726768267692677026771267722677326774267752677626777267782677926780267812678226783267842678526786267872678826789267902679126792267932679426795267962679726798267992680026801268022680326804268052680626807268082680926810268112681226813268142681526816268172681826819268202682126822268232682426825268262682726828268292683026831268322683326834268352683626837268382683926840268412684226843268442684526846268472684826849268502685126852268532685426855268562685726858268592686026861268622686326864268652686626867268682686926870268712687226873268742687526876268772687826879268802688126882268832688426885268862688726888268892689026891268922689326894268952689626897268982689926900269012690226903269042690526906269072690826909269102691126912269132691426915269162691726918269192692026921269222692326924269252692626927269282692926930269312693226933269342693526936269372693826939269402694126942269432694426945269462694726948269492695026951269522695326954269552695626957269582695926960269612696226963269642696526966269672696826969269702697126972269732697426975269762697726978269792698026981269822698326984269852698626987269882698926990269912699226993269942699526996269972699826999270002700127002270032700427005270062700727008270092701027011270122701327014270152701627017270182701927020270212702227023270242702527026270272702827029270302703127032270332703427035270362703727038270392704027041270422704327044270452704627047270482704927050270512705227053270542705527056270572705827059270602706127062270632706427065270662706727068270692707027071270722707327074270752707627077270782707927080270812708227083270842708527086270872708827089270902709127092270932709427095270962709727098270992710027101271022710327104271052710627107271082710927110271112711227113271142711527116271172711827119271202712127122271232712427125271262712727128271292713027131271322713327134271352713627137271382713927140271412714227143271442714527146271472714827149271502715127152271532715427155271562715727158271592716027161271622716327164271652716627167271682716927170271712717227173271742717527176271772717827179271802718127182271832718427185271862718727188271892719027191271922719327194271952719627197271982719927200272012720227203272042720527206272072720827209272102721127212272132721427215272162721727218272192722027221272222722327224272252722627227272282722927230272312723227233272342723527236272372723827239272402724127242272432724427245272462724727248272492725027251272522725327254272552725627257272582725927260272612726227263272642726527266272672726827269272702727127272272732727427275272762727727278272792728027281272822728327284272852728627287272882728927290272912729227293272942729527296272972729827299273002730127302273032730427305273062730727308273092731027311273122731327314273152731627317273182731927320273212732227323273242732527326273272732827329273302733127332273332733427335273362733727338273392734027341273422734327344273452734627347273482734927350273512735227353273542735527356273572735827359273602736127362273632736427365273662736727368273692737027371273722737327374273752737627377273782737927380273812738227383273842738527386273872738827389273902739127392273932739427395273962739727398273992740027401274022740327404274052740627407274082740927410274112741227413274142741527416274172741827419274202742127422274232742427425274262742727428274292743027431274322743327434274352743627437274382743927440274412744227443274442744527446274472744827449274502745127452274532745427455274562745727458274592746027461274622746327464274652746627467274682746927470274712747227473274742747527476274772747827479274802748127482274832748427485274862748727488274892749027491274922749327494274952749627497274982749927500275012750227503275042750527506275072750827509275102751127512275132751427515275162751727518275192752027521275222752327524275252752627527275282752927530275312753227533275342753527536275372753827539275402754127542275432754427545275462754727548275492755027551275522755327554275552755627557275582755927560275612756227563275642756527566275672756827569275702757127572275732757427575275762757727578275792758027581275822758327584275852758627587275882758927590275912759227593275942759527596275972759827599276002760127602276032760427605276062760727608276092761027611276122761327614276152761627617276182761927620276212762227623276242762527626276272762827629276302763127632276332763427635276362763727638276392764027641276422764327644276452764627647276482764927650276512765227653276542765527656276572765827659276602766127662276632766427665276662766727668276692767027671276722767327674276752767627677276782767927680276812768227683276842768527686276872768827689276902769127692276932769427695276962769727698276992770027701277022770327704277052770627707277082770927710277112771227713277142771527716277172771827719277202772127722277232772427725277262772727728277292773027731277322773327734277352773627737277382773927740277412774227743277442774527746277472774827749277502775127752277532775427755277562775727758277592776027761277622776327764277652776627767277682776927770277712777227773277742777527776277772777827779277802778127782277832778427785277862778727788277892779027791277922779327794277952779627797277982779927800278012780227803278042780527806278072780827809278102781127812278132781427815278162781727818278192782027821278222782327824278252782627827278282782927830278312783227833278342783527836278372783827839278402784127842278432784427845278462784727848278492785027851278522785327854278552785627857278582785927860278612786227863278642786527866278672786827869278702787127872278732787427875278762787727878278792788027881278822788327884278852788627887278882788927890278912789227893278942789527896278972789827899279002790127902279032790427905279062790727908279092791027911279122791327914279152791627917279182791927920279212792227923279242792527926279272792827929279302793127932279332793427935279362793727938279392794027941279422794327944279452794627947279482794927950279512795227953279542795527956279572795827959279602796127962279632796427965279662796727968279692797027971279722797327974279752797627977279782797927980279812798227983279842798527986279872798827989279902799127992
  1. SWIG (Simplified Wrapper and Interface Generator)
  2. See the CHANGES.current file for changes in the current version.
  3. See the RELEASENOTES file for a summary of changes in each release.
  4. Issue # numbers mentioned below can be found on Github. For more details, add
  5. the issue number to the end of the URL: https://github.com/swig/swig/issues/
  6. Version 4.1.0 (24 Oct 2022)
  7. ===========================
  8. 2022-10-24: wsfulton, AndLLA
  9. [R] #2386 Fix problems in shared_ptr wrappers where the class names
  10. were not consistent when using the shared_ptr template or the actual
  11. underlying type.
  12. 2022-10-24: wsfulton
  13. [R] Add support for special variable replacement in the $typemap()
  14. special variable macro for R specific typemaps (rtype, rtypecheck,
  15. scoercein, scoereout).
  16. 2022-10-24: wsfulton
  17. [R] Polymorphism in the wrappers was only working for C++ classes,
  18. now this works for C++ structs too.
  19. 2022-10-19: olly
  20. [Lua] #2126 Fix type resolution between multiple SWIG-wrapped
  21. modules.
  22. 2022-10-17: wsfulton
  23. [R] #2385 Add support for std::vector<std::vector<std::string>>.
  24. 2022-10-14: murillo128
  25. [Javascript] #2109 Tweak unsigned long and unsigned long long typemaps
  26. to create a v8::Number instead of v8::Integer if the value exceeds
  27. the size of v8::Integer. Note that the v8::Number value will be
  28. imprecise if the value is > MAX_SAFE_INTEGER.
  29. 2022-10-14: olly
  30. [R] Arrange that destructors of local C++ objects in the wrapper
  31. function get run on SWIG_fail (which calls Rf_error() which calls
  32. longjmp()).
  33. 2022-10-14: olly
  34. [Lua] Arrange that destructors of local C++ objects in the wrapper
  35. function get run on SWIG_fail (which calls lua_error() which calls
  36. longjmp()).
  37. 2022-10-13: wsfulton
  38. [R] Add missing SWIGTYPE *const& typemaps for supporting pointers
  39. by const reference.
  40. 2022-10-10: wsfulton
  41. #2160 Fix compile error when using templates with more than one template
  42. parameter and used as an input parameter in a virtual method in a
  43. director class (problem affecting most of the scripting languages).
  44. 2022-10-10: treitmayr, wsfulton
  45. [Python, Ruby] #1811 #1823 Fix invalid code generated in some cases when
  46. returning a pointer or reference to a director-enabled class instance.
  47. This previously only worked in very simple cases, now return types are
  48. resolved to fix. A bug in template instantiations using pointers also
  49. works now.
  50. 2022-10-06: wsfulton
  51. [CFFI] #1966 #2200 Remove code for Common Lisp CFFI. We dropped support
  52. for it in SWIG 4.0.0 by disabling it as the first stage. This is the
  53. final stage for complete removal as there has been no meaningful
  54. progress to revive it to the status of experimental language.
  55. 2022-10-06: olly
  56. [Python] #2390 Remove deprecated and apparently useless defarg.swg
  57. The only documentation is in the file itself and describes a Python
  58. wrapper around the C function defined here, but digging though the
  59. git history this Python wrapper doesn't seem to have ever actually
  60. been generated by SWIG.
  61. This file was also marked as deprecated in 2005.
  62. 2022-10-06: wsfulton
  63. [Java] #2048 Fix quoting for doxygen \image command to quote the output
  64. file name generated into the html src attribute.
  65. 2022-10-05: benjamin-sch
  66. [Python] added an interpreter counter to fix deinitialization
  67. issues if multiple subinterpreters are used
  68. 2022-10-05: olly, wsfulton
  69. #672 Add support for parsing C++11 final classes such as:
  70. class X final {};
  71. This no longer gives a syntax error.
  72. 2022-10-05: wsfulton
  73. [OCaml] Fix %rename for enum items. Previously the rename had no effect.
  74. 2022-10-05: olly
  75. #1465 Report errors in preprocessor expressions by default
  76. Until now SWIG quietly ignored such errors unless -Wextra (or -Wall
  77. which implies -Wextra) was passed, but this is unhelpful as it tends
  78. to hide genuine problems. To illustrate this point, enabling this
  79. warning by default revealed a typo in the preproc_defined.i
  80. testcase in SWIG's own testsuite.
  81. If you really don't want to see this warning, you can suppress it
  82. with command line option -w202 or by using this in your interface
  83. file:
  84. %warnfilter(SWIGWARN_PP_EVALUATION);
  85. Both will work with older versions of SWIG too.
  86. 2022-10-04: olly
  87. #1050 Consistently define SWIG_VERSION both at SWIG-time and in
  88. the generated wrapper. Best practice remains to check at SWIG-time
  89. where possible because that results in smaller generated wrapper
  90. sources.
  91. SWIGGO and SWIGJAVASCRIPT are now defined in the generated wrappers
  92. to match behaviour for all other target languages.
  93. The undocumented SWIGVERSION macro is no longer defined.
  94. 2022-09-29: olly
  95. #2303 SWIG's internal hash tables now use a better hash function.
  96. The old hash function only considerd the last five characters
  97. plus the least significant bit of the last-but-sixth character,
  98. which as you might guess generated a lot of many-way collisions.
  99. This change seems to give about a 4% reduction in wallclock time
  100. for processing li_std_list_wrap.i from the testsuite for Python.
  101. The hash collision rate for this example drops from 39% to 0!
  102. 2022-09-29: wsfulton
  103. #2303 Type tables are now output in a fixed order whereas previously
  104. the order may change with any minor input code change. This shouldn't
  105. affect users except SWIG_TypePrettyName may output a different C/C++
  106. typedef to a type - it's used mostly for showing errors when the type
  107. passed to a function is wrong.
  108. 2022-09-29: olly
  109. [PHP] Dynamic class properties are no longer supported by default.
  110. Historically PHP has supported dynamic class properties and SWIG
  111. has implemented them too (because we implement the magic __get(),
  112. __set() and __isset() methods we need to include explicit
  113. handling).
  114. PHP 8.2 deprecates dynamic class properties - initially they'll
  115. warn, and apparently they'll not work by default in PHP 9.0:
  116. https://wiki.php.net/rfc/deprecate_dynamic_properties
  117. In PHP code dynamic properties can be enabled for a class by
  118. marking that class with the attribute `#[AllowDynamicProperties]`.
  119. To follow this PHP change, in SWIG you now need to specify
  120. `%feature("php:allowdynamicproperties", 1) Foo;` (or
  121. `%feature("php:allowdynamicproperties", 1)` to enable it for
  122. all wrapped classes). Unknown features are ignored, so you can add
  123. it unconditionally and it'll work with older SWIG too.
  124. *** POTENTIAL INCOMPATIBILITY ***
  125. 2022-09-19: wsfulton
  126. #1484 Fixes for class inheritance with the same name in different namespaces
  127. such as:
  128. namespace A { class Bar {}; }
  129. namespace B { template<typename T, typename U> class Bar : public A::Bar {}; }
  130. 2022-09-19: wsfulton
  131. #2316 Remove swig.spec file and srcrpm makefile target. These are very out of date
  132. and don't seem to be used by RPM based Linux distributions which have their
  133. own version of swig.spec.
  134. 2022-09-17: wsfulton
  135. [Go, Guile, Racket, Scilab] Add throws typemaps for std::string so that thrown
  136. string exception messages can be seen.
  137. 2022-09-17: wsfulton
  138. [Racket] Add throws typemaps for char * so that thrown string exception
  139. messages can be seen from Racket.
  140. 2022-09-17: wsfulton
  141. [Javascript, Octave, R] Improve exceptions for %catches and exception
  142. specifications for native types. String exception messages are shown as
  143. the exception message instead of just the type of the exception.
  144. 2022-09-17: wsfulton
  145. Add missing typecheck typemaps for std::auto_ptr and std::unique_ptr to
  146. fix overloading when using these types.
  147. 2022-09-17: wsfulton
  148. [Guile] Add error checking to SWIGTYPE and SWIGTYPE & in typemaps to prevent
  149. seg faults when passing #nil to these parameter types.
  150. 2022-09-16: wsfulton
  151. #999 Provide SWIGTYPE MOVE typemaps in swigmove.i for implementing full
  152. move semantics when passing parameters by value.
  153. 2022-08-31: wsfulton
  154. #999 Improve move semantics when using rvalue references.
  155. The SWIGTYPE && input typemaps now assume the object has been moved.
  156. These typemaps have been changed assuming that after the function call,
  157. the rvalue reference parameter has been moved. The parameter's proxy class
  158. that owns the C++ object thus has the underlying pointer set to null
  159. so that the (moved from, but still valid) C++ object cannot be used again
  160. and the object is additionally deleted.
  161. *** POTENTIAL INCOMPATIBILITY ***
  162. 2022-08-28: wsfulton
  163. [Octave] SWIG now marshals a C/C++ NULL pointer into the null matrix, [].
  164. SWIG has always marshalled the null matrix into a NULL pointer; this remains
  165. and now we have consistency in representing a NULL pointer.
  166. 2022-08-26: wsfulton
  167. [Racket] SWIG now marshals a C/C++ NULL pointer into a null value by calling
  168. scheme_make_null(), so that scheme's null? is true for a NULL C/C++ pointer value.
  169. 2022-08-18: wsfulton
  170. [Racket] Add support for std::unique_ptr in std_unique_ptr.i.
  171. Add support for std::auto_ptr in std_auto_ptr.i.
  172. 2022-08-13: wsfulton
  173. [Guile] Add support for std::unique_ptr in std_unique_ptr.i.
  174. Add support for std::auto_ptr in std_auto_ptr.i.
  175. 2022-08-11: wsfulton
  176. [Lua] Add support for std::unique_ptr in std_unique_ptr.i.
  177. Add support for std::auto_ptr in std_auto_ptr.i.
  178. 2022-08-05: wsfulton
  179. [D] Fix occasional undefined behaviour with inheritance hierarchies, particularly
  180. when using virtual inheritance as the pointers weren't correctly upcast from derived
  181. class to base class when stored in the base's proxy class.
  182. 2022-08-05: wsfulton
  183. [D] Add support for std::unique_ptr in std_unique_ptr.i.
  184. Add support for std::auto_ptr in std_auto_ptr.i.
  185. 2022-08-03: wsfulton
  186. [Javascript] Add support for std::unique_ptr in std_unique_ptr.i.
  187. Add support for std::auto_ptr in std_auto_ptr.i.
  188. 2022-08-02: wsfulton
  189. [Octave] Add support for std::unique_ptr in std_unique_ptr.i.
  190. Add support for std::auto_ptr in std_auto_ptr.i.
  191. 2022-08-01: wsfulton
  192. [Python] Add initialisers for additional members in PyHeapTypeObject
  193. (builtin mode) for Python-3.11 - _ht_tpname, _spec_cache.
  194. 2022-07-30: wsfulton
  195. C++20 has deprecated std::basic_string<>::reserve() and the C++11 method
  196. std::basic_string<>::shrink_to_fit() is a replacement that can be used.
  197. std_string.i and std_wstring.i provided wrappers for reserve with the following
  198. template instantiations:
  199. %template(string) std::basic_string<char>;
  200. %template(wstring) std::basic_string<wchar_t>;
  201. The reserve method is no longer wrapped, however the shrink_to_fit() method
  202. can be used as an alternative from the target language (the generated wrappers
  203. call reserve() instead if C++<=20).
  204. Note that std::basic_string<>::reserve(size_t n) is still wrapped unchanged.
  205. *** POTENTIAL INCOMPATIBILITY ***
  206. 2022-07-30: wsfulton
  207. [Tcl] Add support for std::unique_ptr in std_unique_ptr.i.
  208. Add support for std::auto_ptr in std_auto_ptr.i.
  209. 2022-07-27: ZackerySpytz, olly
  210. #1678 Support parsing C++20 templated lambdas.
  211. 2022-07-27: ZackerySpytz, olly
  212. #1622 Add support for the C++20 spaceship operator (<=>).
  213. 2022-07-26: olly
  214. [Tcl] https://sourceforge.net/p/swig/bugs/977/
  215. Fix handling of long long on 32-bit platforms. This fix raises
  216. SWIG's minimum supported Tcl version to 8.4.0 (which was released
  217. just under 20 years ago).
  218. 2022-07-26: olly
  219. Fix incorrect operator precedence in preprocessor expressions.
  220. 2022-07-25: olly
  221. Support for C++14 binary integer literals in preprocessor expressions.
  222. 2022-07-20: wsfulton
  223. [C#, Java] Ensure the order of interfaces generated in proxy interfaces for the
  224. %interface family of macros is the same as that parsed from the bases in C++.
  225. 2022-07-20: jicks, Ingener74, olly
  226. #422 [Python] Fix mishandling of a Python class inheriting from
  227. multiple SWIG-wrapped director classes.
  228. 2022-07-19: wsfulton
  229. #692 [C#, Java, Perl, Python, Ruby] std::unique_ptr and std::auto_ptr typemaps
  230. provided for inputs types in std_unique_ptr.i and std_auto_ptr.i.
  231. Now these smart pointers can be used as input parameters to functions. A proxy
  232. class instance transfers memory ownership of the underlying C++ object from the
  233. proxy class to a smart pointer instance passed to the wrapped function.
  234. 2022-07-19: jschueller
  235. [Python] #2314 Drop support for Python 3.2.
  236. 2022-07-19: olly
  237. Remove remaining support code for classic macos, which has not been
  238. supported by Apple for over 20 years now.
  239. 2022-07-12: wsfulton
  240. #999 Performance optimisation for parameters passed by value that are C++11 movable.
  241. The C++ wrappers create a temporary variable for a parameter to be passed to a
  242. function. This is initially default constructed and then copy assigned from the
  243. instance being passed in from the target language. This is unchanged, however,
  244. when the temporary variable is passed to the wrapped function, it is now done using
  245. std::move. If the type is move constructible, the move constructor will be used
  246. instead of the copy constructor.
  247. 2022-07-12: wsfulton
  248. [Perl] Add std::auto_ptr support in std_auto_ptr.i library file.
  249. 2022-07-12: erezgeva
  250. [Perl] Add std::unique_ptr support in std_unique_ptr.i library file.
  251. 2022-07-07: jmarrec
  252. #1158 #2286 Add basic support for C++11 attributes. These are now
  253. crudely ignored by SWIG's parser's tokeniser, which is better that
  254. failing with a parse error.
  255. 2022-07-05: ianlancetaylor
  256. [Go] #2245 Handle NULL pointers for string* conversions.
  257. Rearrange generation of director methods and rename
  258. receiver argument from p to swig_p.
  259. 2022-07-03: wsfulton
  260. #999 Performance optimisation for directors for classes passed by value. The directorin
  261. typemaps in the director methods now use std::move on the input parameter when
  262. copying the object from the stack to the heap prior to the callback into the target
  263. language, thereby taking advantage of move semantics if available.
  264. 2022-07-02: wsfulton
  265. #1722 [C#, Java, Python, Ruby] Add std::unique_ptr support. Ported from std::auto_ptr.
  266. Use the %unique_ptr(T) macro as follows for usage std::unique_ptr<T>. For example, for
  267. a class called Klass:
  268. %include "std_unique_ptr.i"
  269. %unique_ptr(Klass)
  270. Support is currently limited to only returning a std::unique_ptr from a function.
  271. 2022-06-29: wsfulton
  272. #999 #1044 Enhance SWIGTYPE "out" typemaps to use std::move when copying
  273. objects, thereby making use of move semantics when wrapping a function returning
  274. by value if the returned type supports move semantics.
  275. Wrapping functions that return move only types 'by value' now work out the box
  276. without having to provide custom typemaps.
  277. The implementation removed all casts in the "out" typemaps to allow the compiler to
  278. appropriately choose calling a move constructor, where possible, otherwise a copy
  279. constructor. The implementation also required modifying SwigValueWrapper to
  280. change a cast operator from:
  281. SwigValueWrapper::operator T&() const;
  282. to
  283. #if __cplusplus >=201103L
  284. SwigValueWrapper::operator T&&() const;
  285. #else
  286. SwigValueWrapper::operator T&() const;
  287. #endif
  288. This is not backwards compatible for C++11 and later when using the valuewrapper feature
  289. if a cast is explicitly being made in user supplied "out" typemaps. Suggested change
  290. in custom "out" typemaps for C++11 and later code:
  291. 1. Try remove the cast altogether to let the compiler use an appropriate implicit cast.
  292. 2. Change the cast, for example, from static_cast<X &> to static_cast<X &&>, using the
  293. __cplusplus macro if all versions of C++ need to be supported.
  294. *** POTENTIAL INCOMPATIBILITY ***
  295. 2022-06-15: wsfulton
  296. #2039 Add move assignment operator to SwigValueWrapper used by the
  297. valuewrapper feature.
  298. 2022-06-04: sethrj
  299. Enhance $typemap to support typemap attributes.
  300. $typemap(method:attribute, typepattern)
  301. For example:
  302. %typemap(cstype, out="object") XClass "XClass"
  303. %typemap(cscode) BarClass %{
  304. $typemap(cstype:out, XClass) bar() {
  305. return null;
  306. }
  307. which expands to
  308. object bar() {
  309. return null;
  310. }
  311. 2022-05-30: wsfulton
  312. [C#, D] Add new special variable expansion: $imfuncname.
  313. Expands to the function name called in the intermediary class.
  314. 2022-05-30: LindleyF
  315. [Java] #2042 Add new special variable expansion: $imfuncname.
  316. Expands to the function name called in the intermediary class.
  317. 2022-05-28: jkuebart
  318. [Java] On some versions of Android, specifically Android 6,
  319. detaching the current thread from the JVM after every invocation
  320. causes a memory leak.
  321. Offer SWIG_JAVA_DETACH_ON_THREAD_END to configure a behaviour
  322. where the JVM is only detached in the thread destructor.
  323. See https://developer.android.com/training/articles/perf-jni#threads.
  324. 2022-05-27: xypron
  325. [Python] #2277 Define PY_SSIZE_T_CLEAN macro before #include "Python.h" as
  326. recommended in Python 3.7 and later.
  327. To avoid this macro definition, add the following to your interface file so
  328. that SWIG_NO_PY_SSIZE_T_CLEAN is defined at the beginning of the C++ wrappers:
  329. %begin %{
  330. #define SWIG_NO_PY_SSIZE_T_CLEAN
  331. %}
  332. 2022-05-26: rokups
  333. [C#] #1323 Modify SwigDerivedClassHasMethod for a more efficient director
  334. implementation when calling virtual methods that are not overridden.
  335. 2022-05-15: erezgeva, eiselekd
  336. [Lua, Perl, Octave, PHP, Tcl] #2275 #2276 #2283 Add argcargv.i library containing
  337. (int ARGC, char **ARGV) multi-argument typemaps.
  338. Document this library in Typemaps.html.
  339. 2022-05-07: KrisThielemans
  340. [Python] Fix "too many initializers for 'PyHeapTypeObject'" errors
  341. using PyPy 3.8 and later.
  342. 2022-05-04: wsfulton
  343. [C#] Add C# wchar_t * director typemaps
  344. 2022-04-20: cminyard
  345. Fix an issue where newlines were not properly generated
  346. for godirectorin typemaps. If you have a virtual function
  347. not assigned to zero, in some cases it won't generate a
  348. newline and you will see errors:
  349. example.go:1508:3: expected ';', found swig_r
  350. when compiling the go code.
  351. Also add an example of using goin and godirectorin and add
  352. a test for this situation.
  353. 2022-04-29: jason-daly, JerryJoyce, wsfulton
  354. [C#] #1233 Add wchar_t * and std::wstring Unicode string support on Linux.
  355. 2022-04-11: robinst
  356. #2257 Fix new Ruby 3.2 warning "undefining the allocator of T_DATA
  357. class swig_runtime_data".
  358. 2022-04-07: olly
  359. #1750 SWIG now recognises and ignores Doxygen group commands `@{` and `@}`.
  360. 2022-04-06: wsfulton
  361. ./configure now enables C++11 and later C++ standards testing by default (when
  362. running: 'make check').
  363. The options to control this testing are the same:
  364. ./configure --enable-cpp11-testing
  365. ./configure --disable-cpp11-testing
  366. But the former is now the default and the latter can be used to turn off C++11 and
  367. later C++ standards testing.
  368. 2022-04-06: wsfulton
  369. [Python] #1635 The "autodoc" feature no longer overrides Doxygen comments
  370. in the generated docstring.
  371. If a "docstring" feature is present it will still override a Doxygen comment.
  372. If the "autodoc" feature is also present, the combined "autodoc" and "docstring"
  373. will override the Doxygen comment. If no "docstring" is present then the
  374. "autodoc" feature will not be generated when there is a Doxygen comment.
  375. This way the "autodoc" feature can be specified and used to provide documentation
  376. for 'missing' Doxygen comments.
  377. *** POTENTIAL INCOMPATIBILITY ***
  378. 2022-04-01: olly
  379. Remove undocumented and non-functional -browse command line option.
  380. 2022-03-26: eltoder
  381. [Python] #1684 Use different capsule names with and without -builtin
  382. Types generated with and without -builtin are not compatible. Mixing
  383. them in a common type list leads to crashes. Avoid this by using
  384. different capsule names: "type_pointer_capsule" without -builtin and
  385. "type_pointer_capsule_builtin" with.
  386. 2022-03-25: wsfulton
  387. The debug command line options that display parse tree nodes
  388. (-debug-module, -debug-top, -debug-symtabs) now display previously hidden
  389. linked list pointers which are useful for debugging parse trees.
  390. Added new command line option -debug-quiet. This suppresses the display
  391. of most linked list pointers and symbol table pointers in the parse tree nodes.
  392. The keys in the parse tree node are now shown in alphabetical order.
  393. 2022-03-24: wsfulton
  394. #2244 Fix using declaration in derived class bugs when all the base
  395. class's overloaded methods were overridden in the derived class -
  396. fixes "multiply defined" errors.
  397. 2022-03-23: wsfulton
  398. [Python] #1779 The -py3 option is deprecated and now has no effect on the
  399. code generated. Use of this option results in a deprecated warning.
  400. The related SWIGPYTHON_PY3 macro that this option defined is no longer generated.
  401. Note that %pythonnondynamic feature generates a metaclass that works on both
  402. Python 2 and Python 3.
  403. 2022-03-21: wsfulton
  404. [Python] #1779 pyabc.i for abstract base classes now supports versions of
  405. Python prior to 3.3 by using the collection module for these older versions.
  406. Python-3.3 and later continue to use the collections.abc module.
  407. The -py3 option no longer has any effect on the %pythonabc feature.
  408. 2022-03-21: jschueller, jim-easterbrook, wsfulton
  409. [Python] #2137 C++ static member functions no longer generate a "flattened"
  410. name in the Python module. For example:
  411. s = example.Spam()
  412. s.foo() # Spam::foo() via an instance
  413. example.Spam.foo() # Spam::foo() using class method
  414. example.Spam_foo() # Spam::foo() "flattened" name
  415. The "flattened" name is no longer generated, but can be generated
  416. by using the new -flatstaticmethod option.
  417. *** POTENTIAL INCOMPATIBILITY ***
  418. 2022-03-18: ianlancetaylor
  419. [Go] #337 Implement %extend base methods in child classes.
  420. 2022-03-17: olly
  421. [Python] #1779 SWIG's Python test-suite and examples are now
  422. run with Python 3 by default. To run them with Python 2, set
  423. PY2 to a non-empty value, e.g.:
  424. make check-python-test-suite PY2=1
  425. 2022-03-16: olly
  426. [Go] #683 -intgosize is now optional - if not specified the
  427. generated C/C++ wrapper code will use ptrdiff_t for intgo and
  428. size_t for uintgo.
  429. 2022-03-15: ianlancetaylor
  430. [Go] Add typemaps for std::string*.
  431. 2022-03-15: ianlancetaylor
  432. [Go] Don't convert arrays to pointers if there is a "gotype"
  433. typemap entry.
  434. 2022-03-15: ianlancetaylor
  435. [Go] Add documentation note about Go and C++ exceptions.
  436. 2022-03-12: wsfulton
  437. #1524 %interface family of macros no longer contain the getter/setter
  438. methods for wrapping variables. The interface only contains
  439. virtual and non-virtual instance methods, that is, no static methods.
  440. Enums are also no longer added to the interface (affects Java only where
  441. they were missing from the proxy class, C# never had them in the interface).
  442. *** POTENTIAL INCOMPATIBILITY ***
  443. 2022-03-12: wsfulton
  444. #1277 Fixes for the family of %interface macros, %interface,
  445. %interface_impl and %interface_custom fixes for overloaded methods
  446. in an inheritance chain.
  447. When C++ methods are not able to be overloaded in a derived class,
  448. such as when they differ by just const, or the target language
  449. parameters types are identical even when the C++ parameter types
  450. are different, SWIG will ignore one of the overloaded methods with
  451. a warning. A %ignore is required to explicitly ignore one of the
  452. overloaded methods to avoid the warning message. Methods added
  453. in the derived classes due to one of the %interface macros are now
  454. similarly ignored/not added to the derived class.
  455. The methods added to the derived classes can now also be modified
  456. via %feature and %rename.
  457. 2022-03-08: ianlancetaylor
  458. [Go] Treat a nil argument as a NULL pointer.
  459. 2022-03-08: ianlancetaylor
  460. [Go] Add documentation notes about thread local storage.
  461. 2022-03-08: olly
  462. #1006 SWIG now copes with an interface filename specified on the
  463. command line which contains a closing parenthesis `)`, and more
  464. generally with attributes to `%include` and `%import` which
  465. are quoted and contain parentheses.
  466. 2022-03-07: Omar Medina
  467. [Tcl] https://sourceforge.net/p/swig/bugs/1290/
  468. Fix SWIG_AsWCharPtrAndSize() to actually assign to result
  469. variable. It looks like SWIG/Tcl wide character handling is
  470. currently fundamentally broken except on systems which use wide
  471. characters as the system encoding, but this should fix wrapping
  472. functions which take a wide string as a parameter on Microsoft
  473. Windows.
  474. 2022-03-07: olly
  475. [Javascript] #682 Fix handling of functions which take void*.
  476. 2022-03-06: olly
  477. SWIG should now reliably exit with status 0 if the run was
  478. successful and status 1 if there was an error (or a warning and
  479. -Werror was in effect).
  480. Previously in some situations SWIG would try to exit with the
  481. status set to the number of errors encountered, but that's
  482. problematic - for example if there were 256 errors this would
  483. result in exit status 0 on most platforms. Also some error
  484. statuses have special meanings e.g. those defined by <sysexits.h>.
  485. Also SWIG/Javascript tried to exit with status -1 in a few places
  486. (which typically results in exit status 255).
  487. 2022-03-05: wsfulton
  488. #1441 Fix using declaration in derived class incorrectly introducing a method
  489. from a base class when the using declaration is declared before the method
  490. declaration. Problem occurred when within a namespace and the parameter types
  491. in the method signatures were not fully qualified.
  492. 2022-03-05: ianlancetaylor
  493. [Go] Treat non-const references as pointers.
  494. 2022-03-05: ianlancetaylor
  495. In SWIG Go testsuite, fail test if "go build" fails.
  496. 2022-03-03: olly
  497. #1901 #2223 SWIG should now always exit cleanly if memory
  498. allocation fails, including removing any output files created
  499. during the current run.
  500. Previously most places in the code didn't check for a NULL return
  501. from malloc()/realloc()/calloc() at all, typically resulting in
  502. undefined behaviour; some places used assert() to check for a NULL
  503. return (which is a misuse of assert() and such checks disappear if
  504. built with NDEBUG defined leaving us back with undefined
  505. behaviour).
  506. 2022-03-03: olly
  507. #891 Report errors for typemap attributes without a value
  508. (previously SWIG segfaulted) and for typemap types with a value
  509. (previously the value was quietly ignored).
  510. The old way of specifying a language name in the typemap attributes
  511. is no longer supported (it has been deprecated for 16 years).
  512. 2022-03-02: geographika, wsfulton
  513. [Python] #1951 Add Python variable annotations support.
  514. Both function annotations and variable annotations are turned on using the
  515. "python:annotations" feature. Example:
  516. %feature("python:annotations", "c");
  517. struct V {
  518. float val;
  519. };
  520. The generated code contains a variable annotation containing the C float type:
  521. class V(object):
  522. val: "float" = property(_example.V_val_get, _example.V_val_set)
  523. ...
  524. Python 3.5 and earlier do not support variable annotations, so variable
  525. annotations can be turned off with a "python:annotations:novar" feature flag.
  526. Example turning on function annotations but not variable annotations globally:
  527. %feature("python:annotations", "c");
  528. %feature("python:annotations:novar");
  529. or via the command line:
  530. -features python:annotations=c,python:annotations:novar
  531. *** POTENTIAL INCOMPATIBILITY ***
  532. 2022-02-27: wsfulton
  533. [Python] #735 #1561 Function annotations containing C/C++ types are no longer
  534. generated when using the -py3 option. Function annotations support has been
  535. moved to a feature to provide finer grained control. It can be turned on
  536. globally by adding:
  537. %feature("python:annotations", "c");
  538. or by using the command line argument:
  539. -features python:annotations=c
  540. Also see entry dated 2022-03-02, regarding variable annotations.
  541. *** POTENTIAL INCOMPATIBILITY ***
  542. 2022-02-26: wsfulton
  543. #655 #1840 Add new warning WARN_LANG_USING_NAME_DIFFERENT to warn when a
  544. method introduced by a using declaration in a derived class cannot
  545. be used due to a conflict in names.
  546. 2022-02-24: olly
  547. #1465 An invalid preprocessor expression is reported as a pair of
  548. warnings with the second giving a more detailed message from the
  549. expression evaluator. Previously SWIG prefixed the second message
  550. with "Error:" - that was confusing as it's actually only a warning
  551. by default so we've now dropped this prefix.
  552. Before:
  553. x.i:1: Warning 202: Could not evaluate expression '1.2'
  554. x.i:1: Warning 202: Error: 'Floating point constant in preprocessor expression'
  555. Now:
  556. x.i:1: Warning 202: Could not evaluate expression '1.2'
  557. x.i:1: Warning 202: Floating point constant in preprocessor expression
  558. 2022-02-23: olly
  559. #1384 Fix a preprocessor expression evaluation bug. A
  560. subexpression in parentheses lost its string/int type flag and
  561. instead used whatever type was left in the stack entry from
  562. previous use. In practice we mostly got away with this because
  563. most preprocessor expressions are integer, but it could have
  564. resulted in a preprocessor expression incorrectly evaluating as
  565. zero. If -Wextra was in use you got a warning:
  566. Warning 202: Error: 'Can't mix strings and integers in expression'
  567. 2022-02-21: davidcl
  568. [Scilab] Improve 5.5.2, 6.0.0 and 6.1.0 support.
  569. For Scilab 5, long names are reduced to small names preserving the
  570. class prefix and accessor suffix (get or set).
  571. For Scilab 6, long names with the class prefix and accessor suffix
  572. should be used on the user code.
  573. The `-targetversion` option has been removed as the generated code
  574. now detects the Scilab version in loader.sce or builder.sce.
  575. *** POTENTIAL INCOMPATIBILITY ***
  576. 2022-02-20: wsfulton
  577. Fix %warnfilter warning suppress for warning 315 SWIGWARN_PARSE_USING_UNDEF.
  578. 2022-02-17: olly
  579. [PHP] https://sourceforge.net/p/swig/bugs/1211/
  580. Fix to call cleanup code in exception situations and not to invoke
  581. the freearg typemap twice in certain situations.
  582. 2022-02-15: olly
  583. #300 #368 Improve parser handling of % followed immediately by
  584. an identifier. If it's not a recognised directive the scanner
  585. now emits MODULO and then rescans what follows, and if the parser
  586. then gives a syntax error we report it as an unknown directive.
  587. This means that `a%b` is now allowed in an expression, and that
  588. things like `%std::vector<std::string>` now give an error rather
  589. than being quietly ignored.
  590. 2022-02-11: adr26
  591. [Python] #2154 Fix memory leak.
  592. SWIG python objects were being freed after the corresponding SWIG
  593. module information was destroyed in Python 3, causing leaks when as
  594. a result the object destructor could not be invoked. To prevent this
  595. misordering, SWIG python objects now obtain a reference to the
  596. Python capsule wrapping the module information, so that the module
  597. information is correctly destroyed after all SWIG python objects
  598. have been freed (and corresponding destructors invoked).
  599. 2022-02-10: olly
  600. [Tcl] https://sourceforge.net/p/swig/bugs/1207/
  601. https://sourceforge.net/p/swig/bugs/1213/
  602. Fix Tcl generic input typemap for std::vector.
  603. 2022-02-07: sethrj
  604. #2196 Add alternative syntax for specifying fragments in typemaps.
  605. New syntax:
  606. %typemap("in", fragment="frag1", fragment="frag2", fragment="frag3") {...}
  607. which is equivalent to:
  608. %typemap(in, fragment="frag1,frag2,frag3") {...}
  609. 2022-02-07: olly
  610. #1806 Remove support for the "command" encoder, which was mostly
  611. intended for use in `%rename` - most uses can be achieved using
  612. the "regex" encoder, so we recommend using that instead.
  613. The "command" encoder suffers from a number of issues - as the
  614. documentation for it admitted, "[it] is extremely slow compared to
  615. all the other [encoders] as it involves spawning a separate process
  616. and using it for many declarations is not recommended" and that it
  617. "should generally be avoided because of performance
  618. considerations".
  619. But it's also not portable. The design assumes that `/bin/sh`
  620. supports `<<<` but that's a bash-specific feature so it doesn't
  621. work on platforms where `/bin/sh` is not bash - it fails on
  622. Debian, Ubuntu and probably some other Linux distros, plus most
  623. non-Linux platforms. Microsoft Windows doesn't even have a
  624. /bin/sh as standard.
  625. Finally, no escaping of the passed string is done, so it has
  626. potential security issues (though at least with %rename the input
  627. is limited to valid C/C++ symbol names).
  628. 2022-02-06: olly
  629. #2193 -DFOO on the SWIG command line now sets FOO to 1 for
  630. consistency with C/C++ compiler preprocessors. Previously
  631. SWIG set FOO to an empty value.
  632. Existing invocations of SWIG with `-DFOO` where the empty value
  633. matters can be updated to `-DFOO=` which should work with both
  634. old and new releases of SWIG.
  635. *** POTENTIAL INCOMPATIBILITY ***
  636. 2022-02-06: sethrj
  637. #2194 Classes that are non-assignable due to const data or const
  638. reference members are now automatically detected.
  639. 2022-02-04: friedrichatgc
  640. [Octave] #1672 Fix for isobject for Octave 4.4 - 6.0.
  641. 2022-02-03: olly
  642. [C#] #283 #998 Fix memory leak in directorin typemap for
  643. std::string.
  644. 2022-02-03: olly
  645. [Python] #967 Make `self` parameter available to user typemaps.
  646. 2022-02-03: teythoon
  647. [Python] #801 Fix -Wunused-parameter warnings with builtin,
  648. 2022-02-03: teythoon
  649. #801 Fix -Wstrict-prototypes warnings in generated pointer
  650. functions.
  651. 2022-02-03: olly
  652. #660 https://sourceforge.net/p/swig/bugs/1081/
  653. Default parameter values containing method calls are now parsed and
  654. handled - e.g. `x->foo(3,4)` and `y.z()`.
  655. 2022-02-02: olly
  656. [Ruby] https://sourceforge.net/p/swig/bugs/1136/ Fix remove of prefix
  657. from method name to only remove it at the start.
  658. 2022-02-01: olly
  659. #231 Handle returning an object by reference in a C++ trailing
  660. return type.
  661. 2022-02-01: davidcl
  662. [Scilab] #745 use SWIG_<module>_Init() as a C module init function.
  663. 2022-02-01: olly
  664. [OCaml] #2083 Fix to work when CAML_SAFE_STRING is on, which it is
  665. by default in recent Ocaml releases.
  666. 2022-01-31: mreeez
  667. https://sourceforge.net/p/swig/bugs/1147/
  668. Fix copyToR() generated for a struct in a namespace.
  669. 2022-01-29: fschlimb
  670. #655 Better handling of using declarations.
  671. 2022-01-29: dontpanic92
  672. [Go] #676 Fix code generated for a C++ class with a non-capitalised
  673. name.
  674. 2022-01-26: trex58
  675. #1919 #1921 #1923 Various fixes for AIX portability.
  676. 2022-01-26: olly
  677. #1935 Don't crash on an unclosed HTML tag in a doxygen comment
  678. when -doxygen is specified.
  679. 2022-01-25: olly
  680. Constant expressions now support member access with `.` such as
  681. `foo.bar`. Previous this only worked in a case like `x->foo.bar`.
  682. 2022-01-25: olly
  683. #2091 Support most cases of `sizeof` applied to an expression
  684. in constant expressions. Previously there was only support for
  685. `sizeof(<type>)` and expressions which syntactically look like a
  686. type (such as `sizeof(foo)`).
  687. 2022-01-25: olly
  688. #80 #635 https://sourceforge.net/p/swig/bugs/1139/
  689. Add support for parsing common cases of `<` and `>` comparisons
  690. in constant expressions. Adding full support for these seems hard
  691. to do without introducing conflicts into the parser grammar, but in
  692. fact all reported cases have had parentheses around the comparison
  693. and we can support that with a few restrictions on the left side of
  694. `<`.
  695. 2022-01-25: wsfulton
  696. New warning 327 for extern templates, eg:
  697. extern template class std::vector<int>;
  698. extern template void Func<int>();
  699. results in warning
  700. example.i:3: Warning 327: Extern template ignored.
  701. example.i:4: Warning 327: Extern template ignored.
  702. Extern template classes previously resulted in warning 320.
  703. 2022-01-24: romintomasetti
  704. #2131 #2157 C++11 extern function template parsing error fix.
  705. 2022-01-21: wsfulton
  706. #2120 #2138 Replace legacy PCRE dependency with PCRE2.
  707. This requires changes for building SWIG from source. See updated
  708. html documentation in Preface.html and Windows.html. Updated
  709. instructions are also shown when running ./configure if PCRE2 is not
  710. found. Note that debian based systems can install PCRE2 using:
  711. apt install libpcre2-dev
  712. Note that https://github.com/swig/swig/wiki/Getting-Started also has
  713. updated information for building from source.
  714. 2022-01-19: olly
  715. [PHP] #2027 Automatically generate PHP type declarations for PHP 8.
  716. The generate code still compiles for PHP 7.x, but without type
  717. declarations since PHP 7.x has much more limited type declaration
  718. support.
  719. 2022-01-18: olly
  720. [Perl] #1629 Perl 5.8.0 is now the oldest version we aim to support.
  721. 2022-01-14: wsfulton
  722. [Python] Fix %callback and specifying the callback function as a
  723. static member function using Python staticmethod syntax, such as
  724. Klass.memberfunction instead of Klass_memberfunction when using
  725. -builtin and -fastproxy.
  726. 2022-01-11: wsfulton
  727. [Python] Accept keyword arguments accessing static member functions when
  728. using -builtin and kwargs feature and Python class staticmethod syntax.
  729. The missing keyword argument support was only when using the
  730. class staticmethod syntax, such as Klass.memberfunction, and not when
  731. using the flat static method syntax, such as Klass_memberfunction.
  732. 2022-01-04: juierror
  733. [Go] #2045 Add support for std::array in std_array.i.
  734. 2021-12-18: olly
  735. [PHP] Add PHP keyword 'readonly' (added in 8.1) to the list SWIG
  736. knows to automatically rename. This keyword is special in that PHP
  737. allows it to be used as a function (or method) name.
  738. 2021-12-07: vstinner
  739. [Python] #2116 Python 3.11 support: use Py_SET_TYPE()
  740. 2021-12-05: rwf1
  741. [Octave] #2020 #1893 Add support for Octave 6 up to and including 6.4.
  742. Also add support for compiling with -Bsymbolic which is used by default
  743. by mkoctfile.
  744. 2021-12-02: jsenn
  745. [Python] #2102 Fixed crashes when using embedded Python interpreters.
  746. 2021-11-12: wsfulton
  747. [Javascript] v8 and node only. Fix mismatched new char[] and free()
  748. when wrapping C code char arrays. Now calloc is now used instead of
  749. new char[] in SWIG_AsCharPtrAndSize.
  750. 2021-10-03: ajrh1
  751. [Perl] #2074: Avoid -Wmisleading-indentation in generated code
  752. when using gcc11.
  753. 2021-10-03: jschueller
  754. [CMake] #2065: Add option to enable or disable PCRE support.
  755. 2021-09-16: ianlancetaylor
  756. [Go] Improved _cgo_panic implementation.
  757. 2021-09-16: ianlancetaylor
  758. [Go] Don't use crosscall2 for panicking. Instead rely on documented
  759. and exported interfaces.
  760. 2021-09-14: ianlancetaylor
  761. [Go] Remove -no-cgo option (long unsupported in Go)
  762. 2021-05-04: olly
  763. [PHP] #2014 Throw PHP exceptions instead of using PHP errors
  764. PHP exceptions can be caught and handled if desired, but if they
  765. aren't caught then PHP exits in much the same way as it does for a
  766. PHP error.
  767. In particular this means parameter type errors and some other cases
  768. in SWIG-generated wrappers now throw a PHP exception, which matches
  769. how PHP's native parameter handling deals with similar situations.
  770. `SWIG_ErrorCode()`, `SWIG_ErrorMsg()`, `SWIG_FAIL()` and `goto thrown;`
  771. are no longer supported (these are really all internal implementation
  772. details and none are documented aside from brief mentions in CHANGES
  773. for the first three). I wasn't able to find any uses in user interface
  774. files at least in FOSS code via code search tools.
  775. If you are using these:
  776. Use `SWIG_PHP_Error(code,msg);` instead of `SWIG_ErrorCode(code);
  777. SWIG_ErrorMsg(msg);` (which will throw a PHP exception in SWIG >= 4.1
  778. and do the same as the individual calls in older SWIG).
  779. `SWIG_FAIL();` and `goto thrown;` can typically be replaced with
  780. `SWIG_fail;`. This will probably also work with older SWIG, but
  781. please test with your wrappers if this is important to you.
  782. *** POTENTIAL INCOMPATIBILITY ***
  783. 2021-05-17: adr26
  784. [Python] #1985 Fix memory leaks:
  785. 1. Python object references were being incorrectly retained by
  786. SwigPyClientData, causing swig_varlink_dealloc() never to run / free
  787. memory. SwigPyClientData_New() / SwigPyClientData_Del() were updated
  788. to fix the object reference counting, causing swig_varlink_dealloc()
  789. to run and the memory swig_varlink owns to be freed.
  790. 2. SwigPyClientData itself was not freed by SwigPyClientData_Del(),
  791. causing another heap leak. The required free() was added to
  792. SwigPyClientData_Del()
  793. 3. Fix reference counting/leak of python cached type query
  794. 4. Fix reference counting/leak of SwigPyObject dict (-builtin)
  795. 5. Python object reference counting fixes for out-of-memory
  796. scenarios were added to: SWIG_Python_RaiseOrModifyTypeError(),
  797. SWIG_Python_AppendOutput(), SwigPyClientData_New(),
  798. SwigPyObject_get___dict__() and SwigPyObject_format()
  799. 6. Add error handling for PyModule_AddObject() to
  800. SWIG_Python_SetModule() (failure could be caused by OOM or a name
  801. clash caused by malicious code)
  802. 2021-05-13: olly
  803. [UFFI] #2009 Remove code for Common Lisp UFFI. We dropped support
  804. for it in SWIG 4.0.0 and nobody has stepped forward to revive it in
  805. over 2 years.
  806. 2021-05-13: olly
  807. [S-EXP] #2009 Remove code for Common Lisp S-Exp. We dropped
  808. support for it in SWIG 4.0.0 and nobody has stepped forward to
  809. revive it in over 2 years.
  810. 2021-05-13: olly
  811. [Pike] #2009 Remove code for Pike. We dropped support for it in
  812. SWIG 4.0.0 and nobody has stepped forward to revive it in over 2
  813. years.
  814. 2021-05-13: olly
  815. [Modula3] #2009 Remove code for Modula3. We dropped support for it
  816. in SWIG 4.0.0 and nobody has stepped forward to revive it in over 2
  817. years.
  818. 2021-05-13: olly
  819. [CLISP] #2009 Remove code for GNU Common Lisp. We dropped support
  820. for it in SWIG 4.0.0 and nobody has stepped forward to revive it in
  821. over 2 years.
  822. 2021-05-13: olly
  823. [Chicken] #2009 Remove code for Chicken. We dropped support for it
  824. in SWIG 4.0.0 and nobody has stepped forward to revive it in over 2
  825. years.
  826. 2021-05-13: olly
  827. [Allegrocl] #2009 Remove code for Allegro Common Lisp. We dropped
  828. support for it in SWIG 4.0.0 and nobody has stepped forward to
  829. revive it in over 2 years.
  830. 2021-05-04: olly
  831. [PHP] #1982 #1457 https://sourceforge.net/p/swig/bugs/1339/
  832. SWIG now only use PHP's C API to implement its wrappers, and no
  833. longer generates PHP code to define classes. The wrappers should
  834. be almost entirely compatible with those generated before, but
  835. faster and without some previously hard-to-fix bugs.
  836. The main notable difference is SWIG no longer generates a .php
  837. wrapper at all by default (only if %pragma(php) code=... or
  838. %pragma(php) include=... are specified in the interface file).
  839. This also means you need to load the module via extension=...
  840. in php.ini, rather than letting the dl() in the generated
  841. .php wrapper load it (but dl() has only worked for command-line
  842. PHP for some years now).
  843. *** POTENTIAL INCOMPATIBILITY ***
  844. 2021-04-30: olly
  845. #1984 Remove support for $source and $target.
  846. These were officially deprecated in 2001, and attempts to use them have
  847. resulted in a warning (including a pointer to what to update them to)
  848. for most if not all of that time.
  849. 2021-04-27: wsfulton
  850. #1987 [Java] Fix %interface family of macros for returning by const
  851. pointer reference.
  852. 2021-04-19: olly
  853. Fix use of uninitialised variable in the generated code for an
  854. empty typecheck typemap, such as the dummy one we include for
  855. std::initializer_list.
  856. 2021-04-12: olly
  857. #1777 [Python] Specifying -py3 now generates a check for Python
  858. version >= 3.0.
  859. 2021-03-26: olly
  860. [PHP] Add PHP keywords 'fn' (added in 7.4) and 'match' (added in
  861. 8.0) to the list SWIG knows to automatically rename.
  862. 2021-03-23: wsfulton
  863. #1942 [Python] Fix compilation error in wrappers when using -builtin
  864. and wrapping varargs in constructors.
  865. 2021-03-22: goto40
  866. #1977 Fix handling of template template parameters.
  867. 2021-03-21: olly
  868. #1929, #1978 [PHP] Add support for PHP 8.
  869. 2021-03-19: wsfulton
  870. #1610 Remove -ansi from default compilation flags.
  871. 2021-03-19: dot-asm
  872. #1934 [Java] Clean up typemaps for long long arrays.
  873. 2021-03-19: olly
  874. #1527 [PHP] Improve PHP object creation in directorin case.
  875. Reportedly the code we were using in this case gave segfaults in
  876. PHP 7.2 and later - we've been unable to reproduce these, but the
  877. new approach is also simpler and should be bit faster too.
  878. 2021-03-18: olly
  879. #1655 [PHP] Fix char* typecheck typemap to accept PHP Null like the
  880. corresponding in typemap does.
  881. 2021-03-18: olly
  882. #1900, #1905 [PHP] Fix wrapping of overloaded directed methods with
  883. non-void return.
  884. 2021-03-11: murillo128
  885. #1498 [Javascript] Support type conversion.
  886. 2021-03-06: nshmyrev
  887. #872 [Javascript] Various typemap issues in arrays_javascript.i fixed.
  888. 2021-03-03: vaughamhong
  889. #577 [Javascript] Implemented SetModule/GetModule for JSC to allow type sharing
  890. across modules.
  891. 2021-03-01: xantares, Oliver Buchtala, geographika
  892. #1040 Add support for building SWIG with CMake. See documentation in Windows.html.
  893. 2021-03-01: vadz
  894. #1952 Fix incorrect warning "Unknown Doxygen command: ."
  895. 2021-02-28: p2k
  896. #969 [Javascript] v8/node - prevent crash calling a constructor without new keyword.
  897. 2021-02-28: alecmev
  898. #405 #1121 [Javascript] Fix OUTPUT typemaps on methods that don't return void.
  899. The output value is appended to the return value.
  900. 2021-02-26: murillo128, wsfulton
  901. #1269 [Javascript] Fix handling of large positive unsigned long and
  902. unsigned long long values.
  903. 2021-02-24: tomleavy, yegorich, tungntpham
  904. #1746 [Javascript] Add support for Node v12, v14 and v16.
  905. SWIG support for Node is now for v6 and later only.
  906. 2020-02-09: ZackerySpytz
  907. #1872 Fix typos in attribute2ref macros.
  908. 2020-10-10: wsfulton
  909. [Javascript] Fix so that ccomplex.i interface to file can be used.
  910. 2020-10-10: wsfulton
  911. #252 complex can now be used as a C identifier and doesn't give a syntax error.
  912. 2020-10-10: lpsinger
  913. #1770 Correct C complex support.
  914. _Complex is now parsed as a keyword rather than complex as per the C99 standard.
  915. The complex macro is available in the ccomplex.i library file along with other
  916. complex number handling provided by the complex.h header.
  917. 2020-10-07: ZackerySpytz
  918. [Python] #1812 Fix the error handling for the PyObject_GetBuffer() calls in
  919. pybuffer.i.
  920. 2020-10-07: treitmayr
  921. #1824 Add missing space in director method declaration returning
  922. const pointer.
  923. 2020-10-07: adelva1984
  924. #1859 Remove all (two) exceptions from SWIG executable.
  925. 2020-09-25: wsfulton
  926. [C#, Java] #1874 Add ability to change the modifiers for the interface
  927. generated when using the %interface macros.
  928. For C# use the 'csinterfacemodifiers' typemap.
  929. For Java use the 'javainterfacemodifiers' typemap.
  930. For example:
  931. %typemap(csinterfacemodifiers) X "internal interface"
  932. 2020-09-24: geefr
  933. [C#] #1868 Fix wchar_t* csvarout typemap for member variable wrappers.
  934. 2020-08-28: wsfulton
  935. [Java] #1862 Fix crashes in swig_connect_director during director class construction
  936. when using the director class from multiple threads - a race condition initialising
  937. block scope static variables. The fix is guaranteed when using C++11, but most
  938. compilers also fix it when using C++03/C++98.
  939. 2020-08-16: wsfulton
  940. [Python] Add missing initializer for member '_heaptypeobject::ht_module' when using
  941. -builtin to complete Python 3.9 support.
  942. 2020-08-16: wsfulton
  943. [Python] Remove PyEval_InitThreads() call for Python 3.7 and later as Python calls
  944. it automatically now. This removes a deprecation warning when using Python 3.9.
  945. 2020-08-15: wsfulton
  946. [Python] All Python examples and tests are written to be Python 2 and Python 3
  947. compatible, removing the need for 2to3 to run the examples or test-suite.
  948. 2020-08-13: wsfulton
  949. [C#] Add support for void *VOID_INT_PTR for member variables.
  950. 2020-07-29: chrisburr
  951. #1843 [Python] Compilation error fix in SwigPyBuiltin_SetMetaType when using PyPy.
  952. 2020-06-14: ZackerySpytz
  953. #1642 #1809 Fix virtual comparison operators in director classes by removing an
  954. incorrect space in the function name (for example, operator= = is now operator==).
  955. Version 4.0.2 (8 Jun 2020)
  956. ==========================
  957. 2020-06-07 vigsterkr
  958. [Ruby] #1717 Nil fix mangling strings
  959. 2020-06-07 vadz
  960. #1748 Fix doxygen comments quoting issue
  961. 2020-06-07 munoah
  962. #1800 Escape spaces in file paths for dependencies (-M -MM etc)
  963. 2020-06-06 andreas-schwab
  964. [Ruby] #1801 Fix encoding on big endian systems when wrapping std::wstring.
  965. 2020-05-31 kwwette
  966. [Octave] #1789 error handling improvements and return error code on exit for SWIG wrapped modules.
  967. 2020-05-30 msteinbeck
  968. [D] #1593 Replace broken imports when using newer versions of D.
  969. 2020-05-29: ZackerySpytz
  970. [Python] #1716 Performance improvements when converting strings when using Python >= 3.3.
  971. 2020-05-28: ZackerySpytz
  972. #1776 Quite dramatically decrease run times when generating very large interface files by changing
  973. some internal memory pool sizes.
  974. 2020-05-28: mcfarljm
  975. #1788 Fix handling of Doxygen \endlink command.
  976. 2020-05-24: vapier
  977. [Javascript] #1796 Fix pkg-config invocation in configure.
  978. 2020-04-30: kwwette
  979. [Octave] Fix exception raising for newer Octave versions
  980. Since (at least) Octave 5.1.0, the Octave error() function now raises a C++ exception,
  981. which if uncaught immediately exits a SWIG wrapper function, bypassing any cleanup code
  982. that may appear after a "fail:" label. This patch adds a "try { ... } catch(...) { }"
  983. block around the contents of SWIG wrapper functions to first execute the cleanup code
  984. before rethrowing any exception raised. It is backward compatible with earlier versions
  985. of Octave where error() does not raise an exception, which will still branch to the
  986. "fail:" block to execute cleanup code if an error is encountered.
  987. Note that the new "try { ... } catch(...) { }" block will localise any local variables
  988. used in typemaps that were NOT declared through SWIG's %typemap(...) syntax, so it's
  989. possible this could break existing SWIG wrappers which were implicitly sharing local
  990. variables between typemaps. This can be fixed, however, by declaring local variables
  991. which need to be shared between typemaps through SWIG's %typemap(...) syntax.
  992. 2020-02-18: ryannevell
  993. [Lua] #1728 Add support for LUA lightuserdata to SWIG_Lua_ConvertPtr.
  994. 2020-02-18: dmach
  995. [Ruby] #1725 Fix gcc -Wcatch-value warnings.
  996. 2020-02-14: treitmayr
  997. #1724 Fix wrapping of abstract user-defined conversion operators.
  998. 2020-02-13: ddurham2
  999. [Python] #1512 Fix memleak when using STL containers of shared_ptr objects.
  1000. 2020-02-06: wsfulton
  1001. [Python] #1673 #1674 Fix setting 'this' when extending a proxy class with __slots__.
  1002. 2020-01-31: vadz
  1003. [Ruby] #1651 Add std::auto_ptr<> typemaps.
  1004. 2020-01-31: ZackerySpytz
  1005. [Python] #1700 The Python C API functions PyBytes_AsStringAndSize() and
  1006. PyString_AsStringAndSize() are now checked for failure.
  1007. 2020-01-31: vadz
  1008. [Python] #1710 Fix crash parsing empty docstrings.
  1009. 2020-01-30: Alzathar
  1010. [R] #910 #914 Fix R memory leak on exception.
  1011. 2020-01-30: richardbeare
  1012. [R] #1511 Fix bug wrapping functions. These were previously incorrectly wrapped as if
  1013. they were variables. This happened when 'get' or 'set' was in the name of the function
  1014. or method, but sometimes also in some other circumstances. If you were using R
  1015. attribute syntax to access these methods, you'll need to switch to calling them as R
  1016. methods.
  1017. *** POTENTIAL INCOMPATIBILITY ***
  1018. 2020-01-24: etse-dignitas, wsfulton
  1019. [C#, D, Java] #1533 Fix upcasting for shared_ptr's of templated types.
  1020. 2020-01-16: mcfarljm
  1021. #1643 #1654 When using -doxygen, fix segfault when nameless parameters or vararg parameters
  1022. are used.
  1023. 2020-01-16: mcfarljm
  1024. #1632 #1659 Fix newline handling for doxygen "///" comments.
  1025. 2020-01-14: mcfarljm
  1026. #1647 #1656 Fix crash handling empty doxygen comments.
  1027. 2020-01-14: mcfarljm
  1028. #1608 Improve doxygen support.
  1029. - Add support for \param[] commands such as: \param[in].
  1030. - Optional arguments are marked as 'optional' in pydoc.
  1031. - Improve support for \code commands so that other languages are supported as code blocks.
  1032. Support added for java, c and py. For example Python: \code{.py} ... \endcode
  1033. - Fix doxygen handling of \em and \p tags for Python.
  1034. 2020-01-13: wsfulton
  1035. [Python] #1595 Python -builtin constructors silently ignored keyword arguments.
  1036. Instead of silently ignoring them, now a "TypeError: f() takes no keyword arguments"
  1037. exception is thrown if keyword arguments are used. Hence constructors and normal methods/
  1038. functions behave in the same way. Note, -keyword should be used with -builtin to obtain
  1039. keyword argument support.
  1040. 2020-01-05: jschueller shadchin
  1041. [Python] #1670 #1696 Add missing field initializers introduced in python 3.8:
  1042. tp_vectorcall and tp_print.
  1043. 2020-01-05: friedrichatgc
  1044. [Octave] #1688 Change swig_this() to use size_t instead of long for compatibility
  1045. with Windows 64 bit.
  1046. 2020-01-05: treitmayr
  1047. [Ruby] #1692 #1689 Add support for Ruby 2.7
  1048. 2019-12-30: treitmayr
  1049. [Ruby] #1653 #1668 Fix code generated when using -globalmodule option.
  1050. 2019-12-29: ZackerySpytz
  1051. [OCaml] #1686 Fix compilation errors with OCaml 4.09.0.
  1052. 2019-12-10: wsfulton
  1053. #1679 Fix parsing of C++11 identifiers with special meaning (final and override) when
  1054. they are used as part of the scope name of an identifier, such as a namespace name.
  1055. 2019-11-26: wsfulton
  1056. [C#] #1628 'out' or 'ref' used in a cstype typemap was not always stripped out in parts
  1057. of director code generation.
  1058. 2019-11-01: wsfulton
  1059. [Python] #1595 Fix bug in support for keyword arguments (kwargs feature or -keyword)
  1060. when using -builtin. The fix is in the argument error checking when wrapping zero
  1061. argument constructors only.
  1062. Version 4.0.1 (21 Aug 2019)
  1063. ===========================
  1064. 2019-08-20: TekuConcept
  1065. [Javascript] #1535 Add %native support to Javascript.
  1066. 2019-08-20: bkotzz
  1067. [Java] #1616 Add SWIG_JavaIllegalStateException to support throwing
  1068. java.lang.IllegalStateException from JNI code.
  1069. 2019-08-19: sjml
  1070. [Lua] #1596 tostring output changes to show the underlying C/C++ pointer.
  1071. 2019-08-08: rokups
  1072. [C#, Java] #1601 Fix invalid code generated for "%constant enum EnumType.
  1073. 2019-08-07: wsfulton
  1074. [Python] Fix method overloading of methods that take STL containers of different
  1075. types. The following usage (using std::vector) would fail when using -builtin:
  1076. %include <std_string.i>
  1077. %include <std_vector.i>
  1078. %inline %{
  1079. struct X {};
  1080. %}
  1081. %template(VectorX) std::vector<X>;
  1082. %template(VectorInt) std::vector<int>;
  1083. %inline %{
  1084. using namespace std;
  1085. string VectorOverload(vector<X> v);
  1086. string VectorOverload(vector<int> v);
  1087. %}
  1088. The following would incorrectly fail:
  1089. s = VectorOverload([1, 2, 3])
  1090. With:
  1091. Traceback (most recent call last):
  1092. File "runme3.py", line 20, in <module>
  1093. ret = VectorOverload([1, 2, 3])
  1094. TypeError: Wrong number or type of arguments for overloaded function 'VectorOverload'.
  1095. Possible C/C++ prototypes are:
  1096. VectorOverload(std::vector< Number,std::allocator< Number > >)
  1097. VectorOverload(std::vector< int,std::allocator< int > >)
  1098. The problem was due to some error handling that was not cleared during typechecking.
  1099. In this case an error was not cleared when the elements in the list failed the
  1100. typecheck for converting to X. Only occurs in Python 3+.
  1101. In some combinations of overloaded methods, the following type of error message would
  1102. occur:
  1103. RuntimeError: in sequence element 0
  1104. The above exception was the direct cause of the following exception:
  1105. Traceback (most recent call last):
  1106. File "runme3.py", line 23, in <module>
  1107. check(VectorOverload(v), "vector<X>")
  1108. SystemError: <built-in function VectorOverload> returned a result with an error set
  1109. 2019-08-01: wsfulton
  1110. #1602 Fix regression in 4.0.0 where a template function containing a parameter
  1111. with the same name as the function name led to the parameter name used in the
  1112. target language being incorrectly modified.
  1113. 2019-07-29: wsfulton
  1114. Remove all generated files on error. Previously generated files were not removed,
  1115. potentially breaking Makefiles using file dependencies, especially when -Werror
  1116. (warnings as errors) was used.
  1117. 2019-07-23: smithx
  1118. [C#] #1530 #1532 Fix marshalling of std::wstring to C#.
  1119. 2019-07-18: gicmo
  1120. [Python] #1587 Python 3.8 support - remove use of deprecated PyObject_GC_UnTrack.
  1121. 2019-07-18: cher-nov
  1122. [Python] #1573 Generated Python code uses consistent string quoting style - double
  1123. quotes.
  1124. 2019-07-16: geefr
  1125. [C#] #616 #1576 Fix C# bool INPUT[], bool OUTPUT[], bool INOUT[] typemaps to marshall
  1126. as 1-byte.
  1127. 2019-07-12: vadz
  1128. [C#, Java] #1568 #1583 Fix std::set<> typemaps for primitive types.
  1129. 2019-07-12: vadz
  1130. #1566 #1584 Regression in 4.0.0 - fix missing value for first item of enums with
  1131. trailing comma.
  1132. 2019-07-11: mcfarljm
  1133. #1548 #1578 Fix segfault in Doxygen parser parsing empty lines in some commands like
  1134. \code.
  1135. 2019-07-09: IsaacPascual
  1136. [C#, Java] #1570 Fix name of generated C#/Java classes for %interface macros
  1137. in swiginterface.i when wrapping nested C++ classes.
  1138. 2019-07-05: wsfulton
  1139. [Python] #1547 Whitespace fixes in Doxygen translated comments into pydoc comments
  1140. for Sphinx compatibility.
  1141. 2019-06-28: wsfulton
  1142. [MzScheme, OCaml] #1559 $arg and $input were incorrectly substituted in the
  1143. argout typemap when two or more arguments were present.
  1144. 2019-06-24: wsfulton
  1145. [Python, Ruby] #1538 Remove the UnknownExceptionHandler class in order to be
  1146. C++17 compliant as it uses std::unexpected_handler which was removed in C++17.
  1147. This class was intended for director exception handling but was never used by
  1148. SWIG and was never documented.
  1149. *** POTENTIAL INCOMPATIBILITY ***
  1150. 2019-06-06: bkotzz
  1151. [Java] #1552 Improve performance in Java std::vector constructor wrapper that takes
  1152. a native Java array as input.
  1153. 2019-06-03: olly
  1154. [Python] Fix regression in implicit_conv handling of tuples,
  1155. introduced in SWIG 4.0.0. Fixes #1553, reported by Alexandre
  1156. Duret-Lutz.
  1157. 2019-05-24: wsfulton
  1158. [Octave] Fix detection of Octave on MacOS.
  1159. 2019-05-24: opoplawski
  1160. [Octave] #1522 Adapt OCTAVE_LDFLAGS for Octave 5.1.
  1161. 2019-05-22: ferdynator
  1162. [PHP] #1528 Don't add a closing '?>' PHP tag to generated files.
  1163. PSR-2 says it MUST be omitted for files containing only PHP.
  1164. Version 4.0.0 (27 Apr 2019)
  1165. ===========================
  1166. 2019-04-24: vadz
  1167. #1517 Fix crash if "@return" Doxygen tag was used on a node without any return type.
  1168. 2019-04-24: vadz
  1169. #1515 Fix parsing of enums with trailing comma when using -doxygen.
  1170. 2019-04-19: ianlancetaylor
  1171. [Go] #1055 When generating Go code, make -cgo the default. Add new -no-cgo option
  1172. to disable the default.
  1173. 2019-04-19: pbecherer
  1174. [Tcl] #1508 Fix Visual Studio 2015 and later compilation errors due to snprintf macro
  1175. definition.
  1176. 2019-04-09: wsfulton
  1177. [C#] Fix FxCop warning CA2002 in SWIGPendingException - a lock on a reference of
  1178. type 'Type'.
  1179. 2019-03-30: wsfulton
  1180. [Java, D] Add the parameters typemap attribute to the javadestruct,
  1181. javadestruct_derived, ddispose, ddispose_derived typemaps to mirror enhanced
  1182. flexibility in the csdisposing and csdisposing_derived (C#) typemaps. If provided
  1183. the contents are generated as the delete/dispose method's parameters declaration.
  1184. 2019-03-30: wsfulton
  1185. [C#] #421 Fix FxCop warning CA1063 by implementing the recommended Dispose methods for
  1186. the IDisposable interface. Previously just the Dispose() method was generated.
  1187. Now the Dispose() and Dispose(bool disposing) methods are generated.
  1188. Changes are required if custom "csfinalize", "csdestruct" or "csdestruct_derived"
  1189. typemaps are being used. Details in #421 on Github. SWIG will error out if one of
  1190. the "csfinalize, "csdestruct" or "csdestruct_derived" typemaps are found. Example
  1191. error message:
  1192. foo.h:60: Error: A deprecated csfinalize typemap was found for Foo, please remove
  1193. it and replace all csdestruct, csdestruct_derived and csfinalize typemaps by the
  1194. csdispose, csdispose_derived, csdisposing and csdisposing_derived typemaps.
  1195. *** POTENTIAL INCOMPATIBILITY ***
  1196. 2019-03-25: Liryna
  1197. [C#] #1143 Add std_list.i for std::list support.
  1198. The C# std::list<T> wrappers are made to look and feel like a C#
  1199. System.Collections.Generic.LinkedList<> collection.
  1200. The IEnumerable<> interface is implemented in the proxy class.
  1201. The ICollection<> interface can also be implemented to provide enhanced functionality
  1202. whenever a C++ operator== is available. This is the case for when T is a
  1203. primitive type or a pointer. If T does define an operator==, then use the
  1204. SWIG_STD_LIST_ENHANCED macro to obtain this enhanced functionality, for example:
  1205. SWIG_STD_LIST_ENHANCED(SomeNamespace::Klass)
  1206. %template(ListKlass) std::list<SomeNamespace::Klass>;
  1207. 2019-03-18: richardbeare
  1208. [R] #1328 Non-trivial enums are working now. The enum values are now obtained from
  1209. the C/C++ layer. const reference enums and C++11 enum classes are also now working.
  1210. 2019-03-14: mochizk
  1211. [Javascript] #1500 Fix compilation errors due to deprecating V8 API in Node.js.
  1212. New V8 API is used if node.js >= v10.12, or if V8 >= v7.0.
  1213. 2019-03-12: vadz
  1214. [C#] #1495 Add std_set.i for std::set support.
  1215. 2019-03-11: dirteat,opoplawski
  1216. [Octave] Fix compilation errors in Octave 5.1.
  1217. error: format not a string literal and no format arguments [-Werror=format-security]
  1218. 2019-02-28: wsfulton
  1219. [Java] std::vector improvements for types that do not have a default constructor.
  1220. The std::vector wrappers have been changed to work by default for elements that are
  1221. not default insertable, i.e. have no default constructor. This has been achieved by
  1222. not wrapping:
  1223. vector(size_type n);
  1224. Previously the above had to be ignored via %ignore.
  1225. If the above constructor is still required it can be added back in again via %extend:
  1226. %extend std::vector {
  1227. vector(size_type count) { return new std::vector< T >(count); }
  1228. }
  1229. Alternatively, the following wrapped constructor could be used as it provides near-enough
  1230. equivalent functionality:
  1231. vector(jint count, const value_type& value);
  1232. *** POTENTIAL INCOMPATIBILITY ***
  1233. 2019-02-25: wsfulton
  1234. [Python] Fix compile errors wrapping overloaded functions/constructors where a vararg
  1235. function is declared after a non-vararg function.
  1236. 2019-02-23: zphensley42
  1237. Use fully qualified name 'java.lang.Object' instead of 'Object' in generated code to
  1238. avoid clashes with wrapped C++ classes called 'Object'.
  1239. 2019-02-23: gtbX
  1240. [Java] #1035 Add (const char *STRING, size_t LENGTH) typemaps in addition to the non-const
  1241. typemaps (char *STRING, size_t LENGTH) which does not attempt to write back to the const
  1242. string.
  1243. 2019-02-22: tamuratak
  1244. [Ruby] #984 Add support for RTypedData introduced in Ruby 1.9.3.
  1245. 2019-02-22: ZackerySpytz
  1246. #1483 Fix compilation failures when a director class has final methods.
  1247. 2019-02-21: wsfulton
  1248. [Java] #1240 Suppress Java 9 deprecation warnings on finalize method.
  1249. 2019-02-21: ZackerySpytz
  1250. #1480 Fix some rejections of valid floating-point literals.
  1251. 2019-02-19: wsfulton
  1252. #1475 Fix regression parsing gcc preprocessor linemarkers in the form:
  1253. # linenum filename flags
  1254. 2019-02-18: jakecobb
  1255. [Python] #945 #1234 Elements in std::vector memory access fix.
  1256. Accessing an element in a std::vector obtains a reference to the element via an
  1257. iterator pointing to the element in the container. If the vector is garbage collected,
  1258. the SWIG wrapper containing the pointer to the element becomes invalid. The fix is
  1259. to obtain a back-reference to the container by the wrapper to the element in the Python
  1260. layer to prevent the garbage collector from destroying the underlying container.
  1261. 2019-02-17: wsfulton
  1262. Fix typemap matching to expand template parameters when the name contains
  1263. template parameters. In the %typemap below the type is T and the name is X<T>::make
  1264. and the name now expands correctly to X< int >::make
  1265. template<typename T> struct X {
  1266. %typemap(out) T X<T>::make "..."
  1267. T make();
  1268. };
  1269. %template(Xint) X<int>;
  1270. 2019-02-16: wsfulton
  1271. Fix parser error containing multiple #define statements inside an enum.
  1272. The second #define fails to parse:
  1273. enum FooEnum {
  1274. ENUM1 = 0,
  1275. ENUM2 = 1,
  1276. #define MACRO_DEF1 "Hello"
  1277. #define MACRO_DEF2 "World!"
  1278. ENUM3 = 2,
  1279. ENUM4 = 3,
  1280. };
  1281. Bug mentioned at https://sourceforge.net/p/swig/patches/333/
  1282. 2019-02-14: wsfulton
  1283. Add some missing copy constructors into STL containers.
  1284. 2019-02-14: bkotzz
  1285. [Java] #1356 Add STL containers:
  1286. std::unordered_map
  1287. std::unordered_set
  1288. std::set
  1289. 2019-02-14: bkotzz
  1290. [Java] #1356 std::map wrappers have been modified. Now the Java proxy class
  1291. extends java.util.AbstractMap. The std::map container looks and feels much like
  1292. a java.util.HashMap from Java.
  1293. A few members have changed their names. If the old method signatures are needed,
  1294. then copy std_map.i from swig-3.0.12 and use that instead. Alternatively,
  1295. add the old missing methods to the new methods by using the following %proxycode:
  1296. %extend std::map {
  1297. %proxycode %{
  1298. // Old API
  1299. public boolean empty() {
  1300. return isEmpty();
  1301. }
  1302. public void set($typemap(jboxtype, K) key, $typemap(jboxtype, T) x) {
  1303. put(key, x);
  1304. }
  1305. public void del($typemap(jboxtype, K) key) {
  1306. remove(key);
  1307. }
  1308. public boolean has_key($typemap(jboxtype, K) key) {
  1309. return containsKey(key);
  1310. }
  1311. %}
  1312. }
  1313. *** POTENTIAL INCOMPATIBILITY ***
  1314. 2019-02-13: ZackerySpytz
  1315. #1469 Add support for C++17 hexadecimal floating literals.
  1316. 2019-02-11: wsfulton
  1317. [OCaml] #1437 OCaml has been give the 'Experimental' language status. The examples work
  1318. and most of the test-suite is also working, so it is quite close to being a 'Supported' language.
  1319. 2019-02-10: ZackerySpytz
  1320. #1464 Add support for C++14 binary integer literals.
  1321. 2019-02-10: ZackerySpytz
  1322. #1450 Add support for C++11 UCS-2 and UCS-4 character literals. Also, add support for
  1323. C++17 UTF-8 character literals.
  1324. 2019-02-10: wsfulton
  1325. [MzScheme] #1437 MzScheme/Racket is now an 'Experimental' language. The examples work
  1326. and a large portion of the test-suite is also working.
  1327. 2019-02-10: wsfulton
  1328. [MzScheme] Destructor wrappers were not being generated.
  1329. 2019-02-10: wsfulton
  1330. [MzScheme] Static variable wrappers fixed - $argnum was not expanded.
  1331. 2019-02-10: sethrj
  1332. #1452 Fix %apply for anonymous template instantiations
  1333. 2019-02-09: olly
  1334. [PHP] Fix access to already released memory during PHP module
  1335. shutdown, which often didn't cause visible problems, but could
  1336. result in segmentation faults, bus errors, etc. Fixes #1170,
  1337. reported by Jitka Plesníková.
  1338. 2019-02-09: olly
  1339. [PHP] A renamed constructor is now wrapped as a static method in
  1340. PHP.
  1341. 2019-02-08: olly
  1342. [PHP] Don't generate code which references $r when $r hasn't been
  1343. defined. This could happen in overloaded methods which returned
  1344. void and took at least one const std::string& parameter.
  1345. 2019-02-08: olly
  1346. [PHP] The generated code is now compatible with PHP 7.3, and the
  1347. testsuite now runs cleanly with this version too.
  1348. 2019-02-05: wsfulton
  1349. #1437 SWIG now classifies the status of target languages into either 'Experimental' or
  1350. 'Supported'. This status is provided to indicate the level of maturity to expect when using
  1351. a particular target language as not all target languages are fully developed. Details are
  1352. in the Introduction.html chapter of the documentation.
  1353. 2019-02-04: wsfulton
  1354. [CFFI] #1447 Common Lisp CFFI has been disabled as a target language in SWIG as part of a
  1355. clean up to remove target languages that have been neglected/not functional.
  1356. 2019-02-04: wsfulton
  1357. [Allegrocl] #1447 Allegro Common Lisp has been disabled as a target language in SWIG as part of a
  1358. clean up to remove target languages that have been neglected/not functional.
  1359. 2019-02-04: wsfulton
  1360. [Chicken] #1447 CHICKEN has been disabled as a target language in SWIG as part of a
  1361. clean up to remove target languages that have been neglected/not functional.
  1362. 2019-02-04: wsfulton
  1363. [CLISP] #1447 GNU Common Lisp has been disabled as a target language in SWIG as part of a
  1364. clean up to remove target languages that have been neglected/not functional.
  1365. 2019-02-04: wsfulton
  1366. [S-EXP] #1447 Common Lisp S-Exp has been disabled as a target language in SWIG as part of a
  1367. clean up to remove target languages that have been neglected/not functional.
  1368. 2019-02-04: wsfulton
  1369. [UFFI] #1447 Common Lisp UFFI has been disabled as a target language in SWIG as part of a
  1370. clean up to remove target languages that have been neglected/not functional.
  1371. 2019-02-04: wsfulton
  1372. [Pike] #1447 Pike has been disabled as a target language in SWIG as part of a
  1373. clean up to remove target languages that have been neglected/not functional.
  1374. 2019-02-04: wsfulton
  1375. [Modula3] #1447 Modula3 has been disabled as a target language in SWIG as part of a
  1376. clean up to remove target languages that have been neglected/not functional.
  1377. 2019-02-02: ahnolds
  1378. [Python] Documentation enhancements for Python:
  1379. #728 Fixed the handling of autodoc when using -fastproxy.
  1380. #1367 Added documentation to wrapped member variables using the
  1381. property(... doc="...") construct.
  1382. Only show a single documentation entry for functions with default arguments when
  1383. using autodoc.
  1384. Fixed a bug where a cached doxygen docstring could be deleted while still in use,
  1385. causing swig to segfault.
  1386. 2019-01-31: olly
  1387. SWIG now requires a target language to be specified instead of
  1388. defaulting to wrapping for Tcl. Specifying swig --help without
  1389. a target language now just shows the generic help. The -nolang
  1390. option has been removed.
  1391. 2019-01-28: ZackerySpytz
  1392. [OCaml] #1429 Remove support for OCaml versions < 3.12.0.
  1393. *** POTENTIAL INCOMPATIBILITY ***
  1394. 2019-01-22: vadz
  1395. [Ruby, Octave] #1424 Improve autodoc parameter naming.
  1396. 2019-01-22: vadz
  1397. [Python] #1271 #1423 Always include default parameter values in autodoc strings.
  1398. 2019-01-19: vadz
  1399. #1272, #1421 When a function's parameter is a keyword, the name of the paramater is
  1400. no longer simply changed to argN, where N is the argument number. Instead the
  1401. parameter name is changed to the renaming rules for keywords that normally apply to
  1402. symbols such as classes/functions etc. Note that unlike other symbol renaming,
  1403. parameter renaming does not issue a warning when the parameter is renamed. This
  1404. change only affects languages where the parameter names are actually used, for example,
  1405. Java function parameter lists in the proxy class or Python documentation comments.
  1406. 2019-01-18: wsfulton
  1407. #1420 Fix gdb debugger functions 'swigprint' and 'locswigprint' from swig.gdb to
  1408. work with newer versions of gdb-8. Fixes errors when debugging SWIG source with gdb:
  1409. (gdb) swigprint n
  1410. Undefined command: "Printf". Try "help".
  1411. 2019-01-16: wsfulton
  1412. Python static method wrapper changes
  1413. - Static method wrappers were using the 'fastproxy' approach by default.
  1414. This is inconsistent with instance method wrappers. The fastproxy approach
  1415. is now turned off by default to be consistent with instance methods.
  1416. Static method wrappers can now also be controlled using the -fastproxy and
  1417. -olddefs options.
  1418. Example:
  1419. struct Klass {
  1420. static int statmethod(int a = 2);
  1421. };
  1422. generates by default:
  1423. class Klass(object):
  1424. ...
  1425. @staticmethod
  1426. def statmethod(a=2):
  1427. return _example.Klass_statmethod(a)
  1428. instead of the following (which can be restored by using -fastproxy):
  1429. class Klass(object):
  1430. ...
  1431. statmethod = staticmethod(_example.Klass_statmethod)
  1432. - Modernise wrappers for static methods to use decorator syntax - @staticmethod.
  1433. - Add missing runtime test for static class methods and using the actual class method.
  1434. 2019-01-12: ZackerySpytz
  1435. [OCaml] #1403 #1194 Fix compilation problems for OCaml >= 4.03.0 due to OCaml using
  1436. int64_t instead of int64.
  1437. 2019-01-11: ZackerySpytz
  1438. [OCaml] #1400 Fix the getters and setters of non-static member variables.
  1439. 2019-01-07: wsfulton
  1440. #358 Add VOID to windows.i
  1441. 2019-01-05: wsfulton
  1442. #948 #1019 #1273 Fix for C++11 raw strings where the delimiters were mistakenly left
  1443. in the string contents in situations where the string was copied into generated code.
  1444. For example, %constant, the "docstring" feature and for C#/Java/D constants turned on
  1445. with %javaconst/%csconst/%dmanifestconst.
  1446. 2019-01-05: wsfulton
  1447. [Ruby] #538. Fix Ruby support for %feature("docstring").
  1448. 2019-01-03: wsfulton
  1449. #1202 Fix overloading of non-pointer class types in scripting languages when overloaded
  1450. with a pointer and a NULL scripting language equivalent is used, eg None in Python.
  1451. The implementation changes the SWIGTYPE, SWIGTYPE& and SWIGTYPE&& typecheck typemaps to
  1452. prevent accepting a conversion to a NULL pointer.
  1453. 2019-01-03: ZackerySpytz
  1454. [OCaml] #1386 Fix the OCaml examples and test suite for out-of-source builds.
  1455. 2019-01-01: wsfulton
  1456. [Python] #639 remove duplicate proxy method definitions for global function wrappers.
  1457. Global functions previously generated two definitions, eg:
  1458. def foo():
  1459. return _example.foo()
  1460. foo = _example.foo
  1461. The first definition is replaced by the second definition and so the second definition
  1462. is the one used when the method is actually called. Now just the first definition is
  1463. generated by default and if the -fastproxy command line option is used, just the second
  1464. definition is generated. The second definition is faster as it avoids the proxy Python
  1465. method as it calls the low-level C wrapper directly. Using both -fastproxy and -olddefs
  1466. command line options will restore the previously generated code as it will generate both
  1467. method definitions.
  1468. With this change, the wrappers for global C/C++ functions and C++ class methods now work
  1469. in the same way wrt to generating just a proxy method by default and control via
  1470. -fastproxy/-olddefs options.
  1471. 2018-12-20: hasinoff,wsfulton
  1472. [Java] #1334 Set Java thread name to native thread name when using directors.
  1473. Default is to use name "Thread-XXX" and is still works like this by default. However,
  1474. adding the following will turn on the thread name setting (works for more recent
  1475. versions of Linux and MacOS):
  1476. %begin %{
  1477. #define SWIG_JAVA_USE_THREAD_NAME
  1478. %}
  1479. 2018-12-20: chlandsi
  1480. [Python] #1357. Fix overriding __new__ in Python 3.6.
  1481. Fixes SystemError: Objects/tupleobject.c:81: bad argument to internal function"
  1482. 2018-12-16: wsfulton
  1483. [Python] #848 #1343 The module import logic has changed to stop obfuscating real ImportError
  1484. problems. Only one import of the low-level C/C++ module from the pure Python module is
  1485. attempted now. Previously a second import of the low-level C/C++ module was attempted
  1486. after an ImportError occurred and was done to support 'split modules'. A 'split module' is
  1487. a configuration where the pure Python module is a module within a Python package and the
  1488. low-level C/C++ module is a global Python module. Now a 'split module' configuration is
  1489. no longer supported by default. This configuration can be supported with a simple
  1490. customization, such as:
  1491. %module(package="mypackage", moduleimport="import $module") foo
  1492. or if using -builtin:
  1493. %module(package="mypackage", moduleimport="from $module import *") foo
  1494. instead of
  1495. %module(package="mypackage") foo
  1496. See the updated Python chapter titled "Location of modules" in the documentation.
  1497. 2018-12-11: tlby
  1498. [Perl] #1374 repair EXTEND() handling in typemaps
  1499. 2018-12-06: vadz
  1500. #1359 #1364 Add missing nested class destructor wrapper when the nested class is
  1501. inside a template. Removes associated bogus 'Illegal destructor name' warning. Only
  1502. occurred when the nested class' destructor is explicitly specified.
  1503. 2018-12-04: adr26
  1504. [Python] #1368 #1369 Access Violation in tp_print caused by mismatched Python/extension
  1505. CRT usage
  1506. Remove all use of tp_print, as this API uses a FILE*, which can be
  1507. mismatched when modules are built with different C libraries from
  1508. the main python executable.
  1509. This change also brings consistent output between Python 2 and 3 for the 'cvar' SWIG
  1510. object (that contains the global variables) and SWIG packed objects (such as callback
  1511. constants).
  1512. 2018-12-04: wsfulton
  1513. [Python] #1282 Fix running 'python -m' when using 'swig -builtin'
  1514. Similar to the earlier PEP 366 conforming fix for non-builtin.
  1515. 2018-11-29: adr26
  1516. [Python] #1360 Leak of SWIG var link object
  1517. Fix reference counting on _SWIG_globals to allow var link to be freed on module unload.
  1518. 2018-11-28: wsfulton
  1519. [Python] When using -builtin, the two step C-extension module import is now
  1520. one step and the wrapped API is only available once and not in an underlying
  1521. module attribute like it is without -builtin. To understand this, consider a
  1522. module named 'example' (using: %module example). The C-extension is compiled into
  1523. a Python module called '_example' and a pure Python module provides the actual
  1524. API from the module called 'example'. It was previously possible to additionally
  1525. access the API from the module attribute 'example._example'. The latter was an
  1526. implementation detail and is no longer available. It shouldn't have been used, but
  1527. if necessary it can be resurrected using the moduleimport attribute described in the
  1528. Python chapter of the documentation. If both modules are provided in a Python
  1529. package, try:
  1530. %module(moduleimport="from . import _example\nfrom ._example import *") example
  1531. or more generically:
  1532. %module(moduleimport="from . import $module\nfrom .$module import *") example
  1533. and if both are provided as global modules, try:
  1534. %module(moduleimport="import _example\nfrom _example import *") example
  1535. or more generically:
  1536. %module(moduleimport="import $module\nfrom $module import *") example
  1537. The module import code shown will appear in the example.py file.
  1538. 2018-11-24: vadz
  1539. #1358 Fix handling of abstract base classes nested inside templates
  1540. Correct detecting of whether a derived class method overrides a pure virtual
  1541. base class method when both classes are nested inside a template class: this
  1542. notably didn't work correctly for methods taking parameters of the base class
  1543. type.
  1544. 2018-11-22: rupertnash
  1545. [Python] #1282 Make generated module runnable via python -m (PEP 366 conforming)
  1546. Previously any SWIG generated modules in a package would fail with an ImportError
  1547. when using 'python -m' for example 'python -m mypkg.mymodule'.
  1548. This fix also allows the SWIG generated module to be placed into a directory and
  1549. then renamed __init__.py to convert the module into a package again. This ability
  1550. stopped working in swig-3.0.9. However, only Python 2.7 or 3.3 and later work. If
  1551. Python 3.2 support is needed, use moduleimport in %module to customise the import
  1552. code.
  1553. 2018-11-13: wsfulton
  1554. #1340 Remove -cppcast and -nocppcast command line options (this was an option
  1555. available to the scripting language targets).
  1556. The -cppcast option is still turned on by default. The -nocppcast option
  1557. to turn off the use of c++ casts (const_cast, static_cast etc) has been
  1558. removed. However, defining SWIG_NO_CPLUSPLUS_CAST will still generate C casts
  1559. instead of C++ casts for C++ wrappers.
  1560. *** POTENTIAL INCOMPATIBILITY ***
  1561. 2018-11-13: wsfulton
  1562. [Python] #1340 Remove -outputtuple and -nooutputtuple command line options.
  1563. Both the command line and %module options of the same name have been
  1564. removed. These were undocumented. The -outputtuple option returned a
  1565. Python tuple instead of a list, mostly typically in the OUTPUT
  1566. typemap implementations.
  1567. It unclear why a tuple instead of a list return type is needed and
  1568. hence this option has been removed as part of the simplification of
  1569. the SWIG Python command line options for SWIG 4.
  1570. 2018-11-13: wsfulton
  1571. [Python] #1340 Remove -noproxyimport command line option.
  1572. This option turned off the insertion of Python import statements
  1573. derived from a %import directive. For example given:
  1574. %module module_b
  1575. %import "module_a.i"
  1576. then module_b.py will contain:
  1577. import module_a
  1578. *** POTENTIAL INCOMPATIBILITY ***
  1579. 2018-10-29: AlexanderGabriel
  1580. [PHP] The following PHP7 reserved keywords are now only renamed by
  1581. SWIG when used as function names in the API being wrapper:
  1582. __halt_compiler array die echo empty eval exit include include_once
  1583. isset list print require require_once return unset
  1584. 2018-10-22: olly,wsfulton
  1585. [Python] #1261 #1340 Turn on many optimisation options by default and rationalise the
  1586. number of command line options.
  1587. There were an unnecessary number of command line options and many of these have now
  1588. been removed in a drive for simplification. Some were needed to support older versions
  1589. of Python (2.6 and earlier).
  1590. Many of the options could be turned on individually and when using -O. Previously -O
  1591. resulted in turning on a set of options:
  1592. -modern -fastdispatch -nosafecstrings -fvirtual -noproxydel
  1593. -fastproxy -fastinit -fastunpack -fastquery -modernargs -nobuildnone
  1594. Now -O results in turning on this reduced set:
  1595. -fastdispatch -fastproxy -fvirtual
  1596. The following options are now on by default, a deprecated warning is displayed if they
  1597. are used:
  1598. -fastinit Class initialisation code done in C/C++ rather than in Python code.
  1599. -fastquery Python dictionary used for lookup of types.
  1600. -fastunpack Faster unpacking of function arguments in C/C++ wrappers.
  1601. -modern Use Python 2.3 features such as object and property.
  1602. -modernargs Use Python 2.3 C APIs for unpacking arguments in tuples.
  1603. -noproxydel Stop generating a proxy __del__ method for backwards compatiblity.
  1604. -safecstrings No discernable difference
  1605. The following options have been removed altogether:
  1606. -aliasobj0
  1607. -buildnone
  1608. -classptr
  1609. -new_repr
  1610. -newrepr
  1611. -noaliasobj0
  1612. -nobuildnone
  1613. -nocastmode
  1614. -nodirvtable
  1615. -noextranative
  1616. -nofastinit
  1617. -nofastproxy
  1618. -nofastquery
  1619. -nomodern
  1620. -nomodernargs
  1621. -nooutputtuple
  1622. -nosafecstrings
  1623. -old_repr
  1624. -oldrepr
  1625. -proxydel
  1626. -new_vwm is no longer supported. Use the -newvwm alias instead.
  1627. *** POTENTIAL INCOMPATIBILITY ***
  1628. 2018-10-22: olly
  1629. [Python] #1261 Remove command line option no longer needed as Python 2.3 and earlier
  1630. are no longer supported:
  1631. -classic
  1632. 2018-10-09: wsfulton
  1633. [D, Go, Guile, Lua, Mzscheme, Ocaml, Perl5, Php, Scilab, Tcl]
  1634. Allow wrapping of std::map using non-default comparison function.
  1635. 2018-10-09: vadz
  1636. [Java] #1274 Allow wrapping of std::map using non-default comparison function.
  1637. 2018-10-04: wsfulton
  1638. [Python] #1126 Fix C default arguments with -builtin and -fastunpack and -modernargs.
  1639. Problem occurred when there is just one (defaulted) parameter in the parameter list.
  1640. 2018-09-24: wsfulton
  1641. [Python] #1319 C++11 hash tables implementation is finished now (including for -builtin):
  1642. std::unordered_map
  1643. std::unordered_set
  1644. std::unordered_multimap
  1645. std::unordered_multiset
  1646. 2018-09-21: wsfulton
  1647. [Python] Fix when using -builtin and wrapping std::map, std::set, std::unordered_map or
  1648. std::unordered_set to ensure __contains__ is called. This is a wrapper for the STL
  1649. container's find method. Without it, Python will do its own slower sequence search.
  1650. 2018-09-19: wsfulton
  1651. [Python] Fix functors (wrapped as __call__) when using -builtin -modern -fastunpack.
  1652. 2018-09-02: andreas.gaeer,tkrasnukha
  1653. [Python] #1321 Fix assert in PyTuple_GET_SIZE in debug interpreter builds of python-3.7
  1654. when calling tp_new.
  1655. 2018-09-01: ChristopherHogan
  1656. [Guile] #1288 Fix garbage collection for guile >= 2.0.12.
  1657. 2018-08-31: wsfulton
  1658. [Python] #1319 C++11 hash tables support:
  1659. std::unordered_map
  1660. std::unordered_set
  1661. std::unordered_multimap
  1662. std::unordered_multiset
  1663. is now compiling and working (sorting using -builtin not fully functional yet though).
  1664. 2018-08-20: wkalinin
  1665. #1305 Fix nested structure symbol tables in C mode to fix member name conflicts
  1666. in different structs with the same nested struct member name.
  1667. 2018-08-18: wsfulton
  1668. [Python] #688 Fix makefile recursion when running python test-suite.
  1669. 2018-08-18: wsfulton
  1670. [Python] #1310 Re-implement Python -fastproxy option.
  1671. The previous implementation failed with Python 3 and abstract base clases.
  1672. The new implementation replaces the Python 2 implementation using
  1673. new.instancemethod with the C API PyMethod_New to match the equivalent Python 3
  1674. implementation which uses PyInstanceMethod_New.
  1675. The new approach runs slightly faster. See #1310.
  1676. 2018-08-12: gmazzamuto
  1677. [Python] #1283 Update pybuffer.i library to use new-style Python buffer C API.
  1678. 2018-08-12: brianhatwood,wsfulton
  1679. [Java] #1303 #1304 Fix crash in directors when using OUTPUT and INOUT typemaps in typemaps.i and
  1680. passing NULL pointers in C++ to director method overloaded and implemented in Java.
  1681. 2018-08-10: wsfulton
  1682. [Python] #1293 Improve TypeError message inconsistencies between default and fastdispatch
  1683. mode when handling overloaded C++ functions. Previously the error message did not always
  1684. display the possible C/C++ prototypes in fastdispatch mode.
  1685. 2018-08-02: furylynx,jacobwgillespie,p2k
  1686. [Javascript] #1290, #968. Add support for NodeJS versions 2-10.
  1687. 2018-07-31: wsfulton
  1688. [Python] #1293 Overloaded C++ function wrappers now raise a TypeError instead
  1689. of NotImplementedError when the types passed are incorrect. This change means
  1690. there is now consistency with non-overloaded function wrappers which have always
  1691. raised TypeError when the incorrect types are passed. The error message remains
  1692. the same and is for example now:
  1693. TypeError: Wrong number or type of arguments for overloaded function 'f'.
  1694. Possible C/C++ prototypes are:
  1695. f(int)
  1696. f(char const *)
  1697. instead of:
  1698. NotImplementedError: Wrong number or type of arguments for overloaded function 'f'.
  1699. Possible C/C++ prototypes are:
  1700. f(int)
  1701. f(char const *)
  1702. *** POTENTIAL INCOMPATIBILITY ***
  1703. 2018-06-23: wsfulton
  1704. [Python] #718 Fix pythonnondynamic feature for modern classes
  1705. Fixes nondynamic mode when an instance variable is set with the same
  1706. name as a class variable in a class derived from a SWIG proxy class.
  1707. This corner case set an instance variable instead of raising an AttributeError.
  1708. Also fix %pythonnondynamic in Python 3 with -modern. The metaclass
  1709. containing the implementation was previously not being applied in Python 3.
  1710. 2018-07-17: petrmitrichev,wsfulton
  1711. [Python] #1275 #1279 Initialize function-local statics (singletons) that call Python
  1712. code during Python module initialization in order to avoid deadlocks with subsequent
  1713. multi-threaded usage.
  1714. 2018-06-15: wsfulton
  1715. [Python] Fix seg fault using Python 2 when passing a Python string, containing
  1716. invalid utf-8 content, to a wstring or wchar * parameter. A TypeError is thrown instead, eg:
  1717. %include <std_wstring.i>
  1718. void instring(const std::wstring& s);
  1719. instring(b"h\xe9llooo") # Python
  1720. 2018-06-15: wsfulton
  1721. [Python] Python 3.7 support: Replace use of deprecated PyUnicode_GetSize with
  1722. PyUnicode_GetLength to remove deprecated warnings compiling the C/C++ wrappers.
  1723. 2018-06-12: wsfulton
  1724. [Python] Python 3.7 support: The %pythonabc feature in pyabc.i now uses base classes
  1725. collections.abc.MutableSequence
  1726. collections.abc.MutableMapping
  1727. collections.abc.MutableSet
  1728. instead of
  1729. collections.MutableSequence
  1730. collections.MutableMapping
  1731. collections.MutableSet
  1732. as the latter are deprecated in Python 3.7 and are due to be removed in Python 3.8.
  1733. The classes in collections.abc.* are available from Python 3.3 onwards. If you
  1734. require support for Python 3.2, then copy the pyabc.i file and modify by removing
  1735. the few instances of the .abc sub-module.
  1736. *** POTENTIAL INCOMPATIBILITY ***
  1737. 2018-06-12: olly,wsfulton
  1738. [Python] #701 Remove support for Python versions < 2.7 and 3.0 and 3.1.
  1739. *** POTENTIAL INCOMPATIBILITY ***
  1740. 2018-06-11: olly
  1741. [Python] Fix new GCC8 warnings in generated code by avoiding casts
  1742. between incompatible function types where possible, and by
  1743. suppressing the warning when it's due to the design of Python's C
  1744. API. Fixes #1259.
  1745. 2018-06-08: philippkraft
  1746. [Python] Stop exposing <CLASS>_swigregister to Python. It's not
  1747. useful for user Python code to call this, and it just clutters the
  1748. API unnecessarily. Fixes #1225.
  1749. 2018-06-07: cmfoil, kabbi, Jamie Kirkpatrick, markok314, vadz, wsfulton, Yann Diorcet
  1750. #170 Doxygen documentation support added. This allows translation of Doxygen comments
  1751. into JavaDoc and PyDoc documentation. It is enabled via the -doxygen command line
  1752. option. See the Doxygen.html chapter in the documentation for further information.
  1753. 2018-06-07: olly
  1754. [PHP] We've finally removed support for %pragma(php4) which was
  1755. deprecated back in 2008. Use %pragma(php) instead, which has been
  1756. supported since at least 2005.
  1757. *** POTENTIAL INCOMPATIBILITY ***
  1758. 2018-06-07: olly
  1759. [PHP5] Support for PHP5 has been removed. PHP5 is no longer
  1760. actively supported by the PHP developers and security support for
  1761. it ends completely at the end of 2018, so it doesn't make sense
  1762. to include support for it in the upcoming SWIG 4.0.0 release.
  1763. *** POTENTIAL INCOMPATIBILITY ***
  1764. 2018-06-06: olly
  1765. [Lua] Improve configure probes for Lua headers and libs used in testsuite.
  1766. 2018-05-15: kwwette
  1767. [Octave] add support for version 4.4
  1768. - Should not introduce any user-visible incompatibilities
  1769. 2018-05-15: wsfulton
  1770. [C#, D, Java] Fix lookup of csconstruct, dconstruct and javaconstruct typemaps.
  1771. The C++ namespace was previously ignored when looking up the typemap.
  1772. 2018-05-15: wsfulton
  1773. [Javascript] Fix generated C++ code when using %nspace on namespaces that are more
  1774. than two levels deep.
  1775. 2018-05-14: wsfulton
  1776. Issue #1251 Add support for C++17 nested namespace definitions,
  1777. for example:
  1778. namespace A::B { ... }
  1779. 2018-05-11: wsfulton
  1780. [C#, D, Java] Add support so that the %csmethodmodifiers, %dmethodmodifiers,
  1781. %javamethodmodifiers can modify the method modifiers for the destructor wrappers
  1782. in the proxy class: dispose, Dispose, delete. With this feature, it is now possible
  1783. to make a C# proxy class sealed, eg when wrapping a class X, the virtual method modifiers
  1784. can be removed using:
  1785. %typemap(csclassmodifiers) X "public sealed class"
  1786. %csmethodmodifiers X::~X "public /*virtual*/";
  1787. 2018-04-18: olly
  1788. [Python] Suppress new pycodestyle warning:
  1789. E252 missing whitespace around parameter equals
  1790. 2018-04-07: goatshriek
  1791. [Ruby] #1213 Fix ruby %alias directive for global C/C++ functions.
  1792. 2018-04-03: olly
  1793. [Ruby] Fix to pass Qnil instead of NULL to rb_funcall(), which silences GCC
  1794. -Wconversion-null warning (on by default with recent GCC).
  1795. 2018-03-09: wsfulton
  1796. [Java] #1184 Fix swigReleaseOwnership() and swigTakeOwnership() regression
  1797. for non-director classes. Restores a dynamic_cast which was previously removed.
  1798. 2018-03-07: llongi
  1799. Github PR #1166 - Fix preprocessor handling of macros with commas
  1800. in a // comment.
  1801. 2018-02-18: JPEWdev
  1802. Patch #1164 - Add support for a command-line options file, also sometimes
  1803. called a response file. This is useful if the command-line options exceed
  1804. the system command-line length limit. To use, put the command-line options
  1805. into a file, then provide the file name prefixed with @, for example using
  1806. a file called args.txt:
  1807. swig @args.txt
  1808. 2018-02-11: wsfulton
  1809. [Javascript] #1187 Fix compilation error wrapping std::complex via
  1810. std_complex.i.
  1811. 2018-01-30: smarchetto
  1812. [Scilab] add type name argument in SWIG_ptr() function to cast from pointer address to typed pointers
  1813. 2018-01-16: wsfulton
  1814. Expressions following a preprocessor directive must now be separated by whitespace
  1815. or non-numeric characters. This syntax change makes the SWIG preprocessor work like
  1816. the C preprocessor in this area.
  1817. For example, the following code used be accepted as valid syntax:
  1818. #if1
  1819. #define ABC 123
  1820. #endif
  1821. Now you get an error:
  1822. example.h:1: Error: Unknown SWIG preprocessor directive: if1 (if this is a block of
  1823. target language code, delimit it with %{ and %})
  1824. example.h:3: Error: Extraneous #endif.
  1825. The following is the correct syntax:
  1826. #if 1
  1827. #define ABC 123
  1828. #endif
  1829. The following of course also works:
  1830. #if(1)
  1831. #define ABC 123
  1832. #endif
  1833. *** POTENTIAL INCOMPATIBILITY ***
  1834. 2018-01-15: wsfulton
  1835. Fix issue #1183. Floating point exception evaluating preprocessor expressions
  1836. resulting in division by zero.
  1837. 2018-01-14: wsfulton
  1838. Fix issue #1172. Seg fault parsing invalid exponents in the preprocessor.
  1839. 2018-01-12: Liryna
  1840. [C#] Patch #1128. Add ToArray function to std::vector wrappers.
  1841. 2018-01-12: wsfulton
  1842. [Java] Fix issue #1156. Add missing throws clause for interfaces when using the
  1843. %interface family of macros.
  1844. 2018-01-05: wsfulton
  1845. Fix default arguments using expressions containing -> syntax error. Problem reported on
  1846. swig-user mailing list.
  1847. 2017-12-30: wsfulton
  1848. [Python] Replace pep8 with pycodestyle for checking the Python code style when
  1849. running Python tests.
  1850. 2017-12-30: davedissian
  1851. Fixed a symbol lookup issue when encountering a typedef of a symbol from the tag
  1852. namespace to the global namespace when the names are identical, such as 'typedef
  1853. struct Foo Foo;'.
  1854. 2017-12-13: wsfulton
  1855. [Perl] add missing support for directorfree typemaps.
  1856. 2017-12-13: wsfulton
  1857. Issue #1167 Fix directorout typemaps which were causing undefined behaviour when
  1858. returning pointers by reference.
  1859. 2017-12-08: olly
  1860. [PHP] Use ZEND_MODULE_GLOBALS_ACCESSOR to access globals so the
  1861. generated code builds when PHP was built with ZTS enabled.
  1862. 2017-12-04: wsfulton
  1863. [Python] Add missing checks for failures in calls to PyUnicode_AsUTF8String. Previously a
  1864. seg fault could occur when passing invalid UTF8 strings (low surrogates), eg passing
  1865. u"\udcff" to the C layer (Python 3).
  1866. 2017-11-24: joequant
  1867. [R] Fix #1124 and return R_NilValue for null pointers
  1868. 2017-11-29: wsfulton
  1869. [Java] director exception handling improvements.
  1870. When a director method throws an exception and it is caught by DirectorException
  1871. and passed back to Java using Swig::DirectorException::throwException, the Java
  1872. stack trace now contains the original source line that threw the exception.
  1873. Deprecate Swig::DirectorException::raiseJavaException, please replace usage with
  1874. Swig::DirectorException::throwException.
  1875. *** POTENTIAL INCOMPATIBILITY ***
  1876. 2017-10-26: wsfulton
  1877. Add support for C++11 ref-qualifiers when using directors.
  1878. 2017-10-26: wsfulton
  1879. Fix generated code when using directors and methods returning const ref pointers.
  1880. 2017-10-26: wsfulton
  1881. [C#, D, Java, Octave, R, Scilab] Port director typemaps to these additional languages.
  1882. Issue #700.
  1883. 2017-10-26: radarsat1
  1884. [Ruby Python] Patch #1029 - Correct handling of null using directors and shared_ptr.
  1885. 2017-10-10: joequant
  1886. [R] pass enum expressions to R. This will generate
  1887. incorrect files when there is an arithmetic expression
  1888. in the enum, but this is better than silently generating
  1889. incorrect code
  1890. 2017-10-09: olly
  1891. [PHP] Fix incorrect wrapper code generated when there's a
  1892. combination of overloading, parameters with a default value
  1893. and %newobject. Fixes https://sourceforge.net/p/swig/bugs/1350/
  1894. 2017-10-09: olly
  1895. Remove GCJ support. It isn't in a good state and doesn't seem to
  1896. be used, and GCC7 dropped GCJ. Closes
  1897. https://sourceforge.net/p/swig/bugs/823/
  1898. 2017-10-07: olly
  1899. Fix preprocessor handling of empty macro arguments to match that of
  1900. C/C++ compilers. Fixes issue #1111 and
  1901. https://sourceforge.net/p/swig/bugs/826/
  1902. 2017-10-06: wsfulton
  1903. [Python] Issue #1108. Fix platform inconsistency in Python default argument handling.
  1904. 32 bit and 64 bit compiled versions of SWIG generated different Python files
  1905. when default arguments were outside the range of 32 bit signed integers.
  1906. The default arguments specified in Python are now only those that are in the
  1907. range of a 32 bit signed integer, otherwise the default is obtained from C/C++ code.
  1908. 2017-10-02: wsfulton
  1909. [C#] Fix std::complex types passed by value.
  1910. 2017-10-02: wsfulton
  1911. [Javascript, Python, Ruby] Issue #732 - Missing type information for std::complex
  1912. in std_complex.i meant that previously std::complex always had to be fully qualified
  1913. in order to be wrapped with the appropriate typemaps.
  1914. 2017-10-01: joequant
  1915. allow R package names with docs
  1916. allowing multiple get accessors in R
  1917. fix smart-pointer and NAMESPACE support
  1918. constructors now returning smart pointers (if class
  1919. declared as such)
  1920. smart-pointer classes deriving from parent smart-pointers
  1921. 2017-09-29: wsfulton
  1922. Issue #1100 - Allow an instantiated template to have the same name in the target
  1923. language as the C++ template name, for example, this is now possible:
  1924. template<typename T> struct X { ... };
  1925. %template(X) X<int>;
  1926. 2017-09-23: wsfulton
  1927. Issue #1098. Fix overloading of shared_ptr with underlying pointer types, eg:
  1928. void m(std::shared_ptr<T> p);
  1929. void m(T &p);
  1930. void m(T *p);
  1931. Only the first method is wrapped and the others are ignored/shadowed.
  1932. The implementation is done via a new attribute in the 'typecheck' typemap called
  1933. 'equivalent'. If specified, it must contain the equivalent pointer type for overloading
  1934. and can only be used for the special SWIG_TYPECHECK_POINTER precedence level.
  1935. The shared_ptr 'typecheck' typemaps have been modified accordingly.
  1936. Here is a simplified version:
  1937. %typemap(typecheck, precedence=SWIG_TYPECHECK_POINTER, equivalent="T *")
  1938. T,
  1939. T CONST &,
  1940. T CONST *,
  1941. T *CONST&,
  1942. std::shared_ptr< T >,
  1943. std::shared_ptr< T > &,
  1944. std::shared_ptr< T > *,
  1945. std::shared_ptr< T > *&
  1946. { ... }
  1947. Overloading with any of these types will result in SWIG ignoring all but the first
  1948. overloaded method by default. Without the 'equivalent' attribute, wrapping the overloaded
  1949. methods resulted in types being shadowed (scripting languages) or code that did not
  1950. compile (statically typed languages).
  1951. 2017-09-19: futatuki
  1952. [Python] #1003 Add --with-2to3=/path/to/2to3 option to configure.
  1953. 2017-09-18: wsfulton
  1954. Fix type promotion wrapping constant expressions of the form:
  1955. # define EXPR_MIXED1 (0x80 + 11.1) - 1
  1956. This was previously an integral type instead of a floating point type.
  1957. 2017-09-17: wsfulton
  1958. Fix generated code for constant expressions containing wchar_t L literals such as:
  1959. # define __WCHAR_MAX (0x7fffffff + L'\0')
  1960. # define __WCHAR_MIN (-__WCHAR_MAX - 1)
  1961. 2017-09-10: mlamarre
  1962. [Python] Patch #1083. Define_DEBUG to 1 to do exactly like Visual Studio
  1963. /LDd, /MDd or /MTd compiler options.
  1964. 2017-08-25: wsfulton
  1965. Issue #1059. Add support for C++11 ref-qualifiers on non-static member functions.
  1966. Members with lvalue ref-qualifiers such as:
  1967. struct RQ {
  1968. void m1(int x) &;
  1969. void m2(int x) const &;
  1970. };
  1971. are wrapped like any other member function. Member functions with rvalue ref-qualifiers
  1972. are ignored by default, such as:
  1973. struct RQ {
  1974. void m3(int x) &&;
  1975. void m4(int x) const &&;
  1976. };
  1977. example.i:7: Warning 405: Method with rvalue ref-qualifier m3(int) && ignored.
  1978. example.i:8: Warning 405: Method with rvalue ref-qualifier m4(int) const && ignored.
  1979. These can be unignored and exposed to the target language, see further documentation in
  1980. CPlusPlus11.html.
  1981. 2017-08-16: wsfulton
  1982. Fix #1063. Add using declarations to templates into typedef table.
  1983. Using declarations to templates were missing in SWIG's internal typedef tables.
  1984. This led to a few problems, such as, templates that did not instantiate and generated
  1985. C++ code that did not compile as SWIG did not know what scope the template was
  1986. in. This happened mostly when a using declaration was used on a template type in a
  1987. completely unrelated namespace.
  1988. 2017-08-16: wsfulton
  1989. Fix type lookup in the presence of using directives and using declarations.
  1990. Fix some cases of type lookup failure via a combination of both using directives and
  1991. using declarations resulting in C++ code that did not compile as the generated type was
  1992. not fully qualified for use in the global namespace. Example below:
  1993. namespace Space5 {
  1994. namespace SubSpace5 {
  1995. namespace SubSubSpace5 {
  1996. struct F {};
  1997. }
  1998. }
  1999. using namespace SubSpace5;
  2000. using SubSubSpace5::F;
  2001. void func(SubSubSpace5::F f);
  2002. }
  2003. 2017-08-16: wsfulton
  2004. Issue #1051. %template scope enforcement and class definition fixes.
  2005. The scoping rules around %template have been specified and enforced.
  2006. The %template directive for a class template is the equivalent to an
  2007. explicit instantiation of a C++ class template. The scope for a valid
  2008. %template instantiation is now the same as the scope required for a
  2009. valid explicit instantiation of a C++ template. A definition of the
  2010. template for the explicit instantiation must be in scope where the
  2011. instantiation is declared and must not be enclosed within a different
  2012. namespace.
  2013. For example, a few %template and C++ explicit instantiations of std::vector
  2014. are shown below:
  2015. // valid
  2016. namespace std {
  2017. %template(vin) vector<int>;
  2018. template class vector<int>;
  2019. }
  2020. // valid
  2021. using namespace std;
  2022. %template(vin) vector<int>;
  2023. template class vector<int>;
  2024. // valid
  2025. using std::vector;
  2026. %template(vin) vector<int>;
  2027. template class vector<int>;
  2028. // ill-formed
  2029. namespace unrelated {
  2030. using std::vector;
  2031. %template(vin) vector<int>;
  2032. template class vector<int>;
  2033. }
  2034. // ill-formed
  2035. namespace unrelated {
  2036. using namespace std;
  2037. %template(vin) vector<int>;
  2038. template class vector<int>;
  2039. }
  2040. // ill-formed
  2041. namespace unrelated {
  2042. namespace std {
  2043. %template(vin) vector<int>;
  2044. template class vector<int>;
  2045. }
  2046. }
  2047. // ill-formed
  2048. namespace unrelated {
  2049. %template(vin) std::vector<int>;
  2050. template class std::vector<int>;
  2051. }
  2052. When the scope is incorrect, an error now occurs such as:
  2053. cpp_template_scope.i:34: Error: 'vector' resolves to 'std::vector' and
  2054. was incorrectly instantiated in scope 'unrelated' instead of within scope 'std'.
  2055. Previously SWIG accepted the ill-formed examples above but this led to
  2056. numerous subtle template scope problems especially in the presence of
  2057. using declarations and using directives as well as with %feature and %typemap.
  2058. Actually, a valid instantiation is one which conforms to the C++03
  2059. standard as C++11 made a change to disallow using declarations and
  2060. using directives to find a template.
  2061. // valid C++03, ill-formed C++11
  2062. using std::vector;
  2063. template class vector<int>;
  2064. Similar fixes for defining classes using forward class references have
  2065. also been put in place. For example:
  2066. namespace Space1 {
  2067. struct A;
  2068. }
  2069. namespace Space2 {
  2070. struct Space1::A {
  2071. void x();
  2072. }
  2073. }
  2074. will now error out with:
  2075. cpp_class_definition.i:5: Error: 'Space1::A' resolves to 'Space1::A' and
  2076. was incorrectly instantiated in scope 'Space2' instead of within scope 'Space1'.
  2077. Previously some symbols would have been instantiated in the wrong scope and led
  2078. to lots of scope problems involving SWIG typemaps, features, renames etc.
  2079. You will need to correct the scope used in other SWIG directives which do not
  2080. support 'using declarations' and 'using directives'. For example, if you previously had:
  2081. %rename(Zap) vector<int>::clear;
  2082. using namespace std;
  2083. %template(VectorInt) vector<int>;
  2084. Prior versions of SWIG incorrectly instantiated vector<int> in the global namespace
  2085. and so the %rename matched. Now the template is instantiated in the correct namespace,
  2086. so is fully qualified as std::vector<int>. The other SWIG directives need correcting as
  2087. they do not follow 'using declarations' and 'using directives'. Change it to:
  2088. %rename(Zap) std::vector<int>::clear;
  2089. using namespace std;
  2090. %template(vin) vector<int>;
  2091. *** POTENTIAL INCOMPATIBILITY ***
  2092. 2017-08-16: wsfulton
  2093. Fix scope lookup for template parameters containing unary scope operators.
  2094. Fixes cases like:
  2095. namespace Alloc {
  2096. template<typename T> struct Rebind {
  2097. typedef int Integer;
  2098. };
  2099. }
  2100. %template(RebindBucket) Alloc::Rebind< Bucket >;
  2101. OR
  2102. %template(RebindBucket) Alloc::Rebind< ::Bucket >;
  2103. Alloc::Rebind< Bucket >::Integer Bucket1();
  2104. Alloc::Rebind< ::Bucket >::Integer Bucket2();
  2105. Alloc::Rebind<::template TemplateBucket<double>>::Integer Bucket3();
  2106. 2017-08-16: wsfulton
  2107. For templates only, the template parameters are fully resolved when
  2108. handling typemaps. Without this, it is too hard to have decent rules
  2109. to apply typemaps when parameter types are typedef'd and template
  2110. parameters have default values.
  2111. Fixes %clear for typedefs in templates, eg:
  2112. %typemap("in") XXX<int>::Long "..."
  2113. template typename<T> struct XXX {
  2114. typedef long Long;
  2115. };
  2116. %clear XXX<int>::Long;
  2117. as the typemap was previously incorrectly stored as a typemap for long
  2118. instead of XXX<int>::Long.
  2119. 2017-08-05: olly
  2120. [C++11] Allow static_assert at the top level (and disallow it right
  2121. after template<T>). Fixes issue 1031 reported by Artem V L.
  2122. 2017-08-02: wsfulton
  2123. Fix incorrectly shown warning when an empty template instantiation was used on a
  2124. class used as a base class and that base class was explicitly ignored with %ignore.
  2125. Example of the warning which will no longer appear:
  2126. Warning 401: Base class 'Functor< int,int >' has no name as it is an empty
  2127. template instantiated with '%template()'. Ignored.
  2128. 2017-07-17: fflexo
  2129. [Java] #674 Add std_list.i to add support for std::list containers. The Java proxy
  2130. extends java.util.AbstractSequentialList and makes the C++ std::list container look
  2131. and feel much like a java.util.LinkedList from Java.
  2132. 2017-07-07: wsfulton
  2133. [Python] Fix display of documented template types when using the autodoc
  2134. feature. For example when wrapping:
  2135. %feature("autodoc");
  2136. template<typename X> struct T {};
  2137. %template(TInteger) T<int>;
  2138. the generated documentation contains:
  2139. """Proxy of C++ T< int > class."""
  2140. instead of:
  2141. """Proxy of C++ T<(int)> class."""
  2142. and
  2143. """__init__(TInteger self) -> TInteger"""
  2144. instead of
  2145. """__init__(T<(int)> self) -> TInteger"""
  2146. 2017-06-27: nihaln
  2147. [PHP] Update the OUTPUT Typemap to add return statement to the
  2148. PHP Wrapper.
  2149. 2017-06-27: nihaln
  2150. [PHP] Update the enum and value examples to use the OO wrappers
  2151. rather than the flat functions produced with -noproxy. There's
  2152. not been a good reason to use -noproxy for since PHP5 OO wrapping
  2153. was fixed back in 2005.
  2154. 2017-06-23: m7thon
  2155. [Python] fix and improve default argument handling:
  2156. 1. Fix negative octals. Currently not handled correctly by `-py3`
  2157. (unusual case, but incorrect).
  2158. 2. Fix arguments of type "octal + something" (e.g. `0640 | 04`).
  2159. Currently drops everything after the first octal. Nasty!
  2160. 3. Fix bool arguments "0 + something" (e.g. `0 | 1`) are always
  2161. "False" (unusual case, but incorrect).
  2162. 4. Remove special handling of "TRUE" and "FALSE" from
  2163. `convertValue` since there's no reason these have to match
  2164. "true" and "false".
  2165. 5. Remove the Python 2 vs. Python 3 distinction based on the
  2166. `-py3` flag. Now the same python code is produced for default
  2167. arguments for Python 2 and Python 3. For this, octal default
  2168. arguments, e.g. 0644, are now wrapped as `int('644', 8)`. This
  2169. is required, as Python 2 and Python 3 have incompatible syntax
  2170. for octal literals.
  2171. Fixes #707
  2172. 2017-06-21: futatuki
  2173. #1004 - Fix ccache-swig executable name to respect configure's --program-prefix and
  2174. --program-suffix values if used.
  2175. 2017-06-21: tamuratak
  2176. [Ruby] #911 - Add std::wstring support.
  2177. 2017-06-19: wsfulton
  2178. [Python] Fix handling of rich comparisons when wrapping overloaded operators:
  2179. operator< operator<= operator> operator>= operator== operator!=
  2180. Previously a TypeError was always thrown if the type was not correct. NotImplemented
  2181. is now returned from these wrapped functions if the type being compared with is
  2182. not correct. The subsequent behaviour varies between different versions of Python
  2183. and the comparison function being used, but is now consistent with normal Python
  2184. behaviour. For example, for the first 4 operator overloads above, a TypeError
  2185. 'unorderable types' is thrown in Python 3, but Python 2 will return True or False.
  2186. NotImplemented should be returned when the comparison cannot be done, see PEP 207 and
  2187. https://docs.python.org/3/library/constants.html#NotImplemented
  2188. Note that the bug was only present when overloaded operators did not also have a
  2189. function overload.
  2190. Fixes SF bug #1208 (3441262) and SF patch #303.
  2191. *** POTENTIAL INCOMPATIBILITY ***
  2192. 2017-06-17: fabrice102
  2193. [Go] Fix Go callback example. Fixes github #600, #955, #1000.
  2194. 2017-06-16: wsfulton
  2195. Make sure warning and error messages are not split up by other processes writing to
  2196. stdout at the same time.
  2197. 2017-06-16: wsfulton
  2198. [R] Fix wrapping function pointers containing rvalue and lvalue reference parameters.
  2199. 2017-06-13: olly
  2200. [Perl] Fix testsuite to work without . in @INC - it was removed in
  2201. Perl 5.26 for security reasons, and has also been removed from
  2202. older versions in some distros. Fixes #997 reported by lfam.
  2203. 2017-06-03: wsfulton
  2204. Fix %import on a file containing a file scope %fragment forced inclusion to not
  2205. generate the fragment contents as %import should not result in code being generated.
  2206. The behaviour is now the same as importing code insertion blocks.
  2207. Wrapping FileC.i in the following example will result in no generated code, whereas
  2208. previously "#include <limits.h>" was generated:
  2209. // FileA.i
  2210. %fragment("<limits.h>", "header") %{
  2211. #include <limits.h>
  2212. %}
  2213. %{
  2214. #include <stdio.h>
  2215. %}
  2216. %fragment("<limits.h>");
  2217. // FileC.i
  2218. %import "FileA.i"
  2219. *** POTENTIAL INCOMPATIBILITY ***
  2220. 2017-05-26: Volker Diels-Grabsch, vadz
  2221. [Java] #842 Extend from java.util.AbstractList<> and implement java.util.RandomAccess for
  2222. std::vector wrappers. This notably allows to iterate over wrapped vectors in a natural way.
  2223. Note that boxed types are now used in the Java layer when wrapping vector of C primitive
  2224. types, for example. This may introduce some subtle incompatibilities due to some
  2225. differences in how Java converts boxed types and unboxed types. For example,
  2226. int i=0;
  2227. double d1 = i; // ok
  2228. Double d2 = i; // error: incompatible types: int cannot be converted to Double
  2229. This can be a problem when calling the add and set functions. A suggested backwards
  2230. compatible workaround is to use something like (shown for std::vector<double>:
  2231. #if defined(SWIGJAVA)
  2232. // Add in old api that uses non-boxed types
  2233. %extend std::vector<double> {
  2234. %proxycode %{
  2235. public void add(double x) {
  2236. add(Double.valueOf(x));
  2237. }
  2238. public void set(int i, double val) {
  2239. set(i, Double.valueOf(val));
  2240. }
  2241. %}
  2242. }
  2243. #endif
  2244. %include "std_vector.i"
  2245. %template(VectorDouble) std::vector<double>;
  2246. *** POTENTIAL INCOMPATIBILITY ***
  2247. 2017-05-30: davidcl
  2248. [Scilab] #994 Undefined symbol error when loading in Scilab 6
  2249. 2017-05-25: asibross
  2250. [Java] #370 #417 Missing smart pointer handling in Java director extra methods
  2251. swigReleaseOwnership() and swigTakeOwnership().
  2252. 2017-05-23: wsfulton
  2253. [Java] #230 #759 Fix Java shared_ptr and directors for derived classes java compilation
  2254. error.
  2255. For shared_ptr proxy proxy classes, add a protected method swigSetCMemOwn for modifying
  2256. the swigCMemOwn and swigCMemOwnDerived member variables which are used by various other
  2257. methods for controlling memory ownership.
  2258. 2017-05-21: Sghirate
  2259. [Java, C#, D] #449 Remove unnecessary use of dynamic_cast in directors to enable
  2260. non-RTTI compilation.
  2261. 2017-05-21: wsfulton
  2262. [Python] #993 Fix handling of default -ve unsigned values, such as:
  2263. void f(unsigned = -1U);
  2264. 2017-05-20: jschueller
  2265. [Python] #991 Fix E731 PEP8 warning: do not assign a lambda expression
  2266. 2017-05-16: nihal95
  2267. [PHP] Add %pragma version directive to allow the version of the
  2268. extension to be set. Patch #970, fixes #360.
  2269. 2017-05-13: yag00
  2270. Patch #975 - Add support for noexcept on director methods.
  2271. 2017-04-27: redbrain
  2272. Issue #974, Patch #976 - Fix preprocessor handling of macros with commas in a comment.
  2273. 2017-04-25: jleveque
  2274. [Lua] #959 - Fix Visual Studio C4244 conversion warnings in Lua wrappers.
  2275. 2017-04-21: tamuratak
  2276. [Ruby] #964 - Add shared_ptr director typemaps.
  2277. 2017-04-20: wsfulton
  2278. [Ruby] #586, #935 Add assert for invalid NULL type parameter when calling SWIG_Ruby_NewPointerObj.
  2279. 2017-04-20: tamuratak
  2280. [Ruby] #930, #937 - Fix containers of std::shared_ptr.
  2281. Upcasting, const types (eg vector<shared_ptr<const T>>) and NULL/nullptr support added.
  2282. 2017-04-12: smarchetto
  2283. [Scilab] New parameter targetversion to specify the Scilab target version (5, 6, ..) for code generation
  2284. With Scilab 6 target specified, identifier names truncation is disabled (no longer necessary)
  2285. 2017-03-24: tamuratak
  2286. [Ruby] Fix #939 - Wrapping std::vector<bool> fix due to incorrect null checks
  2287. on VALUE obj.
  2288. 2017-03-17: vadz
  2289. [C#] #947 Add support for std::complex<T>
  2290. 2017-03-17: wsfulton
  2291. [Go] Fix handling of typedef'd function pointers and typedef'd member function pointers
  2292. such as:
  2293. typedef int (*FnPtr_td)(int, int);
  2294. int do_op(int x, int y, FnPtr_td op);
  2295. 2017-03-16: wsfulton
  2296. Add support for member const function pointers such as:
  2297. int fn(short (Funcs::* parm)(bool)) const;
  2298. Also fix parsing of references/pointers and qualifiers to member
  2299. pointers such as:
  2300. int fn(short (Funcs::* const parm)(bool));
  2301. int fn(short (Funcs::* & parm)(bool));
  2302. 2017-03-10: wsfulton
  2303. Extend C++11 alternate function syntax parsing to support const and noexcept, such as:
  2304. auto sum1(int x, int y) const -> int { return x + y; }
  2305. auto sum2(int x, int y) noexcept -> int { return x + y; }
  2306. 2017-02-29: tamuratak
  2307. [Ruby] #917 - Add Enumerable module to all container class wrappers. It was missing
  2308. for std::list, std::multiset, std::unordered_multiset and std::unordered_map.
  2309. 2017-02-27: assambar
  2310. [C++11] Extend parser to support throw specifier in combination
  2311. with override and/or final.
  2312. 2017-02-10: tamuratak
  2313. [Ruby] #883 - Add support for C++11 hash tables:
  2314. std::unordered_map
  2315. std::unordered_set
  2316. std::unordered_multimap
  2317. std::unordered_multiset
  2318. 2017-02-08: jcsharp
  2319. [C#] #887 Improve std::vector<T> wrapper constructors -
  2320. Replace constructor taking ICollection with IEnumerable and also add IEnumerable<T>
  2321. constructor to avoid the boxing and unboxing overhead of the original constructor,
  2322. when the type parameter is a value type.
  2323. Version 3.0.12 (27 Jan 2017)
  2324. ============================
  2325. 2017-01-27: wsfulton
  2326. [C#] #882 Fix missing filename in error messages when there is a problem
  2327. writing out C# files.
  2328. 2017-01-27: briancaine
  2329. [Guile] #744 Fix compilation errors in Guile wrappers - regression
  2330. introduced in swig-3.0.11.
  2331. 2017-01-24: andrey-starodubtsev
  2332. [Java] Apply #704 - director typemap improvements.
  2333. Memory leak fixes, add support for "directorargout" typemap and
  2334. add director support to typemaps.i.
  2335. 2017-01-24: wsfulton
  2336. Enhance %extend to extend a class with template constructors, eg:
  2337. struct Foo {
  2338. %extend {
  2339. template<typename T>
  2340. Foo(int a, T b) {
  2341. ...
  2342. }
  2343. }
  2344. };
  2345. %template(Foo) Foo::Foo<double>;
  2346. 2017-01-22: wsfulton
  2347. Issue #876 Enhance %extend to extend a class with template methods, eg:
  2348. struct Foo {
  2349. %extend {
  2350. template<typename T>
  2351. void do_stuff(int a, T b) {
  2352. ...
  2353. }
  2354. }
  2355. };
  2356. %template(do_stuff_inst) Foo::do_stuff<double>;
  2357. Similarly for static template methods.
  2358. 2017-01-22: kwwette
  2359. [Octave] add support for version 4.2
  2360. - The Octave API now uses some C++11 features. It is recommended to use
  2361. the mkoctfile program supplied by Octave to compile the SWIG-generated
  2362. wrapper code, as mkoctfile will ensure the correct C++ compiler/options
  2363. are used. Otherwise, the value of `mkoctfile -p CXX` should be parsed
  2364. for any -std=* flags which might be present.
  2365. - Octave has dropped support for << and >> operators, so SWIG now
  2366. ignores them.
  2367. - The Octave error() function now raises C++ exceptions to propagate
  2368. Octave errors, so %exception directives may need to be modified.
  2369. For convenience the SWIG_RETHROW_OCTAVE_EXCEPTIONS macro can be used
  2370. to rethrow any Octave exceptions for Octave itself to handle, e.g.:
  2371. try {
  2372. $action // may call error()
  2373. }
  2374. SWIG_RETHROW_OCTAVE_EXCEPTIONS // error() exceptions are rethrown
  2375. catch(...) {
  2376. ... // all other exceptions
  2377. }
  2378. *** POTENTIAL INCOMPATIBILITY ***
  2379. 2017-01-16: wkalinin
  2380. [C#] Fix #733 regression introduced in swig-3.0.9.
  2381. Missing virtual function override in C# layer when using %import.
  2382. 2017-01-16: fschlimb
  2383. Fix #813 template symbol name lookup bug when typedef names are the same but in different
  2384. namespaces.
  2385. 2017-01-15: wsfulton
  2386. [C# D Java]
  2387. The SWIG library no longer uses the javatype, dtype or cstype typemaps, thereby
  2388. completely freeing them up for users to use without having to replicate the library
  2389. code that they previously added. The code previously generated by these typemaps
  2390. has been replaced by the new %proxycode directive. Their use in the library code
  2391. was fairly minimal:
  2392. C# cstype: std_array.i std_map.i std_vector.i
  2393. D dtype: std_vector.i
  2394. Java javatype: arrays_java.i
  2395. 2017-01-14: wsfulton
  2396. The %extend directive can now optionally support one of the 'class', 'struct' or 'union'
  2397. keywords before the identifier name, for example:
  2398. struct X { ... };
  2399. %extend struct X { ... }
  2400. Previously this had to specified as:
  2401. struct X { ... };
  2402. %extend X { ... }
  2403. 2017-01-13: wsfulton
  2404. [C# D Java] Add new %proxycode directive which is a macro for %insert("proxycode").
  2405. This is a way of adding pure C#/D/Java code into the appropriate proxy class, eg:
  2406. %extend Proxy2 {
  2407. %proxycode %{
  2408. public int proxycode2(int i) {
  2409. return i+2;
  2410. }
  2411. %}
  2412. }
  2413. %inline %{
  2414. struct Proxy2 {};
  2415. %}
  2416. There will then be a pure Java/C#/D method called proxycode2 in the Proxy2 class.
  2417. 2016-12-31: ajrheading1
  2418. Issue #860 - Remove use of std::unary_function and std::binary_function
  2419. which is deprecated in C++11.
  2420. 2016-12-30: olly
  2421. [PHP7] Register internal 'swig_runtime_data_type_pointer' constant
  2422. as "CONST_PERSISTENT" to avoid segmentation fault on module unload.
  2423. Fixes #859 reported by Timotheus Pokorra. Thanks also to Javier Torres
  2424. for a minimal reproducer.
  2425. Version 3.0.11 (29 Dec 2016)
  2426. ============================
  2427. 2016-12-24: wsfulton
  2428. [C#] Add %feature("csdirectordelegatemodifiers") to enable customization
  2429. of the delegate access modifiers generated in director classes.
  2430. Fixes issue #748.
  2431. 2016-12-23: wsfulton
  2432. [Python] Fix builtin "python:slot" feature failing for tp_hash when using
  2433. hashfunc closure with a "Wrong type for hash function" for Python 2.
  2434. Issue #843.
  2435. 2016-12-21: joequamt
  2436. Changed generation of functions so that only functions
  2437. that end in _set generate accessor functions rather than
  2438. looking for "set".
  2439. Change generation of operators to not have underscores
  2440. to start in R. Users need to provide custom names for these operator overloads.
  2441. 2016-12-21: olly
  2442. Fix isfinite() checks to work with all C++11 compilers.
  2443. Fixes issues #615, #788 and #849.
  2444. 2016-12-20: wsfulton
  2445. %namewarn unnecessarily caused keyword warnings for non-instantiated template classes
  2446. and duplicate warnings for instantiated template classes when keywords were used.
  2447. Issue #845.
  2448. 2016-12-18: ezralanglois
  2449. [Python, Ruby, Octave] Memory leak fix on error in std::pair wrappers.
  2450. Issue #851.
  2451. 2016-12-18: wsfulton
  2452. Zero initialize arrays when using %array_class and %array_functions.
  2453. 2016-12-18: t-ikegami
  2454. [Python] Fix #446
  2455. Python %array_class of carrays.i failed with -builtin option.
  2456. 2016-12-16: briancaine
  2457. [Guile] Patch #744 Added support for Guile's native pointer functionality
  2458. 2016-12-01: wsfulton
  2459. [Python] Issue #769.
  2460. Add optional moduleimport attribute to %module so that the
  2461. default module import code can be overridden. See the "Searching for the wrapper module"
  2462. documentation in Python.html. Example:
  2463. %module(moduleimport="import _foo") foo
  2464. $module also expands to the low-level C/C++ module name, so the following is the
  2465. same as above
  2466. %module(moduleimport="import $module") foo
  2467. 2016-11-30: olly
  2468. [PHP] Add support for PHP7. PHP5's C extension API has changed
  2469. substantially so you need to use -php7 to specify you want PHP7
  2470. compatible wrappers. The default extension for generated wrappers
  2471. is now .cxx (to match SWIG's default for every other language - to
  2472. generate foo_wrap.cpp you can run SWIG with -cppext cpp). Fixes
  2473. issue #571.
  2474. As part of this change, the language subdirectory for PHP5 has
  2475. changed from "php" to "php5" - if you are making use of the search
  2476. path feature where the language subdirectory of each directory
  2477. is also searched, you'll need to update your bindings. A simple
  2478. fix which works for older and newer SWIG is to add a symlink:
  2479. ln -s php php5
  2480. *** POTENTIAL INCOMPATIBILITY ***
  2481. 2016-11-30: olly
  2482. [PHP] Only emit one copy of each distinct arginfo. Previously we
  2483. emitted a separate one for every wrapped function, but typically
  2484. many functions have the same number of parameters and combinations
  2485. of parameters passed by reference or not.
  2486. This change significantly reduces both the size of the generated
  2487. wrapper, and of the compiled PHP extension module (e.g. by ~6% for
  2488. the stripped extension module for Xapian's PHP7 bindings).
  2489. 2016-11-28: wsfulton
  2490. Fix %rename override of wildcard %rename for templates. For example:
  2491. %rename(GlobalIntOperator) *::operator bool; // wildcard %rename
  2492. %rename(XIntOperator) X::operator bool; // fix now overrides first %rename above
  2493. OR
  2494. %rename(XIntOperator) X<int>::operator bool; // fix now overrides first %rename above
  2495. template<typename T> struct X {
  2496. operator bool();
  2497. ...
  2498. };
  2499. %template(Xint) X<int>;
  2500. This also fixes %rename override of global %rename for templates. For example:
  2501. // Global rename to make all functions start with a lower case letter
  2502. %rename("%(firstlowercase)s", %$isfunction ) "";
  2503. %rename(woohoo) W::Woo; // fix now overrides above %rename
  2504. template<typename T> struct W {
  2505. W Woo();
  2506. ...
  2507. };
  2508. %template(Wint) W<int>;
  2509. The above also introduces a possibly unexpected change. Many of the STL containers
  2510. provided by SWIG use %rename to rename some methods, eg in std::vector, push_back
  2511. is renamed to add in Java. Previously this intended rename did not happen when using
  2512. using global %rename rules and the method would remain as push_back, but is now
  2513. renamed to add. Some more info in issue #856.
  2514. *** POTENTIAL INCOMPATIBILITY ***
  2515. 2016-11-26: m7thon
  2516. [Python] Issue #709 - improved wrapping of division operators
  2517. 'from __future__ import division' now works in Python 2 whether or not the
  2518. -py3 flag is used.
  2519. 2016-11-12: joequant
  2520. [R] Issue #697 - fix comma issue with overload methods
  2521. 2016-11-12: joequant
  2522. [R] Issue #555 - R runtime needs stdio.h
  2523. 2016-11-02: wsfulton
  2524. [Python] Issue #816 - fix compilation error when using -extranative and -builtin.
  2525. 2016-11-02: liorgold
  2526. Patch #741 - Add support for C++11 alias templates, see updated CPlusPlus11.html
  2527. documentation.
  2528. 2016-10-30: myd7349
  2529. [C#] Patch #740 Add std_array.i for C# for wrapping std::array.
  2530. Patch also enhances std::vector<std::wstring> C# wrappers with additional functions
  2531. (Contains, IndexOf, LastIndexOf and Remove).
  2532. 2016-10-30: tobilau
  2533. [Java] Fix wrappers for wstring parameters in director methods to cleanup local
  2534. ref after director callback has finished.
  2535. 2016-10-23: wsfulton
  2536. [C#] Add missing csdirectorin VOID_INT_PTR and csdirectorout VOID_INT_PTR typemaps.
  2537. 2016-10-23: jiulongw
  2538. Patch #781 - Fix wrapping of C compound expressions containing char constants
  2539. in quotes such as:
  2540. #define H_SUPPRESS_SCALING_MAGIC (('s'<<24) | ('u'<<16) | ('p'<<8) | 'p')
  2541. enum DifferentTypes {
  2542. typecharcompound='A'+1,
  2543. typecharcompound2='B' << 2
  2544. };
  2545. 2016-10-13: wsfulton
  2546. [Python] Issue #808 - fix Python pickling and metaclass for builtin wrappers.
  2547. The metaclass (SwigPyObjectType) for SWIG objects was not defined in
  2548. a way that let importlib successfully import the Python wrappers.
  2549. The pickle module previously failed to pickle objects because it couldn't
  2550. determine what module the SWIG wrapped objects were in.
  2551. 2016-09-29: wsfulton
  2552. [Allegrocl, CFFI, GO, Javascript, Ocaml, R, Scilab]
  2553. Add missing support for the "ret" typemap in a few target languages.
  2554. The documentation also now has info on the "ret" typemap.
  2555. 2016-09-27: ahmed-usman
  2556. [xml] Handle template parameters correctly.
  2557. 2016-09-27: dontpanic92
  2558. [Go] Fix argument names in inherited functions taking more than 8
  2559. parameters. Fixes #795.
  2560. 2016-09-26: smarchetto
  2561. [Scilab] mlists that map pointers can be given a custom type name.
  2562. 2016-09-25: wsfulton
  2563. Patch #793 from q-p to expand exception handling to include std::bad_cast
  2564. in std_except.i.
  2565. 2016-09-24: olly
  2566. [PHP] Fix code generated for feature("director:except") -
  2567. previously the return value of call_user_function() was ignored and
  2568. we checked an uninitialised value instead. Fixes #627. Based on
  2569. patch from Sergey Seroshtan.
  2570. 2016-09-22: wsfulton
  2571. [Python] More flexible python builtin slots for overloaded C++ function.
  2572. The closure names used for builtin slots are mangled with their functype so
  2573. that overloaded C++ method names can be used for multiple slots.
  2574. For example:
  2575. %feature("python:slot", "mp_subscript", functype="binaryfunc") SimpleArray::__getitem__;
  2576. %feature("python:slot", "sq_item", functype="ssizeargfunc") SimpleArray::__getitem__(Py_ssize_t n);
  2577. will generate closures:
  2578. SWIGPY_SSIZEARGFUNC_CLOSURE(_wrap_SimpleArray___getitem__) /* defines _wrap_SimpleArray___getitem___ssizeargfunc_closure */
  2579. SWIGPY_BINARYFUNC_CLOSURE(_wrap_SimpleArray___getitem__) /* defines _wrap_SimpleArray___getitem___binaryfunc_closure */
  2580. Previously only one name was defined: _wrap_SimpleArray___getitem___closure.
  2581. Hence the overloaded __getitem__ method can be used to support both mp_subscript and sq_item slots.
  2582. 2016-09-17: wsfulton
  2583. [Python] Fix iterators for containers of NULL pointers (or Python None) when using
  2584. -builtin. Previously iteration would stop at the first element that was NULL.
  2585. 2016-09-16: olly
  2586. [Javascript] Fix SWIG_exception() macro to return from the current
  2587. function. Fixes #789, reported by Julien Dutriaux.
  2588. 2016-09-16: olly
  2589. [PHP] Fix SWIG_exception() macro to return from the current function.
  2590. Fixes #240, reported by Sergey Seroshtan.
  2591. 2016-09-12: xypron
  2592. [C#] Patch #786 Keyword rename to be CLS compliant by adding an underscore
  2593. suffix instead of an underscore prefix to the C symbol name. Please use an explicit
  2594. %rename to rename the symbol with a _ prefix if you want the old symbol name.
  2595. *** POTENTIAL INCOMPATIBILITY ***
  2596. 2016-09-09: olly
  2597. [Python] Fix import handling for Python 2.6 to work in a frozen
  2598. application. Fixes #145, reported by Thomas Kluyver.
  2599. 2016-09-02: smarchetto
  2600. [Scilab] Pointers are mapped to mlist instead of tlist
  2601. (mlist better for scilab overloading)
  2602. 2016-09-02: olly
  2603. [PHP] Fix "out" typemap for member function pointers and "in"
  2604. typemap for char INPUT[ANY].
  2605. 2016-09-01: wsfulton
  2606. [Python] More efficient Python slicing.
  2607. Call reserve for container types that support it to avoid repeated
  2608. memory reallocations for new slices or slices that grow in size.
  2609. 2016-09-01: wsfulton
  2610. [Python] #771 - Make builtin types hashable by default.
  2611. Default hash is the underlying C/C++ pointer. This matches up with testing for
  2612. equivalence (Py_EQ in SwigPyObject_richcompare) which compares the pointers.
  2613. 2016-08-22: wsfulton
  2614. [Python] The following builtin slots can be customized like other slots via the
  2615. "python:<x>" and "python:slot" features where <x> is the appropriate slot name:
  2616. tp_allocs
  2617. tp_bases
  2618. tp_basicsize
  2619. tp_cache
  2620. tp_del
  2621. tp_dealloc
  2622. tp_flags
  2623. tp_frees
  2624. tp_getset
  2625. tp_is_gc
  2626. tp_maxalloc
  2627. tp_methods
  2628. tp_mro
  2629. tp_new
  2630. tp_next
  2631. tp_prev
  2632. tp_richcompare
  2633. tp_subclasses
  2634. tp_weaklist
  2635. was_sq_ass_slice
  2636. was_sq_slice
  2637. A few documentation improvements for slot customization.
  2638. 2016-08-09: joequant
  2639. [R] Patch #765 Fix extern "C" header includes for C++ code.
  2640. 2016-08-05: olly
  2641. [xml] Fix how the output filename is built to avoid problems when
  2642. it contains the embedded strings ".c", ".cpp" or ".cxx".
  2643. Fixes #540 reported by djack42.
  2644. 2016-07-01: wsfulton
  2645. Fix corner case of wrapping std::vector of T pointers where a pointer to a pointer of T
  2646. also exists in the wrapped code. SF Bug 2359417 (967).
  2647. 2016-06-26: wkalinin
  2648. [Java, C#] Patch #681 Fix seg fault when ignoring nested classes.
  2649. 2016-06-25: mromberg
  2650. [Python] #711 Fix -castmode and conversion of signed and unsigned integer types.
  2651. See 2015-12-23 CHANGES entry for details of these improvements when they were
  2652. implemented for the default options (ie not using -castmode).
  2653. 2016-06-25: ahnolds
  2654. Patch #730 - Fix %implicitconv for overloaded functions when using
  2655. -castmode or -fastdispatch options.
  2656. The result is that in all overload cases where there are multiple possibilities
  2657. with the same number of arguments, the dispatch function will first check for
  2658. exact (aka non implicit) matches, and then subsequently check for implicit
  2659. casting matches. This was already happening in the normal dispatch situation,
  2660. and in the -fastdispatch case two passes through the candidates were happening,
  2661. just with SWIG_POINTER_IMPLICIT_CONV always set. After this patch, it is not set
  2662. on the first pass, and then set on the second pass.
  2663. 2016-06-25: liorgold
  2664. Patch #727 - Add support for C++11 type aliasing.
  2665. Version 3.0.10 (12 Jun 2016)
  2666. ============================
  2667. 2016-06-06: mromberg
  2668. [Python] Patch #698. Add support for -relativeimport for python 2.7, so -py3 is no
  2669. longer also required for relative import support.
  2670. 2016-06-05: mromberg
  2671. [Python] Patch #694 - Fix package import regressions introduced in swig-3.0.9.
  2672. 1) The code in 3.0.9 did not fall back to 'import _foo' if 'import bar._foo' failed
  2673. (assuming bar.foo was the main module). Every place _foo is imported now first tries
  2674. it from the package where foo was found and if that fails tries _foo as a global module.
  2675. 2) The separate block of Python code that injected code to pull in the attributes
  2676. from _foo when -builtin is used made use of the -py3 switch to either do
  2677. 'from ._foo import *' or "from _foo import *". This block of code no longer does this
  2678. and instead checks the Python version at runtime to switch between the two syntaxes.
  2679. In summary, swig-3.0.10 has been modified to ease the creation of wrapper modules
  2680. that can be fully made part of a Python package. SWIG no longer
  2681. assumes the dynamically linked C module is a global module.
  2682. The dynamic module can now be placed into either the same package as the pure Python
  2683. module or as a global module. Both locations are used by the Python wrapper to
  2684. locate the C module.
  2685. However, this could cause a backwards incompatibility with some code
  2686. that was relying on the ability of "from package import _module" to
  2687. pull attributes out of the package directly. If your code populates a
  2688. module (which is also a package) with attributes that are SWIG
  2689. generated modules which were not loaded in a conventional way,
  2690. swig-3.0.8 and earlier may have worked due to 'from package import
  2691. _module' bypassing a real import and pulling your module in as an
  2692. attribute. This will no longer work. Since this is not a common (or
  2693. even recommended) practice, most folk should not be affected.
  2694. *** POTENTIAL INCOMPATIBILITY ***
  2695. 2016-05-31: wsfulton
  2696. Fix #690 - Smart pointer to %ignored class doesn't expose inherited methods.
  2697. Regression introduced in swig-3.0.9.
  2698. Version 3.0.9 (29 May 2016)
  2699. ===========================
  2700. 2016-05-24: mromberg
  2701. [Python] Patch #612 - Add support for Python's implicit namespace packages.
  2702. 2016-05-23: wsfulton
  2703. [Ruby] Fix #602 - Error handling regression of opaque pointers introduced
  2704. in swig-3.0.8 when C functions explicitly reset a pointer using 'DATA_PTR(self) = 0'.
  2705. An ObjectPreviouslyDeleted error was incorrectly thrown when the pointer was used
  2706. as a parameter.
  2707. 2016-05-17: tamuratak
  2708. [Ruby] Patch #651 - Correct overloaded function error message when function is
  2709. using %newobject.
  2710. 2016-05-17: aurelj
  2711. [Ruby] Patch #582 - add support for docstring option in %module()
  2712. 2016-05-14: wsfulton
  2713. Fix #434 - Passing classes by value as parameters in director methods did not create
  2714. a copy of the argument leading to invalid memory accesses if the object was used
  2715. after the upcall into the target language. Passing arguments by value shouldn't give
  2716. rise to these sorts of memory problems and so the objects are now copied and ownership
  2717. of their lifetime is controlled by the target language.
  2718. 2016-05-07: wsfulton
  2719. Fix #611. Fix assertion handling defaultargs when using %extend for a template
  2720. class and the extended methods contain default arguments.
  2721. 2016-05-05: ejulian
  2722. [Python] Patch #617. Fix operator/ wrappers.
  2723. 2016-05-02: wsfulton
  2724. Fix #669. Don't issue warning about ignoring base classes when the derived class is
  2725. itself ignored.
  2726. 2016-04-18: ianlancetaylor
  2727. [Go] Fix use of goout typemap when calling base method by
  2728. forcing the "type" attribute to the value we need.
  2729. 2016-04-17: ianlancetaylor
  2730. [Go] Fixes for Go 1.6: avoid returning Go pointers from
  2731. directors that return string values; add a trailing 0 byte
  2732. when treating Go string as C char*.
  2733. 2016-04-06: smarchetto
  2734. [Scilab] #552 Make Scilab runtime keep track of pointer types
  2735. Instead of a Scilab pointer which has no type, SWIG Scilab maps a
  2736. pointer to a structure tlist containing the pointer adress and its type.
  2737. 2016-04-02: ahnolds
  2738. [Python] Apply #598. Fix misleading error message when attempting to read a non-existent
  2739. attribute. The previous cryptic error message:
  2740. AttributeError: type object 'object' has no attribute '__getattr__'
  2741. is now replaced with one mentioning the attribute name, eg:
  2742. AttributeError: 'Foo' object has no attribute 'bar'
  2743. 2016-04-02: derkuci
  2744. [Python] Patch #610 to fix #607.
  2745. Fix single arguments when using python -builtin -O with %feature("compactdefaultargs")
  2746. 2016-03-31: wsfulton
  2747. Fixes #594. Fix assertion for some languages when wrapping a C++11 enum class that
  2748. is private in a class.
  2749. Also don't wrap private enums for a few languages that attempted to do so.
  2750. 2016-03-31: wsfulton
  2751. [Java] unsigned long long marshalling improvements when a negative number
  2752. is passed from Java to C. A cast to signed long long in the C layer will now
  2753. result in the expected value. No change for positive numbers passed to C.
  2754. Fixes #623.
  2755. 2016-03-22: alexwarg
  2756. [Lua] #398 Fix lua __getitem + inheritance
  2757. The new handling of classes in Lua (not merging methods into the derived classes)
  2758. breaks for classes that provide a __getitem function. The __getitem function
  2759. prevents method calls to any method defined in a base class. This fix calls
  2760. __getitem only if the member is not found using recursive lookup.
  2761. 2016-03-18: ptomulik
  2762. [Python] #563 Stop generating unnecessary _swigconstant helpers.
  2763. 2016-03-16: richardbeare
  2764. [R] #636 Add extra std::vector numeric types
  2765. 2016-03-14: wsfulton
  2766. [Java] Add std_array.i for C++11 std::array support.
  2767. 2016-03-12: wsfulton
  2768. [Java, C#, D] Fix static const char member variables wrappers with %javaconst(1)
  2769. %csconst(1) or %dmanifestconst.
  2770. This fixes the case when an integer is used as the initializer, such as:
  2771. struct W { static const char w = 100; };
  2772. Fix generated code parsing enum values using char escape sequences
  2773. when these values appear in the Java code (usually when using %javaconst(1))
  2774. such as:
  2775. enum X { x1 = '\n', x2 = '\1' };
  2776. Similarly for static const member char variables such as:
  2777. struct Y { static const char y = '\n'; }
  2778. Likewise for D and %dmanifestconstant. For C# and %csconst(1), char
  2779. values in C# are now hex escaped as C# doesn't support C octal escaping.
  2780. 2016-03-11: wsfulton
  2781. [Java C#] Add support for treating C++ base classes as Java interfaces
  2782. instead of Java proxy classes. This enable some sort of support for
  2783. multiple inheritance. The implementation is in swiginterface.i and
  2784. provides additional macros (see Java.html for full documentation):
  2785. %interface(CTYPE)
  2786. %interface_impl(CTYPE)
  2787. %interface_custom("PROXY", "INTERFACE", CTYPE)
  2788. 2016-03-01: wsfulton
  2789. Add rstrip encoder for use in %rename. This is like the strip encoder but
  2790. strips the symbol's suffix instead of the prefix. The example below
  2791. will rename SomeThingCls to SomeThing and AnotherThingCls to AnotherThing:
  2792. %rename("%(rstrip:[Cls])s") "";
  2793. class SomeThingCls {};
  2794. struct AnotherThingCls {};
  2795. 2016-03-01: olly
  2796. Fix isfinite() check to work with GCC6. Fixes
  2797. issue #615 reported by jplesnik.
  2798. 2016-02-17: olly
  2799. [Python] Add missing keywords 'as' and 'with' to pythonkw.swg.
  2800. 2016-02-07: kwwette
  2801. [Octave] recognise various unary functions
  2802. * Use __float__() for numeric conversions, e.g. when calling double()
  2803. * Map various unary functions, e.g. abs() to __abs__(), see full list
  2804. in section 32.3.10 of manual; only available in Octave 3.8.0 or later
  2805. 2016-02-07: kwwette
  2806. [Octave] export function swig_octave_prereq() for testing Octave version
  2807. 2016-02-06: pjohangustavsson
  2808. [C#] Fix duplicate symbol problems when linking the source generated
  2809. from multiple SWIG modules into one shared library for the -namespace
  2810. option. The namespace is now mangled into the global PInvoke function
  2811. names.
  2812. *** POTENTIAL INCOMPATIBILITY ***
  2813. 2016-01-27: ahnolds
  2814. [Python] Added support for differentiating between Python Bytes
  2815. and Unicode objects using by defining SWIG_PYTHON_STRICT_BYTE_CHAR
  2816. and SWIG_PYTHON_STRICT_UNICODE_WCHAR.
  2817. 2016-01-27: steeve
  2818. [Go] Ensure structs are properly packed between gc and GCC/clang.
  2819. 2016-01-25: ahnolds
  2820. [Python] Support the full Python test suite in -classic mode
  2821. * Convert long/unsigned long/long long/unsigned long long to PyInt
  2822. rather than PyLong when possible. Certain python functions like
  2823. len() require a PyInt when operating on old-style classes.
  2824. * Add support for static methods in classic mode, including support
  2825. for pythonappend, pythonprepend, and docstrings.
  2826. * Removing the use of __swig_getmethods__ for static member methods
  2827. since they will always be found by the standard argument lookup
  2828. * Fix a bug where the wrong type of exception was caught when
  2829. checking for new-style class support
  2830. 2016-01-23: ahnolds
  2831. [Go] Enable support for the Go test-suite on OSX:
  2832. * The linker on OSX requires that all symbols (even weak symbols)
  2833. are defined at link time. Because the function _cgo_topofstack is
  2834. only defined starting in Go version 1.4, we explicitly mark it as
  2835. undefined for older versions of Go on OSX.
  2836. * Avoid writing empty swigargs structs, since empty structs are not
  2837. allowed in extern "C" blocks.
  2838. 2016-01-12: olly
  2839. [Javascript] Look for "nodejs" as well as "node", as it's packaged
  2840. as the former on Debian.
  2841. 2016-01-12: olly
  2842. [Javascript] For v8 >= 4.3.0, use V8_MAJOR_VERSION.
  2843. Fixes issue 561.
  2844. 2016-01-10: ahnolds
  2845. Improved size_t and ptrdiff_t typemaps to support large values
  2846. on platforms where sizeof(size_t) > sizeof(unsigned long) and
  2847. sizeof(ptrdiff_t) > sizeof(long).
  2848. Version 3.0.8 (31 Dec 2015)
  2849. ===========================
  2850. 2015-12-30: wsfulton
  2851. The pdf documentation is now generated by wkhtmltopdf and has colour
  2852. for the code snippets just like the html documentation!
  2853. 2015-12-23: ahnolds
  2854. [Python] Fixes for conversion of signed and unsigned integer types:
  2855. No longer check for PyInt objects in Python3. Because PyInt_Check
  2856. and friends are #defined to the corresponding PyLong methods, this
  2857. had caused errors in Python3 where values greater than what could be
  2858. stored in a long were incorrectly interpreted as the value -1 with
  2859. the Python error indicator set to OverflowError. This applies to
  2860. both the conversions PyLong->long and PyLong->double.
  2861. Conversion from PyLong to long, unsigned long, long long, and
  2862. unsigned long long now raise OverflowError instead of TypeError in
  2863. both Python2 and Python3 for PyLong values outside the range
  2864. expressible by the corresponding C type. This matches the existing
  2865. behavior for other integral types (signed and unsigned ints, shorts,
  2866. and chars), as well as the conversion for PyInt to all numeric
  2867. types. This also indirectly applies to the size_t and ptrdiff_t
  2868. types, which depend on the conversions for unsigned long and long.
  2869. 2015-12-19: wsfulton
  2870. [Python] Python 2 Unicode UTF-8 strings can be used as inputs to char * or
  2871. std::string types if the generated C/C++ code has SWIG_PYTHON_2_UNICODE defined.
  2872. 2015-12-17: wsfulton
  2873. Issues #286, #128
  2874. Remove ccache-swig.1 man page - please use the CCache.html docs instead.
  2875. The yodl2man and yodl2html tools are no longer used and so SWIG no
  2876. longer has a dependency on these packages which were required when
  2877. building from git.
  2878. 2015-12-16: zturner/coleb
  2879. [Python] Fix Python3.5 interpreter assertions when objects are being
  2880. deleted due to an existing exception. Most notably in generators
  2881. which terminate using a StopIteration exception. Fixes #559 #560 #573.
  2882. If a further exception is raised during an object destruction,
  2883. PyErr_WriteUnraisable is used on this second exception and the
  2884. original exception bubbles through.
  2885. 2015-12-14: ahnolds/wsfulton
  2886. [Python] Add in missing initializers for tp_finalize,
  2887. nb_matrix_multiply, nb_inplace_matrix_multiply, ht_qualname
  2888. ht_cached_keys and tp_prev.
  2889. 2015-12-12: wsfulton
  2890. Fix STL wrappers to not generate <: digraphs.
  2891. For example std::vector<::X::Y> was sometimes generated, now
  2892. corrected to std::vector< ::X::Y >.
  2893. 2015-11-25: wsfulton
  2894. [Ruby] STL ranges and slices fixes.
  2895. Ruby STL container setting slices fixes:
  2896. Setting an STL container wrapper slice better matches the way Ruby
  2897. arrays work. The behaviour is now the same as Ruby arrays. The only
  2898. exception is the default value used when expanding a container
  2899. cannot be nil as this is not a valid type/value for C++ container
  2900. elements.
  2901. Obtaining a Ruby STL container ranges and slices fixes:
  2902. Access via ranges and slices now behave identically to Ruby arrays.
  2903. The fixes are mostly for out of range indices and lengths.
  2904. - Zero length slice requests return an empty container instead of nil.
  2905. - Slices which request a length greater than the size of the container
  2906. no longer chop off the last element.
  2907. - Ranges which used to return nil now return an empty array when the
  2908. the start element is a valid index.
  2909. Ruby STL container negative indexing support improved.
  2910. Using negative indexes to set values works the same as Ruby arrays, eg
  2911. %template(IntVector) std::vector<int>;
  2912. iv = IntVector.new([1,2,3,4])
  2913. iv[-4] = 9 # => [1,2,3,9]
  2914. iv[-5] = 9 # => IndexError
  2915. 2015-11-21: wsfulton
  2916. [Ruby, Python] Add std::array container wrappers.
  2917. These work much like any of the other STL containers except Python/Ruby slicing
  2918. is somewhat limited because the array is a fixed size. Only slices of
  2919. the full size are supported.
  2920. 2015-10-10: wsfulton
  2921. [Python] #539 - Support Python 3.5 and -builtin. PyAsyncMethods is a new
  2922. member in PyHeapTypeObject.
  2923. 2015-10-06: ianlancetaylor
  2924. [Go] Don't emit a constructor function for a director
  2925. class with an abstract method, since the function will
  2926. always panic.
  2927. 2015-10-01: wsfulton
  2928. Fix %shared_ptr support for private and protected inheritance.
  2929. - Remove unnecessary Warning 520: Derived class 'Derived' of 'Base'
  2930. is not similarly marked as a smart pointer
  2931. - Do not generate code that attempts to cast up the inheritance chain in the
  2932. type system runtime in such cases as it doesn't compile and can't be used.
  2933. Remove unnecessary warning 520 for %shared_ptr when the base class is ignored.
  2934. 2015-10-01: vkalinin
  2935. Fix #508: Fix segfault parsing anonymous typedef nested classes.
  2936. 2015-09-26: wsfulton
  2937. [Ruby] Add shared_ptr support
  2938. 2015-09-13: kkaempf
  2939. [Ruby] Resolve tracking bug - issue #225.
  2940. The bug is that the tracking code uses a ruby hash and thus may
  2941. allocate objects (Bignum) while running the GC. This was tolerated in
  2942. 1.8 but is invalid (raises an exception) in 1.9.
  2943. The patch uses a C hash (also used by ruby) instead.
  2944. 2015-09-09: lyze
  2945. [CFFI] Extend the "export" feature in the CFFI module to support
  2946. exporting to a specified package.
  2947. 2015-09-04: olly
  2948. [Python] Fix docstrings for %callback functions.
  2949. 2015-09-03: demi-rluddy
  2950. [Go] Removed golang stringing for signed/unsigned char
  2951. Changed default handling of signed char* and unsigned char* to be
  2952. opaque pointers rather than strings, similarly to how other
  2953. languages work.
  2954. Any existing code relying on treating signed char* or unsigned
  2955. char* as a string can restore the old behavior with typemaps.i by
  2956. using %apply to copy the [unchanged] char* behavior.
  2957. *** POTENTIAL INCOMPATIBILITY ***
  2958. 2015-08-07: talby
  2959. [Perl] tidy -Wtautological-constant-out-of-range-compare warnings when building generated code under clang
  2960. 2015-08-07: xantares
  2961. [Python] pep257 & numpydoc conforming docstrings:
  2962. - Mono-line module docsstring
  2963. - Rewrite autodoc parameters section in numpydoc style:
  2964. https://github.com/numpy/numpy/blob/master/doc/HOWTO_DOCUMENT.rst.txt
  2965. - One line summary should end with "."
  2966. - Adds a blank line after class docstring
  2967. 2015-08-05: vadz
  2968. [Java] Make (char* STRING, size_t LENGTH) typemaps usable for
  2969. strings of other types, e.g. "unsigned char*".
  2970. Version 3.0.7 (3 Aug 2015)
  2971. ==========================
  2972. 2015-08-02: wsfulton
  2973. [Java] Fix potential security exploit in generated Java classes.
  2974. The swigCPtr and swigCMemOwn member variables in the generated Java
  2975. classes are now declared 'transient' by default. Further details of the exploit
  2976. in Android is being published in an academic paper as part of USENIX WOOT '15:
  2977. https://www.usenix.org/conference/woot15/workshop-program/presentation/peles.
  2978. In the unlikely event that you are relying on these members being serializable,
  2979. then you will need to override the default javabody and javabody_derived typemaps
  2980. to generate the old generated code. The relevant typemaps are in the Lib directory
  2981. in the java.swg, boost_shared_ptr.i and boost_intrusive_ptr.i files. Copy the
  2982. relevant default typemaps into your interface file and remove the 'transient' keyword.
  2983. *** POTENTIAL INCOMPATIBILITY ***
  2984. 2015-08-01: vadz
  2985. Make configure --without-alllang option more useful: it can now be overridden by the following
  2986. --with-xxx options, allowing to easily enable just one or two languages.
  2987. 2015-07-30: wsfulton
  2988. Fix #440 - Initialise all newly created arrays when using %array_functions and %array_class
  2989. in the carrays.i library - bug is only relevant when using C++.
  2990. 2015-07-29: wsfulton
  2991. [Python] Improve indentation warning and error messages for code in the following directives:
  2992. %pythonprepend
  2993. %pythonappend
  2994. %pythoncode
  2995. %pythonbegin
  2996. %feature("shadow")
  2997. Old error example:
  2998. Error: Line indented less than expected (line 3 of pythoncode)
  2999. New error example:
  3000. Error: Line indented less than expected (line 3 of %pythoncode or %insert("python") block)
  3001. as no line should be indented less than the indentation in line 1
  3002. Old warning example:
  3003. Warning 740: Whitespace prefix doesn't match (line 2 of %pythoncode or %insert("python") block)
  3004. New warning example:
  3005. Warning 740: Whitespace indentation is inconsistent compared to earlier lines (line 3 of
  3006. %pythoncode or %insert("python") block)
  3007. 2015-07-28: wsfulton
  3008. [Python] Fix #475. Improve docstring indentation handling.
  3009. SWIG-3.0.5 and earlier sometimes truncated text provided in the docstring feature.
  3010. This occurred when the indentation (whitespace) in the docstring was less in the
  3011. second or later lines when compared to the first line.
  3012. SWIG-3.0.6 gave a 'Line indented less than expected' error instead of truncating
  3013. the docstring text.
  3014. Now the indentation for the 'docstring' feature is smarter and is appropriately
  3015. adjusted so that no truncation occurs.
  3016. 2015-07-22: wsfulton
  3017. Support for special variable expansion in typemap attributes. Example usage expansion
  3018. in the 'out' attribute (C# specific):
  3019. %typemap(ctype, out="$*1_ltype") unsigned int& "$*1_ltype"
  3020. is equivalent to the following as $*1_ltype expands to 'unsigned int':
  3021. %typemap(ctype, out="unsigned int") unsigned int& "unsigned int"
  3022. Special variables can be used within special variable macros too. Example usage expansion:
  3023. %typemap(cstype) unsigned int "uint"
  3024. %typemap(cstype, out="$typemap(cstype, $*1_ltype)") unsigned int& "$typemap(cstype, $*1_ltype)"
  3025. Special variables are expanded first and hence the above is equivalent to:
  3026. %typemap(cstype, out="$typemap(cstype, unsigned int)") unsigned int& "$typemap(cstype, unsigned int)"
  3027. which then expands to:
  3028. %typemap(cstype, out="uint") unsigned int& "uint"
  3029. 2015-07-22: lindleyf
  3030. Apply patch #439 - support for $typemap() (aka embedded typemaps or special variable
  3031. macros) in typemap attributes. A simple example where $typemap() is expanded in the
  3032. 'out' attribute (C# specific):
  3033. %typemap(cstype) unsigned int "uint"
  3034. %typemap(cstype, out="$typemap(cstype, unsigned int)") unsigned int& "$typemap(cstype, unsigned int)"
  3035. is equivalent to:
  3036. %typemap(cstype, out="uint") unsigned int& "uint"
  3037. 2015-07-18: m7thon
  3038. [Python] Docstrings provided via %feature("docstring") are now quoted and added to
  3039. the tp_doc slot when using python builtin classes (-builtin). When no docstring is
  3040. provided, the tp_doc slot is set to the fully qualified C/C++ class name.
  3041. Github issues #445 and #461.
  3042. 2015-07-17: kwwette
  3043. [octave] Support Octave version 4.0.0 (thanks to patches from Orion Poplawski).
  3044. 2015-07-07: wsfulton
  3045. SWIG no longer generates a wrapper for a class' constructor if that class has
  3046. any base class with a private destructor. This is because your compiler should
  3047. not allow a class to be instantiated if a base has a private destructor. Some
  3048. compilers do, so if you need the old behaviour, use the "notabstract" feature, eg:
  3049. %feature("notabstract") Derived;
  3050. class Base {
  3051. ~Base() {}
  3052. };
  3053. struct Derived : Base {};
  3054. Version 3.0.6 (5 Jul 2015)
  3055. ==========================
  3056. 2015-07-02: wsfulton
  3057. Fix syntax error when the template keyword is used in types, eg:
  3058. std::template vector<int> v;
  3059. 2015-07-02: ngladitz
  3060. [Lua] Push characters as unformatted 1-character strings to avoid
  3061. unprintable characters such as (char)127 being converted to
  3062. "<\127>" with Lua 5.3 and later. (github PR #452)
  3063. 2015-06-29: olly
  3064. [Python] Improve handling of whitespace in %pythoncode.
  3065. Previously SWIG looked at the indentation of the first line and
  3066. removed that many characters from each subsequent line, regardless
  3067. of what those characters were. This was made worse because SWIG's
  3068. preprocessor removes any whitespace before a '#'. Fixes github
  3069. issue #379, reported by Joe Orton.
  3070. 2015-06-12: wsfulton
  3071. [R] Fix #430 - call to SWIG_createNewRef in copyToC was incorrectly named.
  3072. 2015-06-11: sghirate
  3073. [C#] Patch #427 adds in new command line option -outfile to combine all the
  3074. generated C# code into a single file.
  3075. 2015-06-09: wsfulton
  3076. Fix seg fault processing C++11 type aliasing. Issue #424.
  3077. 2015-05-28: wsfulton
  3078. [Python] Add new feature "python:cdefaultargs" to control default argument
  3079. code generation. By default, SWIG attempts to convert C/C++ default argument values
  3080. into Python values and generates code into the Python layer with these values.
  3081. Recent versions of SWIG are able to convert more of these values, however, the
  3082. new behaviour can be circumvented if desired via this new feature, such that
  3083. the default argument values are obtained from the C layer and not the Python layer.
  3084. For example:
  3085. struct CDA {
  3086. int fff(int a = 1, bool b = false);
  3087. };
  3088. The default code generation in the Python layer is:
  3089. class CDA(_object):
  3090. ...
  3091. def fff(self, a=1, b=False):
  3092. return _default_args.CDA_fff(self, a, b)
  3093. Adding the feature:
  3094. %feature("python:cdefaultargs") CDA::fff;
  3095. Results in:
  3096. class CDA(_object):
  3097. ...
  3098. def fff(self, *args):
  3099. return _default_args.CDA_fff(self, *args)
  3100. Some code generation modes, eg -builtin and -fastproxy, are unaffected by this as
  3101. the default values are always obtained from the C layer.
  3102. 2015-05-27: wsfulton
  3103. [Python] Deal with an integer as the default value of a typedef to bool
  3104. parameter in the C++ prototype. See #327. Regression from 3.0.0 onwards.
  3105. 2015-05-19: olly
  3106. [Python] Fix warning when compiling generated code with MSVC.
  3107. (Fixes https://sourceforge.net/p/swig/patches/351/ reported by
  3108. Mateusz Szyma¿ski).
  3109. 2015-05-14: wsfulton
  3110. Fix seg fault wrapping shared_ptr of classes with private constructors and destructors.
  3111. This also fixes the "unref" feature when used on classes with private destructors.
  3112. 2015-05-10: wsfulton
  3113. [Java] Fix multi-argument typemaps (char *STRING, size_t LENGTH)
  3114. so that they can be applied to a wider range of types. Fixes #385.
  3115. 2015-05-07: olly
  3116. [Python] Deal with an integer as the default value of a bool
  3117. parameter in the C++ prototype. Fixes github #327, reported by
  3118. Greg Allen.
  3119. 2015-05-07: LindleyF
  3120. [Java] Allow feature("director") and feature("ref") to be used
  3121. together. Github PR#403.
  3122. 2015-05-05: olly
  3123. Suppress warning 325 "Nested class not currently supported (Foo
  3124. ignored)" when Foo has already been explicitly ignored with "%ignore".
  3125. 2015-05-04: wsfulton
  3126. Add support for friend templates, including operator overloading - fixes #196. Considering
  3127. the example below, previously the operator gave a syntax error and friendfunc incorrectly
  3128. warned with:
  3129. "Warning 503: Can't wrap 'friendfunc<(Type)>' unless renamed to a valid identifier."
  3130. template <class Type> class MyClass {
  3131. friend int friendfunc <Type>(double is, MyClass <Type> & x);
  3132. friend int operator<< <Type>(double un, const MyClass <Type> &x);
  3133. };
  3134. The following also previously incorrectly warned with:
  3135. "Warning 302: Identifier 'template_friend' redefined (ignored),"
  3136. template<typename T> T template_friend(T);
  3137. struct MyTemplate {
  3138. template<typename T> friend T template_friend(T);
  3139. };
  3140. 2015-05-01: wsfulton
  3141. Fix handling of conversion operators where the operator is split over multiple
  3142. lines or has comments within the operator type. Fixes #401.
  3143. Also fix similar problem with normal operators which gave a syntax error if split over
  3144. multiple lines or had a comment within the operator declaration.
  3145. 2015-04-30: olly
  3146. Ignore unknown preprocessor directives which are inside an inactive
  3147. conditional (github issue #394, reported by Dan Wilcox).
  3148. Regression introduced in 3.0.3.
  3149. 2015-04-27: vadz
  3150. [Python] Fix "default" typemap used after an argument with "numinputs=0" (#377).
  3151. 2015-04-24: wsfulton
  3152. [Python] Fix #256. Code generated with '-builtin -modernargs' segfaults for any
  3153. method taking zero arguments.
  3154. Also fixes: "SystemError: error return without exception set" during error checking
  3155. when using just -builtin and the incorrect number of arguments is passed to a class
  3156. method expecting zero arguments.
  3157. 2015-04-23: wsfulton
  3158. [Java] Bug #386 - Memory leak fix in (char *STRING, size_t LENGTH) typemaps.
  3159. 2015-04-23: vadz
  3160. [Python] Make "default" typemap work again (#330, #377).
  3161. 2015-04-23: vadz
  3162. [Python] Fix the use of default values for the pointer types (#365, #376).
  3163. 2015-04-23: wsfulton
  3164. Fix 'make check-ccache' which is part of 'make check' when one of the CCACHE_
  3165. environment variables, for example CCACHE_DISABLE, is set.
  3166. 2015-04-14: wsfulton
  3167. Clearer warning message for badly constructed typecheck typemaps. For example, was:
  3168. example.i:3: Warning 467: Overloaded foo(int) not supported (no type checking
  3169. rule for 'int').
  3170. Now:
  3171. example.i:3: Warning 467: Overloaded foo(int) not supported (incomplete type checking
  3172. rule - no precedence level in typecheck typemap for 'int').
  3173. 2015-04-11: wsfulton
  3174. [Java] Fix #353 - Linker multiple definition of 'ExceptionMatches' when
  3175. using directors and multiple modules.
  3176. 2015-04-11: wsfulton
  3177. Merge #320 - Make __dict__ accessible for Python builtin classes.
  3178. 2015-04-07: wsfulton
  3179. Fix #375 - parsing of extern "C" and typedef for example:
  3180. extern "C" typedef void (*Hook2_t)(int, const char *);
  3181. extern "C" typedef int Integer;
  3182. 2015-03-12: olly
  3183. -DSWIG_DIRECTOR_STATIC is now supported for all languages with
  3184. director support, not only Python and PHP.
  3185. 2015-03-02: ianlancetaylor
  3186. [Go] Add -cgo option, required for Go versions 1.5 and
  3187. later.
  3188. 2015-02-26: olly
  3189. Fix segmentation fault when top==NULL, introduced by nested class
  3190. handling (reported in issue#346 by Pawe¿ Tomulik).
  3191. 2015-02-09: wsfulton
  3192. [Guile] Fix generated code for static const char member variables when
  3193. defined and declared inline.
  3194. 2015-02-09: mishas
  3195. [Go] Fix %import of files in sub directories.
  3196. 2015-02-05: ianlancetaylor
  3197. [Go] Ignore Go specific type maps (goin, goout, etc.) if they are empty.
  3198. 2015-02-05: ianlancetaylor
  3199. [Go] Generated Go code no longer calls _swig_goallocate or
  3200. _swig_makegostring, as they will no longer work as of Go 1.5.
  3201. Version 3.0.5 (31 Jan 2015)
  3202. ===========================
  3203. 2015-01-30: wsfulton
  3204. [Python] Fix Python -classic and property setting. Setting properties on classic classes
  3205. was broken in swig-3.0.3 by attempting to use __setattr__. This regression is fixed now
  3206. by using __dict__ again when using -classic.
  3207. Fixes patch #232.
  3208. 2015-01-27: smarchetto
  3209. [Scilab] Support for the Scilab language has been added
  3210. 2015-01-23: olly
  3211. [PHP] When wrapping a returned resource as an object, check if all
  3212. cases wrap it in the same class, and if so eliminate the pointless
  3213. switch statement wrapper we previously generated.
  3214. 2015-01-22: wsfulton
  3215. [Octave] Merge patch #297 for SF bug #1277 - Octave shared_ptr support
  3216. 2015-01-15: wsfulton
  3217. [Python] Merge patch #250 - Fixes for using %constant and objects (non-primitive types)
  3218. 2015-01-15: wsfulton
  3219. [C# Go] Merge patch #308 and fix #307 - C++11 strongly typed enum support
  3220. in directors
  3221. 2015-01-15: wsfulton
  3222. [Python] Second fix for #294 #296 - Regression introduced in SWIG-3.0.3 when
  3223. wrapping functions with default arguments, this time when using kwargs.
  3224. Version 3.0.4 (14 Jan 2015)
  3225. ===========================
  3226. 2015-01-12: olly
  3227. [PHP] Fix segfault in director upcall check when using PHP built with
  3228. ZTS enabled. Fixes #155, reported by Pierre Labastie.
  3229. 2015-01-12: vadz
  3230. [Python] Fix #294 #296 - Regression introduced in SWIG-3.0.3 when
  3231. wrapping functions with default arguments. Invalid or missing default
  3232. arguments were sometimes being generated into the python layer.
  3233. 2015-01-08: olly
  3234. Allow C++11 "explicit constexpr". Fixes github issue #284 reported
  3235. by Pawel Tomulik. Also handle "constexpr explicit" and "constexpr
  3236. static".
  3237. 2015-01-08: olly
  3238. When reporting an error for a construct which hasn't been
  3239. terminated when the end of the file is reached, report it at the
  3240. start line rather than "EOF" as then tools like editors and IDEs
  3241. will take you to a generally more useful place for fixing the
  3242. problem.
  3243. 2015-01-08: olly
  3244. Improve error messages for a few cases which previously gave the
  3245. one of the cryptic catch-all errors "Syntax error in input".
  3246. 2015-01-08: olly
  3247. Provide -cppext as a general command line option for setting the
  3248. extension used for generated C++ files (previously it was specific
  3249. to the PHP backend). Deprecate the equivalent -suffix option
  3250. provided by the Ocaml backend, but continue to support that for
  3251. now.
  3252. Version 3.0.3 (30 Dec 2014)
  3253. ===========================
  3254. 2014-12-27: wsfulton
  3255. Fix #280 - abort using all default template parameters within other template
  3256. parameters.
  3257. 2014-12-27: talby
  3258. [Perl] Issue #282 perl5 archlib vs archlibexp
  3259. [Perl] tidy "warning: duplicate 'extern' declaration specifier" when building generated code
  3260. under clang
  3261. 2014-12-18: wsfulton
  3262. Add support for %constant and structs/classes - issue #272
  3263. 2014-12-09: wsfulton
  3264. Fix #245 - regression (since swig-3.0.0) in templated constructors.
  3265. Templated constructors could not be instantiated - they were incorrectly ignored with a warning 504:
  3266. "Function: xyz must have a return type. Ignored."
  3267. 2014-12-07: wsfulton
  3268. Add support for C++11 strongly typed enumerations.
  3269. 2014-11-21: wsfulton
  3270. [Java C#] Fix multiply defined error when using %rename of enum items when using the "simple enum"
  3271. wrappers.
  3272. 2014-10-28: vadz
  3273. [Python] Patch #201 The generated .py file no longer uses *args for all Python parameters.
  3274. Instead, the parameters are named using the C++ parameter names.
  3275. "compactdefaultargs" feature can be enabled to restore the old behaviour.
  3276. *** POTENTIAL INCOMPATIBILITY ***
  3277. 2014-10-24: timotheecour
  3278. [D] Patch #204 Use core.atomic.atomicOp to mutate shared variables
  3279. 2014-10-21: wsfulton
  3280. Fix issue #242 - Use of the "kwargs" feature no longer automatically turns on the
  3281. "compactdefaultargs" feature if the target language does not support kwargs.
  3282. This change affects all languages except Python and Ruby.
  3283. *** POTENTIAL INCOMPATIBILITY ***
  3284. 2014-10-10: diorcety
  3285. [Python] Patch #232 Fix property access using directors
  3286. 2014-10-06: wsfulton
  3287. [Python] Fixes when using -builtin and std::vector/std::list wrappers to allow deletion
  3288. of single elements, such as 'del vec[0]'.
  3289. 2014-09-30: oliverb
  3290. [Javascript] Merge patch #216 by Richie765 - Added support for many versions of v8 javascript.
  3291. 2014-09-30: oliverb
  3292. [Javascript] Merge patch #195 by zittix - Fixed JSClassRef declaration not using the static one.
  3293. 2014-09-30: ianlancetaylor
  3294. [Go] In configure script, require Go 1.1 or later.
  3295. 2014-09-30: wsfulton
  3296. [Python] Patch #207 - Fix No module error with -relativeimport when using single
  3297. header file import.
  3298. 2014-09-27: wsfulton
  3299. Patch #208 - Initialise newly created array when using array_functions in the
  3300. carrays.i library (C++ usage).
  3301. 2014-09-27: wsfulton
  3302. [Ruby] Patch #187 - Fix crash on shutdown of the Ruby interpreter if more than one
  3303. module was loaded at a time when data is being shared between modules.
  3304. 2014-09-27: wsfulton
  3305. [Java] Patch #168 - Fix leak in Java director string handling after the Java
  3306. upcall when called from a native thread.
  3307. 2014-09-25: ianlancetaylor
  3308. [Go] Adjust generated code to work with upcoming Go 1.4
  3309. release.
  3310. 2014-09-23: wsfulton
  3311. [Python] Add patch from Thomas Maslach to fix crash in wrappers when using -threads in
  3312. the STL iterators (SwigPyIterator destructor).
  3313. 2014-09-17: wsfulton
  3314. [C#] Merge patch #229 from contre - Add bool array types to arrays_csharp.i
  3315. 2014-09-12: olly
  3316. [PHP] Add support for specifying any PHP interfaces a wrapped class
  3317. implements, e.g.: %typemap("phpinterfaces") MyIterator "Iterator"
  3318. 2014-09-11: olly
  3319. [PHP] Fix throwing a PHP exception through C++ from a subclassed
  3320. director method - PHP NULL gets returned by the subclassed method
  3321. in this case, so the directorout typemap needs to allow that (at
  3322. least if an exception is active).
  3323. 2014-09-09: ianlancetaylor
  3324. [Go] Add goargout typemap.
  3325. 2014-09-09: olly
  3326. [PHP] Fix segmentation faults with directors in PHP >= 5.4, and
  3327. reenable runme tests for director_basic testcase. Fix from
  3328. pavel-charvat in issue#164.
  3329. 2014-09-05: ianlancetaylor
  3330. [Go] Add imtype, goin, goout, godirectorin, and
  3331. godirectorout typemaps, to support writing Go code to
  3332. convert between types.
  3333. 2014-09-02: olly
  3334. [Python] Fix regression in indentation of python code produced with
  3335. -modern, introduced by changes in #188. Reported by fabiencastan
  3336. in #218.
  3337. 2014-09-01: olly
  3338. Issue an error for unknown SWIG preprocessor directives, rather
  3339. than quietly ignoring them. Reported by jrhelsey in issue#217.
  3340. *** POTENTIAL INCOMPATIBILITY ***
  3341. 2014-08-15: talby
  3342. [Perl] Include guard fix for nested modules from Anthony Heading (SF Patch #350).
  3343. 2014-08-04: wsfulton
  3344. [C#] Merge patch #200 from gpetrou - Changed CSharp license header to include auto-generated
  3345. tag so that StyleCop ignores the files.
  3346. 2014-08-04: wsfulton
  3347. [Java] Merge patch #198 from Yuval Kashtan - Support for java.nio.ByteBuffer mapping to
  3348. unsigned char * in various.i in NIOBUFFER typemaps.
  3349. 2014-07-14: ianlancetaylor
  3350. [Go] Change struct definition to use void *, not uint8, so
  3351. that the type is recorded as possibly containing
  3352. pointers. This ensures that the 1.3 garbage collector
  3353. does not collect pointers passed to C++ code.
  3354. 2014-07-01: wsfulton
  3355. Fix SF Bug #1375 - Expansion of the $parentclassname special variable incorrectly contains
  3356. brackets in the expanded name.
  3357. Version 3.0.2 (4 Jun 2014)
  3358. ==========================
  3359. 2014-06-02: v-for-vandal
  3360. [Lua] Pull request #176:
  3361. If class has no __eq implemented, then default __eq is generated.
  3362. Default __eq compares actual pointers stored inside Lua userdata.
  3363. 2014-06-02: vkalinin
  3364. Fix #183 - %extend and unnamed nested structs
  3365. 2014-05-28: kwwette
  3366. Fix install failure when using an 'out of source' build using the shipped
  3367. tarball - regression introduced in swig-3.0.1.
  3368. 2014-05-24: kwwette
  3369. [Octave] Remove deprecated -global/-noglobal command-line arguments
  3370. *** POTENTIAL INCOMPATIBILITY ***
  3371. Version 3.0.1 (27 May 2014)
  3372. ===========================
  3373. 2014-05-25: hfalcic
  3374. [Python] Python 3 byte string output: use errors="surrogateescape"
  3375. if available on the version of Python that's in use. This allows
  3376. obtaining the original byte string (and potentially trying a fallback
  3377. encoding) if the bytes can't be decoded as UTF-8.
  3378. Previously, a UnicodeDecodeError would be raised with no way to treat
  3379. the data as bytes or try another codec.
  3380. 2014-05-18: vkalinin
  3381. Bug #175 - Restore %extend to work for unnamed nested structures by using a C
  3382. symbol comprising the outer structure name and unnamed variable instance name.
  3383. 2014-05-15: kwwette
  3384. Add #166 - 'make check' now works out of source. This required the examples to build
  3385. out of source. The main languages have been tested - C#, Go, Guile, Java, Javascript,
  3386. Lua, Octave, Perl, PHP, Python, Ruby and Tcl.
  3387. 2014-05-01: Oliver Buchtala
  3388. Javascript support added, see Javascript chapter in the documentation.
  3389. 2014-05-01: olly
  3390. [PHP] The generated __isset() method now returns true for read-only properties.
  3391. 2014-04-24: kwwette
  3392. [Go] Fix go ./configure parsing of gccgo --version, and
  3393. goruntime.swg typo in __GNUC_PATCHLEVEL__ (SF Bug #1298)
  3394. 2014-04-24: kwwette
  3395. Fix {python|perl5|ruby|tcl}/java examples
  3396. In Lib/gcj/cni.i, for compatibility with newer gcj versions:
  3397. - remove JvAllocObject() which gcj no longer defines, from gcj Changelog:
  3398. 2004-04-16 Bryce McKinlay <mckinlay@redhat.com>
  3399. * gcj/cni.h (JvAllocObject): Remove these obsolete,
  3400. undocumented CNI calls.
  3401. - change JvCreateJavaVM() argument from void* to JvVMInitArgs*, from gcj Changelog:
  3402. 2005-02-23 Thomas Fitzsimmons <fitzsim@redhat.com>
  3403. PR libgcj/16923
  3404. ...
  3405. (JvCreateJavaVM): Declare vm_args as JvVMInitArgs* rather than void*.
  3406. *** POTENTIAL INCOMPATIBILITY ***
  3407. 2014-04-08: wsfulton
  3408. SF Bug #1366 - Remove duplicate declarations of strtoimax and strtoumax in inttypes.i
  3409. 2014-04-08: wsfulton
  3410. [Java C#] Enums which have been ignored via %ignore and are subsequently
  3411. used are handled slightly differently. Type wrapper classes are now generated
  3412. which are effectively a wrapper of an empty enum. Previously in Java uncompilable
  3413. code was generated and in C# an int was used.
  3414. 2014-04-04: wsfulton
  3415. Fix regression in 3.0.0 where legal code following an operator<< definition might
  3416. give a syntax error. SF Bug #1365.
  3417. 2014-04-03: olly
  3418. [PHP] Fix wrapping director constructors with default parameters
  3419. with a ZTS-enabled build of PHP.
  3420. 2014-04-02: olly
  3421. [PHP] Pass the ZTS context we already have to avoid needing to
  3422. call TSRMLS_FETCH, which is relatively expensive.
  3423. 2014-04-02: olly
  3424. [PHP] Pass ZTS context through to t_output_helper() so it works
  3425. with a ZTS-enabled build of PHP. Reported by Pierre Labastie in
  3426. github PR#155.
  3427. 2014-03-28: wsfulton
  3428. [Java C# D Go] Fixes for C enums used in an API and the definition of the enum
  3429. has not been parsed. For D, this fixes a segfault in SWIG. The other languages
  3430. now produce code that compiles, although the definition of the enum is needed
  3431. in order to use the enum properly from the target language.
  3432. 2014-03-23: v-for-vandal
  3433. [Lua] Fix for usage of snprintf in Lua runtime which Visual Studio does not have.
  3434. Version 3.0.0 (16 Mar 2014)
  3435. ===========================
  3436. 2014-03-16: wsfulton
  3437. C++11 support initially developed as C++0x support by Matevz Jekovec as a Google Summer of Code
  3438. project has been further extended. The C++11 support is comprehensive, but by no means complete
  3439. or without limitations. Full details for each new feature in C++11 is covered in the
  3440. CPlusPlus11.html chapter in the documentation which is included in SWIG and also available
  3441. online at https://www.swig.org/Doc3.0/CPlusPlus11.html.
  3442. 2014-03-14: v-for-vandal
  3443. [Lua] Numerous Lua improvements:
  3444. 1. %nspace support has been added. Namespaces are mapped to tables in the module, with the same
  3445. name as the C++ namespace.
  3446. 2. Inheritance is now handled differently. Each class metatable keeps a list of class bases instead
  3447. of merging all members of all bases into the derived class.
  3448. 3. The new metatables result in differences in accessing class members. For example:
  3449. %module example
  3450. struct Test {
  3451. enum { TEST1 = 10, TEST2 = 20 };
  3452. static const int ICONST = 12;
  3453. };
  3454. Now this can be used as follows:
  3455. print(example.Test.TEST1)
  3456. print(example.Test.ICONST)
  3457. The old way was:
  3458. print(example.Test_TEST1)
  3459. print(example.Test_ICONST)
  3460. 4. The special class metatable member ".constructor" was removed. Now SWIG generates the proxy
  3461. function by itself and assigns it directly to the class table "__call" method.
  3462. 5. eLua should also now support inheritance.
  3463. 6. 'const' subtable in eLua is considered deprecated.
  3464. Changes in behaviour:
  3465. a. You can no longer assign to non-existing class members in classes without a __setitem__ method.
  3466. It will cause a Lua error.
  3467. b. You can no longer iterate over a module table and copy everything into the global namespace.
  3468. Actually, this was never the case, but it is now explicitly prohibited.
  3469. c. Now changing a base class will immediately affect all derived classes.
  3470. d. There might be some issues with inheritance. Although the bases iteration scheme is the same
  3471. as was used for merging base classes into derived one, some unknown issues may arise.
  3472. The old metatable behaviour can be restored by using the -no-old-metatable-bindings option.
  3473. *** POTENTIAL INCOMPATIBILITY ***
  3474. 2014-03-06: wsfulton
  3475. [Python] Change in default behaviour wrapping C++ bool. Only a Python True or False
  3476. will now work for C++ bool parameters. This fixes overloading bool with other types.
  3477. Python 2.3 minimum is now required for wrapping bool.
  3478. When wrapping:
  3479. const char* overloaded(bool value) { return "bool"; }
  3480. const char* overloaded(int value) { return "int"; }
  3481. Previous behaviour:
  3482. >>> overloaded(False)
  3483. 'int'
  3484. >>> overloaded(True)
  3485. 'int'
  3486. >>> overloaded(0)
  3487. 'int'
  3488. Now we get the expected behaviour:
  3489. >>> overloaded(False)
  3490. 'bool'
  3491. >>> overloaded(0)
  3492. 'int'
  3493. The consequence is when wrapping bool in non-overloaded functions:
  3494. const char* boolfunction(bool value) { return value ? "true" : "false"; }
  3495. The previous behaviour was very Pythonic:
  3496. >>> boolfunction("")
  3497. 'false'
  3498. >>> boolfunction("hi")
  3499. 'true'
  3500. >>> boolfunction(12.34)
  3501. 'true'
  3502. >>> boolfunction(0)
  3503. 'false'
  3504. >>> boolfunction(1)
  3505. 'true'
  3506. Now the new behaviour more along the lines of C++ due to stricter type checking. The
  3507. above calls result in an exception and need to be explicitly converted into a bool as
  3508. follows:
  3509. >>> boolfunction(0)
  3510. Traceback (most recent call last):
  3511. File "<stdin>", line 1, in <module>
  3512. TypeError: in method 'boolfunction', argument 1 of type 'bool'
  3513. >>> boolfunction(bool(0))
  3514. 'false'
  3515. The old behaviour can be resurrected by passing the -DSWIG_PYTHON_LEGACY_BOOL command line
  3516. parameter when executing SWIG. Typemaps can of course be written to customise the behaviour
  3517. for specific parameters.
  3518. *** POTENTIAL INCOMPATIBILITY ***
  3519. 2014-03-06: wsfulton
  3520. Fix SF Bug #1363 - Problem with method overloading when some methods are added by %extend
  3521. and others are real methods and using template default parameters with smart pointers.
  3522. This is noticeable as a regression since 2.0.12 when using the default smart pointer
  3523. handling for some languages when the smart pointer wraps std::map and other STL containers.
  3524. 2014-03-02: wsfulton
  3525. [Python] SF Patch #346 from Jens Krueger. Correct exception thrown attempting to
  3526. access a non-existent C/C++ global variable on the 'cvar' object. The exception thrown
  3527. used to be a NameError. However, as this access is via a primary, an AttributeError
  3528. is more correct and so the exception thrown now is an AttributeError. Reference:
  3529. http://docs.python.org/2/reference/expressions.html#attribute-references
  3530. *** POTENTIAL INCOMPATIBILITY ***
  3531. 2014-03-01: wsfulton
  3532. [Python] Patch #143 Fix type shown when using type() to include the module and package
  3533. name when using -builtin.
  3534. 2014-03-01: wsfulton
  3535. [Python] SF patch #347 Fix missing argument count checking with -modern.
  3536. Fixes regression introduced when builtin changes were introduced in SWIG-2.0.3.
  3537. 2014-02-21: wsfulton
  3538. [PHP] Fix warning suppression using %warnfilter for PHP reserved class names.
  3539. 2014-02-19: olly
  3540. [Lua] Add keyword warnings for Lua keywords and Basic Functions.
  3541. 2014-02-19: olly
  3542. -Wallkw now includes keywords for all languages with keyword
  3543. warnings (previously Go and R were missing).
  3544. 2014-02-19: olly
  3545. [PHP] Update the lists of PHP keywords with new ones from PHP 5.4
  3546. and newer (and some missing ones from 5.3). Reserved PHP constants
  3547. names are now checked against enum values and constants, instead
  3548. of against function and method names. Built-in PHP function names
  3549. no longer match methods added by %extend. Functions and methods
  3550. named '__sleep', '__wakeup', 'not', 'parent', or 'virtual' are no
  3551. longer needlessly renamed.
  3552. 2014-02-15: wsfulton
  3553. Fix the %$ismember %rename predicates to also apply to members added via %extend.
  3554. Add %$isextendmember for %rename of members added via %extend. This can be used to
  3555. distinguish between normal class/struct members and %extend members. For example
  3556. '%$ismember, %$not %$isextendmember' will now identify just class/struct members.
  3557. *** POTENTIAL INCOMPATIBILITY ***
  3558. 2014-02-16: hfalcic
  3559. [Python] Patch #137 - fix crashes/exceptions in exception handling in Python 3.3
  3560. 2014-02-15: wsfulton
  3561. [Java] Add support for the cdata library.
  3562. 2014-02-08: vkalinin
  3563. Nested class support added. This primarily allows SWIG to properly parse nested
  3564. classes and keep the nested class information in the parse tree. Java and C#
  3565. have utilised this information wrapping the C++ nested classes as Java/C#
  3566. nested classes. The remaining target languages ignore nested classes as in
  3567. previous versions. Help is needed by users of these remaining languages to
  3568. design how C++ nested classes can be best wrapped. Please talk to us on the
  3569. swig-devel mailing list if you think you can help.
  3570. Previously, there was limited nested class support. Nested classes were treated
  3571. as opaque pointers. However, the "nestedworkaround" feature provided a way to
  3572. wrap a nested class as if it was a global class. This feature no longer exists
  3573. and is replaced by the new "flatnested" feature. This effectively does the same
  3574. thing with less manual code to be written. Please see the 'Nested classes'
  3575. section in the documentation in SWIGPlus.html if you were previously using this
  3576. feature.
  3577. SWIG now parses the contents of nested classes where previously it did not. You
  3578. may find that you will need to make adjustments to your interface file as
  3579. effectively extra code is being wrapped.
  3580. *** POTENTIAL INCOMPATIBILITY ***
  3581. 2014-02-06: gjanssens
  3582. [Guile] Patch #133. Make scm to string conversion work with non-ascii strings.
  3583. Guile 2 has a completely rewritten string implementation. SWIG made some assumptions
  3584. that are no longer valid as to the internals of guile's string representation.
  3585. 2014-01-30: wsfulton
  3586. [C#] Add new swigtype_inout.i library containing SWIGTYPE *& OUTPUT typemaps.
  3587. Example usage wrapping:
  3588. void f(XXX *& x) { x = new XXX(111); }
  3589. would be:
  3590. XXX x = null;
  3591. f(out x);
  3592. // use x
  3593. x.Dispose(); // manually clear memory or otherwise leave out and leave it to the garbage collector
  3594. 2014-01-21: ianlancetaylor
  3595. [Go] Add %go_import directive.
  3596. 2014-01-21: ianlancetaylor
  3597. [Go] Add support for Go 1.3, not yet released.
  3598. 2014-01-20: wsfulton
  3599. Director exceptions (Swig::DirectorException) now derive from std::exception
  3600. and hence provide the what() method. In Python and Ruby, this replaces the now
  3601. deprecated DirectorException::getMessage() method.
  3602. 2014-01-14: diorcety
  3603. Patch #112 - Fix symbol resolution involving scopes that have multiple levels
  3604. of typedefs - fixes some template resolutions as well as some typemap searches.
  3605. 2014-01-11: wsfulton
  3606. Fix and document the naturalvar feature override behaviour - the naturalvar
  3607. feature attached to a variable name has precedence over the naturalvar
  3608. feature attached to the variable's type. The overriding was not working
  3609. when turning the feature off on the variable's name.
  3610. Fix so that any use of the naturalvar feature will override the global
  3611. setting. Previously when set globally by -naturalvar or %module(naturalvar=1),
  3612. use of the naturalvar feature was not always honoured.
  3613. 2014-01-06: ianlancetaylor
  3614. [Go] Fix bug that broke using directors from a thread not
  3615. created by Go.
  3616. 2013-12-24: ptomulik
  3617. [Python] SF Bug #1297
  3618. Resolve several issues related to python imports.
  3619. For example, it's now possible to import modules having the same module
  3620. names, but belonging in different packages.
  3621. From the user's viewpoint, this patch gives a little bit more control on
  3622. import statements generated by SWIG. The user may choose to use relative
  3623. or absolute imports.
  3624. Some details:
  3625. - we (still) generate import statements in the form 'import a.b.c' which
  3626. corresponds to absolute imports in python3 and (the only available)
  3627. ambiguous one in python2.
  3628. - added -relativeimport option to use explicit relative import syntax
  3629. (python3),
  3630. The "Python Packages" section in the documentation discusses how to work
  3631. with importing packages including the new -relativeimport command line option.
  3632. 2013-12-23: vadz
  3633. [Octave, Perl, Python, R, Ruby, Tcl] Change the length of strings created from fixed-size char
  3634. buffers in C code.
  3635. This is a potential backwards compatibility break: a "char buf[5]" containing "ho\0la" was
  3636. returned as a string of length 5 before, but is returned as a string of length 2 now. Also,
  3637. it was possible to assign a (non-NUL-terminated) string "hello" to such a buffer before but
  3638. now this fails and only "helo" can fit.
  3639. Apply "char FIXSIZE[ANY]" typemaps to explicitly choose the old behaviour.
  3640. *** POTENTIAL INCOMPATIBILITY ***
  3641. 2013-12-23: talby
  3642. [Perl] Add support for directors.
  3643. 2013-12-18: ianlancetaylor
  3644. [Go] Don't require that Go environment variables be set
  3645. when running examples or testsuite when using Go 1 or
  3646. later.
  3647. 2013-12-17: ianlancetaylor
  3648. [Go] Remove -longsize option (for backward compatibility,
  3649. ignore it if seen).
  3650. 2013-12-17: ianlancetaylor
  3651. [Go] Add -go-pkgpath option.
  3652. 2013-12-16: ianlancetaylor
  3653. [Go] Update for Go 1.2 release. Add support for linking
  3654. SWIG code directly into executable, rather than using a
  3655. shared library.
  3656. 2013-12-13: ianlancetaylor
  3657. [Go] Add SWIG source file name as comments in generated
  3658. files. This can be used by Go documentation tools.
  3659. 2013-12-12: jleveque
  3660. [Lua] Fix typo (wchar instead of wchar_t) which made wchar.i
  3661. for Lua useless.
  3662. 2013-12-12: vmiklos
  3663. [PHP] PHP's peculiar call-time pass-by-reference feature was
  3664. deprecated in PHP 5.3 and removed in PHP 5.4, so update the REF
  3665. typemaps in phppointers.i to specify pass-by-reference in the
  3666. function definition. Examples/php/pointer has been updated
  3667. accordingly.
  3668. 2013-12-12: olly
  3669. [PHP] The usage of $input in PHP directorout typemaps has been
  3670. changed to be consistent with other languages. The typemaps
  3671. provided by SWIG have been updated accordingly, but if you
  3672. have written your own directorout typemaps, you'll need to
  3673. update $input to &$input (or make equivalent changes).
  3674. *** POTENTIAL INCOMPATIBILITY ***
  3675. 2013-11-27: vadz
  3676. [C#, Java, Python] Add std_auto_ptr.i defining typemaps for returning std::auto_ptr<>.
  3677. 2013-11-09: wsfulton
  3678. [C#] Apply patch #79 from Brant Kyser
  3679. - Remove using directives from the generated C# code and fully qualify the use of all .NET
  3680. framework types in order to minimize potential name collisions from input files defining
  3681. types, namespace, etc with the same name as .NET framework members.
  3682. - Globally qualify the use of .NET framework types in the System namespace
  3683. - Remove .NET 1.1 support, .NET 2 is the minimum for the C# module
  3684. This is a potential backwards compatibility break if code has been added relying on these using
  3685. statements that used to be generated:
  3686. using System;
  3687. using System.Runtime.InteropServices;
  3688. The quick fix to add these back in is to add the -DSWIG2_CSHARP command line option when
  3689. executing SWIG. See CSharp.html documentation for more info.
  3690. *** POTENTIAL INCOMPATIBILITY ***
  3691. 2013-11-05: wsfulton
  3692. [Java] Fix some corner cases for the $packagepath/$javaclassname special variable substitution.
  3693. 2013-11-05: wsfulton
  3694. [Java] Apply patch #91 from Marvin Greenberg - Add director:except feature for improved
  3695. exception handling in director methods for Java.
  3696. 2013-10-15: vadz
  3697. Allow using \l, \L, \u, \U and \E in the substitution part of %(regex:/pattern/subst/)
  3698. inside %rename to change the case of the text being replaced.
  3699. 2013-10-12: wsfulton
  3700. [CFFI] Apply #96 - superclass not lispify
  3701. 2013-10-12: wsfulton
  3702. Merge in C++11 support from the gsoc2009-matevz branch where Matevz Jekovec first
  3703. started the C++0x additions. Documentation of the C++11 features supported is in a
  3704. new Chapter of the documentation, "SWIG and C++11" in Doc/Manual/CPlusPlus11.html.
  3705. 2013-10-04: wsfulton
  3706. Fix %naturalvar not having any affect on templated classes instantiated with an
  3707. enum as the template parameter type. Problem reported by Vadim Zeitlin.
  3708. 2013-09-20: wsfulton
  3709. [Java] Fix a memory leak for the java char **STRING_ARRAY typemaps.
  3710. Version 2.0.12 (9 Feb 2014)
  3711. ===========================
  3712. 2014-01-16: wsfulton
  3713. [PHP] Fix compilation error in ZTS mode (64 bit windows) due to incorrect placement
  3714. of TSRMLS_FETCH() in SWIG_Php_GetModule() as reported by Mark Dawson-Butterworth.
  3715. 2014-01-13: kwwette
  3716. [Octave] update support to Octave version 3.8.0
  3717. - Octave 3.8.0 no longer defines OCTAVE_API_VERSION_NUMBER, but 3.8.1
  3718. will define OCTAVE_{MAJOR,MINOR,PATCH}_VERSION instead: see
  3719. http://hg.savannah.gnu.org/hgweb/octave/rev/b6b6e0dc700e
  3720. So we now use a new macro SWIG_OCTAVE_PREREQ(major,minor,patch) to
  3721. enable features requiring Octave version major.minor.patch or later.
  3722. For Octave versions prior to 3.8.1, we reconstruct values for
  3723. OCTAVE_{MAJOR,MINOR,PATCH}_VERSION based on OCTAVE_API_VERSION_NUMBER,
  3724. extracted from Octave's ChangeLogs. An additional hack is needed to
  3725. distinguish between Octave <= 3.2.x and 3.8.0, neither of which define
  3726. OCTAVE_API_VERSION_NUMBER.
  3727. - Octave 3.8.0 deprecates symbol_table::varref(), so remove its use
  3728. for this and future versions of Octave.
  3729. - Octave 3.8.0 removes octave_value::is_real_nd_array(), used in
  3730. octave_swig_type::dims(). Its use is not required here, so remove it.
  3731. - Retested against Octave versions 3.0.5, 3.2.4, 3.4.3, 3.6.4, and 3.8.0.
  3732. - Updated Octave documentation with tested Octave versions, and added a
  3733. warning against using versions <= 3.x.x, which are no longer tested.
  3734. 2013-12-22: wsfulton
  3735. C++11 support for new versions of erase and insert in the STL containers.
  3736. The erase and insert methods in the containers use const_iterator instead
  3737. of iterator in C++11. There are times when the methods wrapped must match
  3738. the parameters exactly. Specifically when full type information for
  3739. template types is missing or SWIG fails to look up the type correctly,
  3740. for example:
  3741. %include <std_vector.i>
  3742. typedef float Real;
  3743. %template(RealVector) std::vector<Real>;
  3744. SWIG does not find std::vector<Real>::iterator because %template using
  3745. typedefs does not always work and so SWIG doesn't know if the type is
  3746. copyable and so uses SwigValueWrapper<iterator> which does
  3747. not support conversion to another type (const_iterator). This resulted
  3748. in compilation errors when using the C++11 version of the containers.
  3749. Closes #73
  3750. 2013-10-17: wsfulton
  3751. [R] Fix SF #1340 - Visual Studio compile error in C++ wrappers due to #include <exception>
  3752. within extern "C" block.
  3753. 2013-10-17: wsfulton
  3754. [Python] Fix SF #1345 - Missing #include <stddef.h> for offsetof when using -builtin.
  3755. 2013-10-12: wsfulton
  3756. [Lua] Apply #92 - missing return statements for SWIG_Lua_add_namespace_details()
  3757. and SWIG_Lua_namespace_register().
  3758. Version 2.0.11 (15 Sep 2013)
  3759. ============================
  3760. 2013-09-15: wsfulton
  3761. [R] Fix attempt to free a non-heap object in OUTPUT typemaps for:
  3762. unsigned short *OUTPUT
  3763. unsigned long *OUTPUT
  3764. signed long long *OUTPUT
  3765. char *OUTPUT
  3766. signed char*OUTPUT
  3767. unsigned char*OUTPUT
  3768. 2013-09-12: wsfulton
  3769. [Lua] Pull Git patch #62.
  3770. 1) Static members and static functions inside class can be accessed as
  3771. ModuleName.ClassName.FunctionName (MemberName respectively). Old way such as
  3772. ModuleName.ClassName_FunctionName still works.
  3773. 2) Same goes for enums inside classes: ModuleName.ClassName.EnumValue1 etc.
  3774. 2013-09-12: wsfulton
  3775. [UTL] Infinity is now by default an acceptable value for type 'float'. This fix makes
  3776. the handling of type 'float' and 'double' the same. The implementation requires the
  3777. C99 isfinite() macro, or otherwise some platform dependent equivalents, to be available.
  3778. Users requiring the old behaviour of not accepting infinity, can define a 'check' typemap
  3779. wherever a float is used, such as:
  3780. %typemap(check,fragment="<float.h>") float, const float & %{
  3781. if ($1 < -FLT_MAX || $1 > FLT_MAX) {
  3782. SWIG_exception_fail(SWIG_TypeError, "Overflow in type float");
  3783. }
  3784. %}
  3785. *** POTENTIAL INCOMPATIBILITY ***
  3786. 2013-08-30: wsfulton
  3787. [Lua] Pull Git patch #81: Include Lua error locus in SWIG error messages.
  3788. This is standard information in Lua error messages, and makes it much
  3789. easier to find bugs.
  3790. 2013-08-29: wsfulton
  3791. Pull Git patch #75: Handle UTF-8 files with BOM at beginning of file. Was giving an
  3792. 'Illegal token' syntax error.
  3793. 2013-08-29: wsfulton
  3794. [C#] Pull Git patch #77: Allow exporting std::map using non-default comparison function.
  3795. 2013-08-28: wsfulton
  3796. [Python] %implicitconv is improved for overloaded functions. Like in C++, the methods
  3797. with the actual types are considered before trying implicit conversions. Example:
  3798. %implicitconv A;
  3799. struct A {
  3800. A(int i);
  3801. };
  3802. class CCC {
  3803. public:
  3804. int xx(int i) { return 11; }
  3805. int xx(const A& i) { return 22; }
  3806. };
  3807. The following python code:
  3808. CCC().xx(-1)
  3809. will now return 11 instead of 22 - the implicit conversion is not done.
  3810. 2013-08-23: olly
  3811. [Python] Fix clang++ warning in generated wrapper code.
  3812. 2013-08-16: wsfulton
  3813. [Python] %implicitconv will now accept None where the implicit conversion takes a C/C++ pointer.
  3814. Problem highlighted by Bo Peng. Closes SF patch #230.
  3815. 2013-08-07: wsfulton
  3816. [Python] SF Patch #326 from Kris Thielemans - Remove SwigPyObject_print and SwigPyObject_str and
  3817. make the generated wrapper use the default python implementations, which will fall back to repr
  3818. (for -builtin option).
  3819. Advantages:
  3820. - it avoids the swig user having to jump through hoops to get print to work as expected when
  3821. redefining repr/str slots.
  3822. - typing the name of a variable on the python prompt now prints the result of a (possibly redefined)
  3823. repr, without the swig user having to do any extra work.
  3824. - when redefining repr, the swig user doesn't necessarily have to redefine str as it will call the
  3825. redefined repr
  3826. - the behaviour is exactly the same as without the -builtin option while requiring no extra work
  3827. by the user (aside from adding the %feature("python:slot...) statements of course)
  3828. Disadvantage:
  3829. - default str() will give different (but clearer?) output on swigged classes
  3830. 2013-07-30: wsfulton
  3831. [Python, Ruby] Fix #64 #65: Missing code in std::multimap wrappers. Previously an instantiation
  3832. of a std::map was erroneously required in addition to an instantiation of std::multimap with the
  3833. same template parameters to prevent compilation errors for the wrappers of a std::multimap.
  3834. 2013-07-14: joequant
  3835. [R] Change types file to allow for SEXP return values
  3836. 2013-07-05: wsfulton
  3837. [Python] Add %pythonbegin directive which works like %pythoncode, except the specified code is
  3838. added at the beginning of the generated .py file. This is primarily needed for importing from
  3839. __future__ statements required to be at the very beginning of the file. Example:
  3840. %pythonbegin %{
  3841. from __future__ import print_function
  3842. print("Loading", "Whizz", "Bang", sep=' ... ')
  3843. %}
  3844. 2013-07-01: wsfulton
  3845. [Python] Apply SF patch #340 - Uninitialized variable fix in SWIG_Python_NonDynamicSetAttr
  3846. when using -builtin.
  3847. 2013-07-01: wsfulton
  3848. [Python, Ruby, Ocaml] Apply SF patch #341 - fix a const_cast in generated code that was generating
  3849. a <:: digraph when using the unary scope operator (::) (global scope) in a template type.
  3850. 2013-07-01: wsfulton
  3851. [Python] Add SF patch #342 from Christian Delbaere to fix some director classes crashing on
  3852. object deletion when using -builtin. Fixes SF bug #1301.
  3853. 2013-06-11: wsfulton
  3854. [Python] Add SWIG_PYTHON_INTERPRETER_NO_DEBUG macro which can be defined to use the Release version
  3855. of the Python interpreter in Debug builds of the wrappers. The Visual Studio .dsp example
  3856. files have been modified to use this so that Debug builds will now work without having
  3857. to install or build a Debug build of the interpreter.
  3858. 2013-06-07: wsfulton
  3859. [Ruby] Git issue #52. Fix regression with missing rb_complex_new function for Ruby
  3860. versions prior to 1.9 using std::complex wrappers if just using std::complex as an output type.
  3861. Also fix the Complex helper functions external visibility (to static by default).
  3862. 2013-06-04: olly
  3863. [PHP] Fix SWIG_ZTS_ConvertResourcePtr() not to dereference NULL
  3864. if the type lookup fails.
  3865. Version 2.0.10 (27 May 2013)
  3866. ============================
  3867. 2013-05-25: wsfulton
  3868. [Python] Fix Python 3 inconsistency when negative numbers are passed
  3869. where a parameter expects an unsigned C type. An OverFlow error is
  3870. now consistently thrown instead of a TypeError.
  3871. 2013-05-25: Artem Serebriyskiy
  3872. SVN Patch ticket #338 - fixes to %attribute macros for template usage
  3873. with %arg.
  3874. 2013-05-19: wsfulton
  3875. Fix ccache-swig internal error bug due to premature file cleanup.
  3876. Fixes SF bug 1319 which shows up as a failure in the ccache tests on
  3877. Debian 64 bit Wheezy, possibly because ENABLE_ZLIB is defined.
  3878. This is a corner case which will be hit when the maximum number of files
  3879. in the cache is set to be quite low (-F option), resulting in a cache miss.
  3880. 2013-05-09: kwwette
  3881. [Octave] Fix bugs in Octave module loading:
  3882. - fix a memory leak in setting of global variables
  3883. - install functions only once, to speed up module loads
  3884. 2013-04-28: gjanssens
  3885. [Guile] Updates in guile module:
  3886. - Add support for guile 2.0
  3887. - Drop support for guile 1.6
  3888. - Drop support for generating wrappers using guile's gh interface.
  3889. All generated wrappers will use the scm interface from now on.
  3890. - Deprecate -gh and -scm options. They are no longer needed.
  3891. A warning will be issued when these options are still used.
  3892. - Fix all tests and examples to have a successful travis test
  3893. 2013-04-18: wsfulton
  3894. Apply Patch #36 from Jesus Lopez to add support for $descriptor() special variable macro expansion
  3895. in fragments. For example:
  3896. %fragment("nameDescriptor", "header")
  3897. %{
  3898. static const char *nameDescriptor = "$descriptor(Name)";
  3899. %}
  3900. which will generate into the wrapper if the fragment is used:
  3901. static const char *nameDescriptor = "SWIGTYPE_Name";
  3902. 2013-04-18: wsfulton
  3903. Fix SF Bug #428 - Syntax error when preprocessor macros are defined inside of enum lists, such as:
  3904. typedef enum {
  3905. eZero = 0
  3906. #define ONE 1
  3907. } EFoo;
  3908. The macros are silently ignored.
  3909. 2013-04-17: wsfulton
  3910. [C#] Pull patch #34 from BrantKyser to fix smart pointers in conjunction with directors.
  3911. 2013-04-15: kwwette
  3912. [Octave] Fix bugs in output of cleanup code.
  3913. - Cleanup code is now written also after the "fail:" label, so it will be called if
  3914. a SWIG_exception is raised by the wrapping function, consistent with other modules.
  3915. - Octave module now also recognises the "$cleanup" special variable, if needed.
  3916. 2013-04-08: kwwette
  3917. Add -MP option to SWIG for generating phony targets for all dependencies.
  3918. - Prevents make from complaining if header files have been deleted before
  3919. the dependency file has been updated.
  3920. - Modelled on similar option in GCC.
  3921. 2013-04-09: olly
  3922. [PHP] Add missing directorin typemap for char* and char[] which
  3923. fixes director_string testcase failure.
  3924. 2013-04-05: wsfulton
  3925. [Ruby] SF Bug #1292 - Runtime fixes for Proc changes in ruby-1.9 when using STL
  3926. wrappers that override the default predicate, such as:
  3927. %template(Map) std::map<swig::LANGUAGE_OBJ, swig::LANGUAGE_OBJ, swig::BinaryPredicate<> >;
  3928. 2013-04-05: wsfulton
  3929. [Ruby] SF Bug #1159 - Correctly check rb_respond_to call return values to fix some
  3930. further 1.9 problems with functors and use of Complex wrappers.
  3931. 2013-04-02: wsfulton
  3932. [Ruby] Runtime fixes for std::complex wrappers for ruby-1.9 - new native Ruby complex numbers are used.
  3933. 2013-03-30: wsfulton
  3934. [Ruby] Fix seg fault when using STL containers of generic Ruby types, GC_VALUE or LANGUAGE_OBJECT,
  3935. on exit of the Ruby interpreter. More frequently observed in ruby-1.9.
  3936. 2013-03-29: wsfulton
  3937. [Ruby] Fix delete_if (reject!) for the STL container wrappers which previously would
  3938. sometimes seg fault or not work.
  3939. 2013-03-25: wsfulton
  3940. [Python] Fix some undefined behaviour deleting slices in the STL containers.
  3941. 2013-03-19: wsfulton
  3942. [C#, Java, D] Fix seg fault in SWIG using directors when class and virtual method names are
  3943. the same except being in different namespaces when the %nspace feature is not being used.
  3944. 2013-02-19: kwwette
  3945. Fix bug in SWIG's handling of qualified (e.g. const) variables of array type. Given the typedef
  3946. a(7).q(volatile).double myarray // typedef volatile double[7] myarray;
  3947. the type
  3948. q(const).myarray // const myarray
  3949. becomes
  3950. a(7).q(const volatile).double // const volatile double[7]
  3951. Previously, SwigType_typedef_resolve() produces the type
  3952. q(const).a(7).q(volatile).double // non-sensical type
  3953. which would never match %typemap declarations, whose types were parsed correctly.
  3954. Add typemap_array_qualifiers.i to the test suite which checks for the correct behaviour.
  3955. 2013-02-18: wsfulton
  3956. Deprecate typedef names used as constructor and destructor names in %extend. The real
  3957. class/struct name should be used.
  3958. typedef struct tagEStruct {
  3959. int ivar;
  3960. } EStruct;
  3961. %extend tagEStruct {
  3962. EStruct() // illegal name, should be tagEStruct()
  3963. {
  3964. EStruct *s = new EStruct();
  3965. s->ivar = ivar0;
  3966. return s;
  3967. }
  3968. ~EStruct() // illegal name, should be ~tagEStruct()
  3969. {
  3970. delete $self;
  3971. }
  3972. }
  3973. For now these trigger a warning:
  3974. extend_constructor_destructor.i:107: Warning 522: Use of an illegal constructor name 'EStruct' in
  3975. %extend is deprecated, the constructor name should be 'tagEStruct'.
  3976. extend_constructor_destructor.i:111: Warning 523: Use of an illegal destructor name 'EStruct' in
  3977. %extend is deprecated, the destructor name should be 'tagEStruct'.
  3978. These %extend destructor and constructor names were valid up to swig-2.0.4, however swig-2.0.5 ignored
  3979. them altogether for C code as reported in SF bug #1306. The old behaviour of using them has been
  3980. restored for now, but is officially deprecated. This does not apply to anonymously defined typedef
  3981. classes/structs such as:
  3982. typedef struct {...} X;
  3983. 2013-02-17: kwwette
  3984. When generating functions provided by %extend, use "(void)" for no-argument functions
  3985. instead of "()". This prevents warnings when compiling with "gcc -Wstrict-prototypes".
  3986. 2013-02-17: kwwette
  3987. [Octave] Minor fix to autodoc generation: get the right type for functions returning structs.
  3988. 2013-02-15: wsfulton
  3989. Deprecate typedef names used in %extend that are not the real class/struct name. For example:
  3990. typedef struct StructBName {
  3991. int myint;
  3992. } StructB;
  3993. %extend StructB {
  3994. void method() {}
  3995. }
  3996. will now trigger a warning:
  3997. swig_extend.i:19: Warning 326: Deprecated %extend name used - the struct name StructBName
  3998. should be used instead of the typedef name StructB.
  3999. This is only partially working anyway (the %extend only worked if placed after the class
  4000. definition).
  4001. 2013-02-09: wsfulton
  4002. [CFFI] Apply patch #22 - Fix missing package before &body
  4003. 2013-01-29: wsfulton
  4004. [Java] Ensure 'javapackage' typemap is used as it stopped working from version 2.0.5.
  4005. 2013-01-28: wsfulton
  4006. [Python] Apply patch SF #334 - Fix default value conversions "TRUE"->True, "FALSE"->False.
  4007. 2013-01-28: wsfulton
  4008. [Java] Apply patch SF #335 - Truly ignore constructors in directors with %ignore.
  4009. 2013-01-18: Brant Kyser
  4010. [Java] Patch #15 - Allow the use of the nspace feature without the -package commandline option.
  4011. This works as long and the new jniclasspackage pragma is used to place the JNI intermediate class
  4012. into a package and the nspace feature is used to place all exposed types into a package.
  4013. 2013-01-15: wsfulton
  4014. Fix Visual Studio examples to work when SWIG is unzipped into a directory containing spaces.
  4015. 2013-01-15: wsfulton
  4016. [C#] Fix cstype typemap lookup for member variables so that a fully qualified variable name
  4017. matches. For example:
  4018. %typemap(cstype) bool MVar::mvar "MyBool"
  4019. struct MVar {
  4020. bool mvar;
  4021. };
  4022. 2013-01-11: Brant Kyser
  4023. [Java, C#, D] SF Bug #1299 - Fix generated names for when %nspace is used on
  4024. classes with the same name in two different namespaces.
  4025. 2013-01-11: Vladimir Kalinin
  4026. [C#] Add support for csdirectorin 'pre', 'post' and 'terminator' attributes.
  4027. 2013-01-08: olly
  4028. [PHP] Fix to work with a ZTS build of PHP (broken in 2.0.7).
  4029. 2013-01-07: olly
  4030. Fix bashism in configure, introduced in 2.0.9.
  4031. 2013-01-06: wsfulton
  4032. Pull patch #4 from ptomulik to fix SF Bug #1296 - Fix incorrect warning for virtual destructors
  4033. in templates, such as:
  4034. Warning 521: Illegal destructor name B< A >::~B(). Ignored.
  4035. 2013-01-05: wsfulton
  4036. [Python] Pull patch #3 from ptomulik to fix SF Bug #1295 - standard exceptions as
  4037. classes using the SWIG_STD_EXCEPTIONS_AS_CLASSES macro.
  4038. 2013-01-04: wsfulton
  4039. [Java] Pull patch #2 from BrantKyser to fix SF Bug #1283 - fix smart pointers in conjuction
  4040. with directors.
  4041. 2013-01-03: wsfulton
  4042. [Java] Pull patch #1 from BrantKyser to fix SF Bug #1278 - fix directors and nspace feature when
  4043. multilevel namespaces are used.
  4044. Version 2.0.9 (16 December 2012)
  4045. ================================
  4046. 2012-12-16: wsfulton
  4047. Fix garbage line number / empty file name reporting for some missing
  4048. '}' or ')' error messages.
  4049. 2012-12-15: kkaempf
  4050. [Ruby] Apply patch 3530444, Class#methods and Class#constants returns array of
  4051. symbols in Ruby 1.9+
  4052. 2012-12-14: kkaempf
  4053. [Ruby] Apply patch 3530439 and finally replace all occurrences of the STR2CSTR() macro
  4054. with StringValuePtr(). STR2CSTR was deprecated since years and got removed in Ruby 1.9
  4055. 2012-12-14: kkaempf
  4056. [Ruby] Applied patches #3530442 and 3530443 to adapt compile and runtime include
  4057. paths to match Ruby 1.9+
  4058. 2012-12-14: wsfulton
  4059. [CFFI] Fix #3161614 - Some string constants are incorrect
  4060. 2012-12-13: wsfulton
  4061. [CFFI] Fix #3529690 - Fix incorrect constant names.
  4062. 2012-12-12: drjoe
  4063. [R] add fix to finalizer that was missed earlier
  4064. 2012-12-11: wsfulton
  4065. [Python] Apply patch #3590522 - fully qualified package paths for Python 3 even if a module is in the
  4066. same package.
  4067. 2012-12-08: wsfulton
  4068. [Python] Bug #3563647 - PyInt_FromSize_t unavailable prior to Python 2.5 for unsigned int types.
  4069. 2012-12-08: wsfulton
  4070. [Perl] Fix bug #3571361 - C++ comment in C wrappers.
  4071. 2012-12-07: wsfulton
  4072. [C#] Apply patch #3571029 which adds missing director support for const unsigned long long &.
  4073. 2012-11-28: kwwette
  4074. [Octave] Simplified module loading: now just the syntax
  4075. $ example;
  4076. is accepted, which loads functions globally but constants and variables relative to the current scope.
  4077. This make module loading behaviour reliably consistent, and reduces problems when loading modules which
  4078. depend on other modules which may not have been previously loaded.
  4079. 2012-11-27: wsfulton
  4080. [cffi] Fix junk output when wrapping single character literal constants.
  4081. 2012-11-17: wsfulton
  4082. [Tcl, Modula3] Add missing support for -outdir.
  4083. 2012-11-17: wsfulton
  4084. Fix segfaults when using filename paths greater than 1024 characters in length.
  4085. 2012-11-14: wsfulton
  4086. [ccache-swig] Apply patch #3586392 from Frederik Deweerdt to fix some error cases - incorrectly using
  4087. memory after it has been deleted.
  4088. 2012-11-09: vzeitlin
  4089. [Python] Fix overflow when passing values greater than LONG_MAX from Python 3 for parameters with unsigned long C type.
  4090. 2012-11-09: wsfulton
  4091. Fix some feature matching issues for implicit destructors and implicit constructors and implicit
  4092. copy constructors added with %copyctor. Previously a feature for these had to be fully qualified
  4093. in order to match. Now the following will also match:
  4094. %feature("xyz") ~XXX();
  4095. struct XXX {};
  4096. 2012-11-09: wsfulton
  4097. Further consistency in named output typemap lookups for implicit constructors and destructors and
  4098. implicit copy constructors added with %copyctor. Previously only the fully qualified name was being
  4099. used, now the unqualified name will also be used. For example, previously:
  4100. example.i:38: Searching for a suitable 'out' typemap for: void Space::More::~More
  4101. Looking for: void Space::More::~More
  4102. Looking for: void
  4103. Now the unqualified name is also used:
  4104. example.i:38: Searching for a suitable 'out' typemap for: void Space::More::~More
  4105. Looking for: void Space::More::~More
  4106. Looking for: void ~More
  4107. Looking for: void
  4108. 2012-11-02: wsfulton
  4109. Fix some subtle named output typemap lookup misses, the fully qualified name was not always being
  4110. used for variables, for example:
  4111. struct Glob {
  4112. int MyVar;
  4113. };
  4114. Previously the search rules (as shown by -debug-tmsearch) for the getter wrapper were:
  4115. example.i:44: Searching for a suitable 'out' typemap for: int MyVar
  4116. Looking for: int MyVar
  4117. Looking for: int
  4118. Now the scope is named correctly:
  4119. example.i:44: Searching for a suitable 'out' typemap for: int Glob::MyVar
  4120. Looking for: int Glob::MyVar
  4121. Looking for: int MyVar
  4122. Looking for: int
  4123. 2012-10-26: wsfulton
  4124. Fix director typemap searching so that a typemap specified with a name will be correctly matched. Previously
  4125. the name was ignored during the typemap search. Applies to the following list of typemaps:
  4126. directorout, csdirectorout, cstype, imtype, ctype, ddirectorout, dtype, gotype, jtype, jni, javadirectorout.
  4127. 2012-10-11: wsfulton
  4128. Most of the special variables available for use in %exception are now also available for expansion in
  4129. %extend blocks. These are: $name $symname $overname $decl $fulldecl $parentclassname $parentclasssymname, see docs
  4130. on "Class extension" in SWIGPlus.html. Patch based on submission from Kris Thielemans.
  4131. 2012-10-10: wsfulton
  4132. Additional new special variables in %exception are expanded as follows:
  4133. $parentclassname - The parent class name (if any) for a method.
  4134. $parentclasssymname - The target language parent class name (if any) for a method.
  4135. 2012-10-08: iant
  4136. [Go] Generating Go code now requires using the -intgosize option to
  4137. indicate the size of the 'int' type in Go. This is because the
  4138. size of the type is changing from Go 1.0 to Go 1.1 for x86_64.
  4139. 2012-09-14: wsfulton
  4140. Add new warning if the empty template instantiation is used as a base class, for example:
  4141. template <typename T> class Base {};
  4142. %template() Base<int>;
  4143. class Derived : public Base<int> {};
  4144. gives the following warning instead of silently ignoring the base:
  4145. cpp_inherit.i:52: Warning 401: Base class 'Base< int >' has no name as it is an empty template instantiated with '%template()'. Ignored.
  4146. cpp_inherit.i:51: Warning 401: The %template directive must be written before 'Base< int >' is used as a base class and be declared with a name.
  4147. 2012-09-11: wsfulton
  4148. [Java] Fix #3535304 - Direct use of a weak global reference in directors
  4149. sometimes causing seg faults especially on Android.
  4150. 2012-09-06: wsfulton
  4151. [Java] Fix (char *STRING, size_t LENGTH) typemaps to accept NULL string.
  4152. 2012-08-26: drjoe
  4153. [R] make ExternalReference slot ref to contain reference
  4154. 2012-08-26: drjoe
  4155. [R] fix Examples/Makefile to use C in $(CC) rather than $(CXX)
  4156. Version 2.0.8 (20 August 2012)
  4157. ==============================
  4158. 2012-08-15: wsfulton
  4159. [Perl] Add size_type, value_type, const_reference to the STL containers.
  4160. 2012-08-15: wsfulton
  4161. [Python] Add discard and add methods to std::set wrappers so that pyabc.i can be used ensuring
  4162. MutableSet is a valid abstract base class for std::set. As reported by Alexey Sokolov.
  4163. Similarly for std::multiset.
  4164. 2012-08-15: wsfulton
  4165. [Python] Fix #3541744 - Missing PyInt_FromSize_t calls for Python 3.
  4166. 2012-08-13: wsfulton
  4167. [Java] Patch from David Baum to add the assumeoverride feature for Java directors to
  4168. improve performance when all overridden methods can be assumed to be overridden.
  4169. 2012-08-05: wsfulton
  4170. [Python] #3530021 Fix unused variable warning.
  4171. 2012-08-05: wsfulton
  4172. [C#] Fix #3536360 - Invalid code sometimes being generated for director methods
  4173. with many arguments.
  4174. 2012-08-05: wsfulton
  4175. [Perl] #3545877 - Don't undefine bool if defined by C99 stdbool.h - problem using
  4176. Perl 5.16 and later.
  4177. 2012-08-04: wsfulton
  4178. Remove incorrect warning (314) about target language keywords which were triggered
  4179. by using declarations and using directives. For example 'string' is a keyword in C#:
  4180. namespace std { class string; }
  4181. using std::string;
  4182. 2012-07-21: wsfulton
  4183. Fix display of pointers in various places on 64 bit systems - only 32 bits were being shown.
  4184. 2012-07-21: wsfulton
  4185. Fix gdb debugger functions 'swigprint' and 'locswigprint' to display to the gdb output window
  4186. rather than stdout. This fixes display problems in gdbtui and the ensures the output
  4187. appears where expected in other gdb based debuggers such as Eclipse CDT.
  4188. 2012-07-20: kwwette
  4189. [Octave] segfault-on-exit prevention hack now preserves exit status, and uses C99 _Exit().
  4190. 2012-07-02: wsfulton
  4191. Fix Debian bug http://bugs.debian.org/672035, typemap copy failure - regression introduced
  4192. in swig-2.0.5:
  4193. %include<stl.i>
  4194. using std::pair;
  4195. %template(StrPair) pair<std::string, std::string>;
  4196. 2012-07-02: wsfulton
  4197. Fix using declarations combined with using directives with forward class declarations so that
  4198. types are correctly found in scope for templates. Example:
  4199. namespace Outer2 {
  4200. namespace Space2 {
  4201. template<typename T> class Thing2;
  4202. }
  4203. }
  4204. using namespace Outer2;
  4205. using Space2::Thing2;
  4206. template<typename T> class Thing2 {};
  4207. // STILL BROKEN void useit2(Thing2<int> t) {}
  4208. void useit2a(Outer2::Space2::Thing2<int> t) {}
  4209. void useit2b(::Outer2::Space2::Thing2<int> t) {}
  4210. void useit2c(Space2::Thing2<int> t) {}
  4211. namespace Outer2 {
  4212. void useit2d(Space2::Thing2<int> t) {}
  4213. }
  4214. %template(Thing2Int) Thing2<int>;
  4215. 2012-06-30: wsfulton
  4216. Fix template namespace problems for symbols declared with a forward class declarations, such as:
  4217. namespace Space1 {
  4218. namespace Space2 {
  4219. template<typename T> struct YYY;
  4220. }
  4221. template<typename T> struct Space2::YYY {
  4222. T yyy(T h) {
  4223. return h;
  4224. }
  4225. };
  4226. void testYYY1(Space1::Space2::YYY<int> yy) {}
  4227. void testYYY2(Space2::YYY<int> yy) {}
  4228. void testYYY3(::Space1::Space2::YYY<int> yy) {}
  4229. }
  4230. %template(YYYInt) Space1::Space2::YYY<int>;
  4231. 2012-06-30: wsfulton
  4232. Fix namespace problems for symbols declared with a forward class declarations, such as:
  4233. namespace Space1 {
  4234. namespace Space2 {
  4235. struct XXX;
  4236. struct YYY;
  4237. }
  4238. struct Space2::YYY {};
  4239. struct Space1::Space2::XXX {};
  4240. void testXXX2(Space2::XXX xx) {}
  4241. void testYYY2(Space2::YYY yy) {}
  4242. }
  4243. where xx and yy were not recognised as the proxy classes XXX and YYY.
  4244. 2012-06-30: wsfulton
  4245. Fix using declarations combined with using directives with forward class declarations so that
  4246. types are correctly found in scope.
  4247. namespace Outer2 {
  4248. namespace Space2 {
  4249. class Thing2;
  4250. }
  4251. }
  4252. using namespace Outer2;
  4253. using Space2::Thing2;
  4254. class Thing2 {};
  4255. // None of the methods below correctly used the Thing2 proxy class
  4256. void useit2(Thing2 t) {}
  4257. void useit2a(Outer2::Space2::Thing2 t) {}
  4258. void useit2b(::Outer2::Space2::Thing2 t) {}
  4259. void useit2c(Space2::Thing2 t) {}
  4260. namespace Outer2 {
  4261. void useit2d(Space2::Thing2 t) {}
  4262. }
  4263. 2012-06-25: wsfulton
  4264. Fix using declarations combined with using directives so that types are correctly found in scope.
  4265. Example:
  4266. namespace Outer2 {
  4267. namespace Space2 {
  4268. class Thing2 {};
  4269. }
  4270. }
  4271. using namespace Outer2; // using directive
  4272. using Space2::Thing2; // using declaration
  4273. void useit2(Thing2 t) {}
  4274. Similarly for templated classes.
  4275. 2012-05-29: wsfulton
  4276. Fix #3529601 - seg fault when a protected method has the "director"
  4277. feature but the parent class does not. Also fix similar problems with
  4278. the allprotected feature.
  4279. 2012-05-28: wsfulton
  4280. Fix seg fault when attempting to warn about an illegal destructor - #3530055, 3530078 and #3530118.
  4281. Version 2.0.7 (26 May 2012)
  4282. ===========================
  4283. 2012-05-26: wsfulton
  4284. std::string typemap modifications so they can be used with %apply for other string
  4285. classes.
  4286. 2012-05-25: wsfulton
  4287. [Lua] Fixes for -external-runtime to work again.
  4288. 2012-05-22: szager
  4289. [python] Disambiguate SWIG_From_unsigned_SS_int and SWIG_From_unsigned_SS_long.
  4290. 2012-05-18: olly
  4291. [PHP] Fix getters for template members. (SF#3428833, SF#3528035)
  4292. 2012-05-14: wsfulton
  4293. Fix some language's std::map wrappers to recognise difference_type, size_type, key_type
  4294. and mapped_type.
  4295. 2012-05-14: kwwette (signed off by xavier98)
  4296. [Octave] Prevent Octave from seg-faulting at exit when SWIG
  4297. modules are loaded, due to bugs in Octave's cleanup code:
  4298. * Wrapping functions now declared with Octave DEFUN_DLD macro,
  4299. and loaded through Octave's dynamic module loader
  4300. * Global variables of swigref type are now assigned a new()
  4301. copy of the swigref class, to prevent double-free errors
  4302. * SWIG module at-exit cleanup function now created in Octave
  4303. through eval(), so not dependent on loaded .oct library
  4304. * For Octave versions 3.1.* to 3.3.*, register C-level at-exit
  4305. function which terminates Octave immediately (with correct
  4306. status code) without performing memory cleanup. This function
  4307. can be controlled with macros in Lib/octave/octruntime.swg
  4308. [Octave] New syntax for determing whether SWIG module should be
  4309. loaded globally or non-globally. To load module "example" globally,
  4310. type the module name
  4311. $ example;
  4312. as before; to load module non-globally, assign it to a variable:
  4313. $ example = example;
  4314. or
  4315. $ ex = example;
  4316. for a shorter (local) module name. -global/-noglobal command-line
  4317. options and module command line are deprecated. Added usage info
  4318. to module, so typing
  4319. $ help example
  4320. or incorrect usage should display proper usage, with examples.
  4321. *** POTENTIAL INCOMPATIBILITY ***
  4322. 2012-05-12: olly
  4323. [PHP] Fix memory leak in code generated for a callback. Patch from
  4324. SF bug #3510806.
  4325. 2012-05-12: olly
  4326. [PHP] Avoid using zend_error_noreturn() as it doesn't work with all
  4327. builds of PHP (SF bug #3166423). Instead we now wrap it in a
  4328. SWIG_FAIL() function which we annotate as "noreturn" for GCC to
  4329. avoids warnings. This also reduces the size of the compiled
  4330. wrapper (e.g. the stripped size is reduced by 6% for Xapian's PHP
  4331. bindings).
  4332. 2012-05-11: wsfulton
  4333. [Java] SF patch #3522855 Fix unintended uninitialised memory access in OUTPUT typemaps.
  4334. 2012-05-11: wsfulton
  4335. [Java] SF patch #3522674 Fix possible uninitialised memory access in char **STRING_OUT
  4336. typemap.
  4337. 2012-05-11: wsfulton
  4338. [Java] SF patch #3522611 Fix uninitialised size regression in char **STRING_ARRAY
  4339. introduced in swig-2.0.6.
  4340. 2012-05-11: wsfulton
  4341. SF bug #3525050 - Fix regression introduced in swig-2.0.5 whereby defining one typemap
  4342. method such as an 'out' typemap may hide another typemap method such as an 'in' typemap -
  4343. only occurs when the type is a template type where the template parameters are the same
  4344. via a typedef.
  4345. 2012-05-10: olly
  4346. [PHP] Fix the constant typemaps for SWIGTYPE, etc - previously
  4347. these used the wrong name for renamed constants. Add
  4348. autodoc_runme.php to the testsuite as a regression test for this.
  4349. 2012-05-02: ianlancetaylor
  4350. [Go] Remove compatibility support for gccgo 4.6. Using
  4351. SWIG with gccgo will now require gccgo 4.7. Using SWIG
  4352. with the more commonly used gc compiler is unaffected.
  4353. 2012-05-01: wsfulton
  4354. Fix generated code for C forward enum declarations in some languages.
  4355. Version 2.0.6 (30 April 2012)
  4356. =============================
  4357. 2012-04-25: wsfulton
  4358. [Lua] Fix uninitialised variable in SWIGTYPE **OUTPUT typemaps as reported by Jim Anderson.
  4359. 2012-04-28: wsfulton
  4360. [Python] Fix compilation errors when wrapping STL containers on Mac OS X and possibly other systems.
  4361. 2012-04-28: wsfulton
  4362. [Java] Patch 3521811 from Leo Davis - char **STRING_ARRAY typemaps fixed to handle
  4363. null pointers.
  4364. Version 2.0.5 (19 April 2012)
  4365. =============================
  4366. 2012-04-14: wsfulton
  4367. [Lua] Apply patch #3517435 from Miles Bader - prefer to use Lua_pushglobaltable
  4368. 2012-04-14: wsfulton
  4369. [Ruby] Apply patch #3517769 from Robin Stocker to fix compile error on MacRuby using RSTRING_PTR.
  4370. 2012-04-13: wsfulton
  4371. Apply patch #3511009 from Leif Middelschulte for slightly optimised char * variable wrappers.
  4372. 2012-04-13: wsfulton
  4373. [Lua] Apply #3219676 from Shane Liesegang which adds:
  4374. - support for %factory
  4375. - a __tostring method
  4376. - a __disown method
  4377. 2012-04-13: wsfulton
  4378. [Xml] Apply #3513569 which adds a catchlist to the xml output.
  4379. 2012-04-05: olly
  4380. [Lua] Add support for Lua 5.2 (patch SF#3514593 from Miles Bader)
  4381. 2012-03-26: xavier98
  4382. [octave] Apply patch #3425993 from jgillis: add extra logic to the octave_swig_type::dims(void) method: it checks if the user has defined a __dims__ method and uses this in stead of returning (1,1)
  4383. [octave] Apply patch #3424833 from jgillis: make is_object return true for swig types
  4384. 2012-03-24: wsfulton
  4385. [D] Apply #3502431 to fix duplicate symbols in multiple modules.
  4386. 2012-03-21: wsfulton
  4387. Fix #3494791 - %$isglobal for %rename matching.
  4388. 2012-03-20: wsfulton
  4389. Fix #3487706 and #3391906 - missing stddef.h include for ptrdiff_t when using %import
  4390. for STL containers and compiling with g++-4.6. An include of stddef.h is now only
  4391. generated when SWIG generates STL helper templates which require ptrdiff_t. If you
  4392. were previously relying on "#include <stddef.h>" always being generated when using a
  4393. %include of an STL header, you may now need to add this in manually.
  4394. 2012-03-16: wsfulton
  4395. Apply patch #3392264 from Sebastien Bine to parse (unsigned) long long types in enum value assignment.
  4396. 2012-03-16: wsfulton
  4397. Apply patch #3505530 from Karl Wette to allow custom allocators in STL string classes for the UTL languages.
  4398. 2012-03-13: wsfulton
  4399. Apply patch #3468362 from Karl Wette to fix %include inside %define.
  4400. 2012-03-13: wsfulton
  4401. [Python, Ruby, Octave, R] Fix #3475492 - iterating through std::vector wrappers of enumerations.
  4402. 2012-02-27: xavier98 (patches from Karl Wette)
  4403. [Octave] Use -globals . to load global variables in module namespace
  4404. [Octave] Comment declaration of unimplemented function swig_register_director
  4405. [Octave] Fix OCTAVE_PATH in octave Makefiles
  4406. [Octave] Add support for std::list - fix li_std_containers_int test
  4407. [Octave] Fix imports test
  4408. 2012-02-16: wsfulton
  4409. [Java] Make generated support functions in arrays_java.i static so that generated code
  4410. from multiple instances of SWIG can be compiled and linked together - problem reported by
  4411. Evan Krause.
  4412. 2012-01-24: wsfulton
  4413. Fix crash with bad regex - bug #3474250.
  4414. 2012-01-24: wsfulton
  4415. [Python] Add Python stepped slicing support to the STL wrappers (std::vector, std::list).
  4416. Assigning to a slice, reading a slice and deleting a slice with steps now work.
  4417. For example:
  4418. %template(vector_i) std::vector<int>
  4419. vi = vector_i(range(10))
  4420. print list(vi)
  4421. vi[1:4:2] = [111, 333]
  4422. print list(vi)
  4423. del vi[3:10:3]
  4424. print list(vi)
  4425. print list(vi[::-1])
  4426. gives (same behaviour as native Python sequences such as list):
  4427. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
  4428. [0, 111, 2, 333, 4, 5, 6, 7, 8, 9]
  4429. [0, 111, 2, 4, 5, 7, 8]
  4430. [8, 7, 5, 4, 2, 111, 0]
  4431. 2012-01-23: klickverbot
  4432. [D] Correctly annotate function pointers with C linkage.
  4433. [D] Exception and Error have become blessed names; removed d_exception_name test case.
  4434. 2012-01-20: wsfulton
  4435. [Python] Fix some indexing bugs in Python STL wrappers when the index is negative, eg:
  4436. %template(vector_i) std::vector<int>
  4437. iv=vector_i([0,1,2,3,4,5])
  4438. iv[-7:]
  4439. now returns [0, 1, 2, 3, 4, 5] instead of [5].
  4440. vv[7:9] = [22,33]
  4441. now returns [0, 1, 2, 3, 4, 5, 22, 33] instead of "index out range" error.
  4442. Also fix some segfaults when replacing ranges, eg when il is a std::list wrapper:
  4443. il[0:2] = [11]
  4444. 2012-01-17: wsfulton
  4445. [Go] Fix forward class declaration within a class when used as a base.
  4446. 2012-01-07: wsfulton
  4447. [C#] Add support for %nspace when using directors.
  4448. 2012-01-06: wsfulton
  4449. [Java] Patch #3452560 from Brant Kyser - add support for %nspace when using directors.
  4450. 2011-12-21: wsfulton
  4451. The 'directorin' typemap now accepts $1, $2 etc expansions instead of having to use workarounds -
  4452. $1_name, $2_name etc.
  4453. 2011-12-20: wsfulton
  4454. [Java] Add (char *STRING, size_t LENGTH) director typemaps.
  4455. 2011-12-20: wsfulton
  4456. [C#, Go, Java, D] Add support for the 'directorargout' typemap.
  4457. 2011-12-20: wsfulton
  4458. [Ocaml, Octave, PHP, Python, Ruby] Correct special variables in 'directorargout' typemap.
  4459. This change will break any 'directorargout' typemaps you may have written. Please change:
  4460. $result to $1
  4461. $input to $result
  4462. Also fix the named 'directorargout' DIRECTOROUT typemaps for these languages which didn't
  4463. previously compile and add in $1, $2 etc expansion.
  4464. *** POTENTIAL INCOMPATIBILITY ***
  4465. 2011-12-10: talby
  4466. [perl5] SWIG_error() now gets decorated with perl source file/line number.
  4467. [perl5] error handling now conforms to public XS api (fixes perl v5.14 issue).
  4468. 2011-12-10: wsfulton
  4469. [Android/Java] Fix directors to compile on Android.
  4470. Added documentation and examples for Android.
  4471. 2011-12-08: vadz
  4472. Bug fix: Handle methods renamed or ignored in the base class correctly in the derived classes
  4473. (they could be sometimes mysteriously not renamed or ignored there before).
  4474. 2011-12-03: klickverbot
  4475. [D] Fix exception glue code for newer DMD 2 versions.
  4476. [D] Do not default to 32 bit glue code for DMD anymore.
  4477. [D] Use stdc.config.c_long/c_ulong to represent C long types.
  4478. 2011-12-01: szager
  4479. [python] Fixed bug 3447426: memory leak in vector.__getitem__.
  4480. 2011-11-30: wsfulton
  4481. [R] Remove C++ comments from generated C code.
  4482. 2011-11-27: olly
  4483. [Python] Fix some warnings when compiling generated wrappers with
  4484. certain GCC warning options (Debian bug #650246).
  4485. 2011-11-28: wsfulton
  4486. Fix #3433541 %typemap(in, numinputs=0) with 10+ arguments.
  4487. 2011-11-28: olly
  4488. [Perl] Fix warnings when compiling generated wrappers with certain
  4489. GCC warning options (Debian bug #436711).
  4490. 2011-11-28: olly
  4491. [PHP] Update keyword list to include keywords added in PHP releases up to 5.3.
  4492. 2011-11-25: wsfulton
  4493. [C#] Provide an easy way to override the default visibility for the proxy class pointer
  4494. constructors and getCPtr() method. The visibility is 'internal' by default and if multiple
  4495. SWIG modules are being used and compiled into different assemblies, then they need to be
  4496. 'public' in order to use the constructor or getCPtr() method from a different assembly.
  4497. Use the following macros to change the visibilities in the proxy and type wrapper class:
  4498. SWIG_CSBODY_PROXY(public, public, SWIGTYPE)
  4499. SWIG_CSBODY_TYPEWRAPPER(public, public, public, SWIGTYPE)
  4500. [Java] Provide an easy way to override the default visibility for the proxy class pointer
  4501. constructors and getCPtr() method. The visibility is 'protected' by default and if multiple
  4502. SWIG modules are being used and compiled into different packages, then they need to be
  4503. 'public' in order to use the constructor or getCPtr() method from a different package.
  4504. Use the following macros to change the visibilities in the proxy and type wrapper class:
  4505. SWIG_JAVABODY_PROXY(public, public, SWIGTYPE)
  4506. SWIG_JAVABODY_TYPEWRAPPER(public, public, public, SWIGTYPE)
  4507. The default for Java has changed from public to protected for the proxy classes. Use the
  4508. SWIG_JAVABODY_PROXY macro above to restore to the previous visibilities.
  4509. *** POTENTIAL INCOMPATIBILITY ***
  4510. 2011-11-22: szager
  4511. [python] Bug 3440044: #ifdef out SWIG_Python_NonDynamicSetAttr if -builtin
  4512. isn't being used, to avoid unnecessary binary incompatibilities between
  4513. python installations.
  4514. 2011-11-17: wsfulton
  4515. Bug fix: Remove root directory from directory search list in Windows.
  4516. 2011-11-13: wsfulton
  4517. [Ruby] Apply patch #3421876 from Robin Stocker to fix #3416818 - same class name in
  4518. different namespaces confusion when using multiple modules.
  4519. 2011-11-11: wsfulton
  4520. Fix pcre-build.sh to work with non-compressed tarballs - problem reported by Adrian Blakely.
  4521. 2011-11-03: wsfulton
  4522. Expand special variables in typemap warnings, eg:
  4523. %typemap(in, warning="1000:Test warning for 'in' typemap for $1_type $1_name") int "..."
  4524. 2011-11-01: wsfulton
  4525. Fix named output typemaps not being used when the symbol uses a qualifier and contains
  4526. a number, eg:
  4527. %typemap(out) double ABC::m1 "..."
  4528. 2011-10-24: talby
  4529. [perl5] SF bug #3423119 - overload dispatch stack corruption fix. Better, but more research
  4530. is needed on a stable path for tail calls in XS.
  4531. Also, fix for large long longs in 32 bit perl.
  4532. 2011-10-13: xavier98
  4533. [octave] Allow Octave modules to be re-loaded after a "clear all".
  4534. 2011-09-19: wsfulton
  4535. Fix regression introduced in swig-2.0.1 reported by Teemu Ikonone leading to uncompilable code
  4536. when using typedef and function pointer references, for example:
  4537. typedef int FN(const int &a, int b);
  4538. void *typedef_call1(FN *& precallback, FN * postcallback);
  4539. 2011-09-14: wsfulton
  4540. [Lua] Patch #3408012 from Raman Gopalan - add support for embedded Lua (eLua)
  4541. including options for targeting Lua Tiny RAM (LTR).
  4542. 2011-09-14: wsfulton
  4543. [C#] Add boost_intrusive_ptr.i library contribution from patch #3401571.
  4544. 2011-09-13: wsfulton
  4545. Add warnings for badly named destructors, eg:
  4546. struct KStruct {
  4547. ~NOT_KStruct() {}
  4548. };
  4549. cpp_extend_destructors.i:92: Warning 521: Illegal destructor name ~NOT_KStruct. Ignored.
  4550. 2011-09-13: wsfulton
  4551. Fix %extend and destructors for templates. The destructor in %extend was not always wrapped,
  4552. for example:
  4553. %extend FooT {
  4554. ~FooT() { delete $self; } // was not wrapped as expected
  4555. };
  4556. template<class T> class FooT {};
  4557. %template(FooTi) FooT<int>;
  4558. 2011-09-13: wsfulton
  4559. Fix special variables such as "$decl" and "$fulldecl" in destructors to include the ~ character.
  4560. 2011-09-10: talby
  4561. [perl5] SF bug #1481958 - Improve range checking for integer types.
  4562. Enhance li_typemaps_runme.pl
  4563. 2011-09-08: wsfulton
  4564. Fix %extend on typedef classes in a namespace using the typedef name, for example:
  4565. namespace Space {
  4566. %extend CStruct {
  4567. ...
  4568. }
  4569. typedef struct tagCStruct { ... } CStruct;
  4570. }
  4571. 2011-08-31: xavier98
  4572. [octave] patches from Karl Wette: improvements to module loading behavior;
  4573. added example of friend operator to operator example; fixed octave panic/crash in 3.0.5;
  4574. documentation improvements
  4575. 2011-08-30: szager
  4576. [python] Bug 3400486, fix error signalling for built-in constructors.
  4577. 2011-08-26: wsfulton
  4578. [Go] Fix file/line number display for "gotype" when using typemap debugging options
  4579. -tmsearch and -tmused.
  4580. 2011-08-26: wsfulton
  4581. [C#, D] Fix %callback which was generating uncompilable code.
  4582. 2011-08-25: wsfulton
  4583. Fix constructors in named typedef class declarations as reported by Gregory Bronner:
  4584. typedef struct A {
  4585. A(){} // Constructor which was not accepted by SWIG
  4586. B(){} // NOT a constructor --illegal, but was accepted by SWIG
  4587. } B;
  4588. For C code, the fix now results in the use of 'struct A *' instead of just 'B *' in
  4589. the generated code when wrapping members in A, but ultimately this does not matter, as
  4590. they are the same thing.
  4591. 2011-08-23: wsfulton
  4592. Fix %newobject when used in conjunction with %feature("ref") as reported by Jan Becker. The
  4593. code from the "ref" feature was not always being generated for the function specified by %newobject.
  4594. Documentation for "ref" and "unref" moved from Python to the C++ chapter.
  4595. 2011-08-22: szager
  4596. [python] Fixed memory leak with --builtin option (bug 3385089).
  4597. 2011-08-22: wsfulton
  4598. [Lua] SF patch #3394339 from Torsten Landschoff - new option -nomoduleglobal to disable installing
  4599. the module table into the global namespace. Require call also returns the module table instead
  4600. of a string.
  4601. 2011-08-09: xavier98
  4602. Fix bug 3387394; Octave patches for 3.4.0 compatibility, etc. (from Karl Wette)
  4603. 2011-08-04: wsfulton
  4604. Add in $symname expansion for director methods.
  4605. 2011-07-29: olly
  4606. [PHP] Don't generate "return $r;" in cases where $r hasn't been set.
  4607. This was basically harmless, except it generated a PHP E_NOTICE if
  4608. the calling code had enabled them.
  4609. 2011-07-26: wsfulton
  4610. Fix scoping of forward class declarations nested within a class (for C++). Previously the symbol
  4611. was incorrectly put into the outer namespace, eg
  4612. namespace std {
  4613. template<class Key, class T> struct map {
  4614. class iterator;
  4615. };
  4616. }
  4617. iterator was scoped as std::iterator, but now it is correctly std::map<Key, T>::iterator;
  4618. Also fixed is %template and template parameters that are a typedef when the template contains
  4619. default template parameters, eg:
  4620. namespace Std {
  4621. template<class Key, class T, class C = int> struct Map {
  4622. typedef Key key_type;
  4623. typedef T mapped_type;
  4624. };
  4625. }
  4626. typedef double DOUBLE;
  4627. %template(MM) Std::Map<int, DOUBLE>;
  4628. All symbols within Map will be resolved correctly, eg key_type and mapped_type no matter if the
  4629. wrapped code uses Std::Map<int, double> or std::Map<int, DOUBLE> or Std::Map<int, double, int>
  4630. Also fixes bug #3378145 - regression introduced in 2.0.4 - %template using traits.
  4631. 2011-07-20 szager
  4632. [python] Fix closure for tp_call slot.
  4633. 2011-07-16: wsfulton
  4634. [python] Fix director typemap using PyObject *.
  4635. 2011-07-13: szager
  4636. [python] SF patch #3365908 - Add all template parameters to map support code in std_map.i
  4637. 2011-07-13: szager
  4638. [python] Fix for bug 3324753: %rename member variables with -builtin.
  4639. 2011-07-01: wsfulton
  4640. Fix some scope and symbol lookup problems when template default parameters are being
  4641. used with typedef. For example:
  4642. template<typename XX, typename TT = SomeType> struct Foo {
  4643. typedef XX X;
  4644. typedef TT T;
  4645. };
  4646. template<typename TT> struct UsesFoo {
  4647. void x(typename Foo<TT>::T, typename Foo<TT>::X);
  4648. };
  4649. Also fixes use of std::vector<int>::size_type for Python as reported by Aubrey Barnard.
  4650. 2011-06-23: olly
  4651. [PHP] Fix director code to work when PHP is built with ZTS enabled,
  4652. which is the standard configuration on Microsoft Windows.
  4653. 2011-06-21: mutandiz
  4654. [allegrocl]
  4655. - various small tweaks and bug fixes.
  4656. - Avoid name conflicts between smart pointer wrappers and the wrappers for
  4657. the actual class.
  4658. - Fix default typemaps for C bindings, which were incorrectly attempting to
  4659. call non-existent destructors on user-defined types.
  4660. - New feature, feature:aclmixins, for adding superclass to the foreign class
  4661. wrappers.
  4662. - Improve longlong typemaps.
  4663. 2011-06-19: wsfulton
  4664. Fix incorrect typemaps being used for a symbol within a templated type, eg:
  4665. A<int>::value_type would incorrectly use a typemap for type A.
  4666. 2011-06-18: olly
  4667. [Tcl] Fix variable declarations in middle of blocks which isn't
  4668. permitted in C90 (issue probably introduced in 2.0.3 by patch #3224663).
  4669. Reported by Paul Obermeier in SF#3288586.
  4670. 2011-06-17: wsfulton
  4671. [Java] SF #3312505 - slightly easier to wrap char[] or char[ANY] with a Java byte[]
  4672. using arrays_java.i.
  4673. 2011-06-13: wsfulton
  4674. [Ruby, Octave] SF #3310528 Autodoc fixes similar to those described below for Python.
  4675. 2011-06-10: wsfulton
  4676. [Python] Few subtle bugfixes in autodoc documentation generation,
  4677. - Unnamed argument names fix for autodoc levels > 0.
  4678. - Display of template types fixed for autodoc levels > 1.
  4679. - Fix SF #3310528 - display of typedef structs for autodoc levels > 1.
  4680. - Add missing type for self for autodoc levels 1 and 3.
  4681. - autodoc levels 2 and 3 documented.
  4682. - Minor tweaks to autodoc style to conform with PEP8.
  4683. 2011-05-30: olly
  4684. [PHP] Fix handling of directors when -prefix is used.
  4685. 2011-05-24: olly
  4686. [PHP] Fix handling of methods of classes with a virtual base class (SF#3124665).
  4687. Version 2.0.4 (21 May 2011)
  4688. ===========================
  4689. 2011-05-19: wsfulton
  4690. [Guile] Patch #3191625 fixing overloading of integer types.
  4691. 2011-05-19: wsfulton
  4692. [Perl] Patch #3260265 fixing overloading of non-primitive types and integers in
  4693. Perl 5.12 and later.
  4694. 2011-05-19: wsfulton
  4695. [Ruby] Fix %import where one of the imported files %include one of the STL include
  4696. files such as std_vector.i.
  4697. 2011-05-17: wsfulton
  4698. [Java] Apply #3289851 from Alan Harder to fix memory leak in directors when checking
  4699. for pending exceptions.
  4700. 2011-05-17: wsfulton
  4701. [Tcl] Apply #3300072 from Christian Delbaere to fix multiple module loading not
  4702. always sharing variables across modules.
  4703. 2011-05-16: xavier98
  4704. [octave] Fix an incompatibility with never versions of Octave. Case on Octave
  4705. API >= 40 to handle rename of Octave_map to octave_map.
  4706. [octave] Add support for y.__rop__(x) operators when x.__op__(y) doesn't exist.
  4707. [octave] Allow global operators to be defined by SWIG-wrapped functions.
  4708. [octave] Fix several bugs around module namespaces; add -global, -noglobal,
  4709. -globals <name> command line options to the module.
  4710. 2011-05-14: wsfulton
  4711. %varargs when used with a numeric argument used to create an additional argument
  4712. which was intended to provide a guaranteed sentinel value. This never worked and now
  4713. the additional argument is not generated.
  4714. 2011-05-13: wsfulton
  4715. [python] Additional fixes for python3.2 support.
  4716. 2011-05-07: szager
  4717. [python] Fixed PyGetSetDescr for python3.2.
  4718. 2011-05-05: wsfulton
  4719. [Lua, Python, Tcl] C/C++ prototypes shown in error message when calling an overloaded
  4720. method with incorrect arguments improved to show always show fully qualified name
  4721. and if a const method.
  4722. Also fixed other Lua error messages in generated code which weren't consistently
  4723. using the fully qualified C++ name - requested by Gedalia Pasternak.
  4724. 2011-04-29: szager
  4725. Bug 2635919: Convenience method to convert std::map to a python dict.
  4726. 2011-04-29: szager
  4727. [Python] Fixed bug 2811549: return non-const iterators from STL
  4728. methods begin(), end(), rbegin(), rend().
  4729. 2011-04-25: szager
  4730. [Python] Fixed bug 1498929: Access to member fields in map elements
  4731. 2011-04-23: klickverbot
  4732. [D] nspace: Correctly generate identifiers for base classes when
  4733. not in split proxy mode.
  4734. 2011-04-13: szager
  4735. Fixed bug 3286333: infinite recursion with mutual 'using namespace' clauses.
  4736. 2011-04-12: szager
  4737. Fixed bug 1163440: vararg typemaps.
  4738. 2011-04-12: szager
  4739. Fixed bug #3285386: parse error from 'operator T*&()'. Added operator_pointer_ref
  4740. test case to demonstrate.
  4741. 2011-04-11: szager
  4742. [Python] Fixed PyVarObject_HEAD_INIT to eliminate VC++ compiler errors about
  4743. static initialization of struct members with pointers.
  4744. 2011-04-11: wsfulton
  4745. [Tcl] Apply patch #3284326 from Colin McDonald to fix some compiler warnings.
  4746. 2011-04-11: szager
  4747. [Python] Fixed PyVarObject_HEAD_INIT to eliminate VC++ compiler errors about
  4748. static initialization of struct members with pointers.
  4749. 2011-04-10: klickverbot
  4750. [D] Fixed wrapping of enums that are type char, for example:
  4751. enum { X = 'X'; } (this was already in 2.0.3 for C# and Java)
  4752. 2011-04-10: klickverbot
  4753. [D] nspace: Fixed referencing types in the root namespace when
  4754. not in split proxy mode.
  4755. 2011-04-09: szager
  4756. [Python] Applied patch #1932484: migrate PyCObject to PyCapsule.
  4757. 2011-04-09: szager
  4758. [Python] Added preprocessor guards for python functions PyUnicode_AsWideChar and
  4759. PySlice_GetIndices, which changed signatures in python3.2.
  4760. 2011-04-07: wsfulton
  4761. Fix wrapping of const array typedefs which were generating uncompilable code as
  4762. reported by Karl Wette.
  4763. 2011-04-03: szager
  4764. [Python] Fixed the behavior of %pythonnondynamic to conform to the spec in Lib/pyuserdir.swg.
  4765. 2011-04-03: szager
  4766. [Python] Merged in the szager-python-builtin branch, adding the -builtin feature
  4767. for python. The -builtin option may provide a significant performance gain
  4768. in python wrappers. For full details and limitations, refer to Doc/Manual/Python.html.
  4769. A small test suite designed to demonstrate the performance gain is in
  4770. Examples/python/performance.
  4771. 2011-04-01: wsfulton
  4772. Add in missing wrappers for friend functions for some target languages, mostly
  4773. the non-scripting languages like Java and C#.
  4774. Version 2.0.3 (29 March 2011)
  4775. =============================
  4776. 2011-03-29: wsfulton
  4777. [R] Apply patch #3239076 from Marie White fixing strings for R >= 2.7.0
  4778. 2011-03-29: wsfulton
  4779. [Tcl] Apply patch #3248280 from Christian Delbaere which adds better error messages when
  4780. the incorrect number or type of arguments are passed to overloaded methods.
  4781. 2011-03-29: wsfulton
  4782. [Tcl] Apply patch #3224663 from Christian Delbaere.
  4783. 1. Fix when function returns a NULL value, a "NULL" command will be created in the Tcl interpreter
  4784. and calling this command will cause a segmentation fault.
  4785. 2. Previous implementation searches for class methods using a linear search causing performance issues
  4786. in wrappers for classes with many member functions. The patch adds a method hash table to classes and
  4787. changes method name lookup to use the hash table instead of doing a linear search.
  4788. 2011-03-26: wsfulton
  4789. [C#, Java] SF bug #3195112 - fix wrapping of enums that are type char, for example:
  4790. enum { X = 'X'; }
  4791. 2011-03-21: vadz
  4792. Allow setting PCRE_CFLAGS and PCRE_LIBS during configuration to override the values returned by
  4793. pcre-config, e.g. to allow using a static version of PCRE library.
  4794. 2011-03-17: wsfulton
  4795. [UTL] Add missing headers in generated STL wrappers to fix compilation with gcc-4.6.
  4796. 2011-03-17: wsfulton
  4797. Fix regression introduced in swig-2.0.2 where filenames with spaces were not found
  4798. when used with %include and %import. Reported by Shane Liesegang.
  4799. 2011-03-15: wsfulton
  4800. [UTL] Fix overloading when using const char[], problem reported by David Maxwell.
  4801. Similarly for char[ANY] and const char[ANY].
  4802. 2011-03-15: wsfulton
  4803. [C#] Apply patch #3212624 fixing std::map Keys property.
  4804. 2011-03-14: olly
  4805. [PHP] Fix handling of overloaded methods/functions where some
  4806. return void and others don't - whether this worked or not depended
  4807. on the order they were encountered in (SF#3208299).
  4808. 2011-03-13: klickverbot
  4809. [D] Extended support for C++ namespaces (nspace feature).
  4810. 2011-03-12: olly
  4811. [PHP] Fix sharing of type information between multiple SWIG-wrapped
  4812. modules (SF#3202463).
  4813. 2011-03-09: wsfulton
  4814. [Python] Fix SF #3194294 - corner case bug when 'NULL' is used as the default value
  4815. for a primitive type parameter in a method declaration.
  4816. 2011-03-07: olly
  4817. [PHP] Don't use zend_error_noreturn() for cases where the function
  4818. returns void - now this issue can only matter if you have a function
  4819. or method which is directed and returns non-void.
  4820. 2011-03-06: olly
  4821. [PHP] Add casts to the typemaps for long long and unsigned long
  4822. long to avoid issues when they are used with shorter types via
  4823. %apply.
  4824. 2011-03-02: wsfulton
  4825. Templated smart pointers overloaded with both const and non const operator-> generated uncompilable
  4826. code when the pointee was a class with either public member variables or static methods.
  4827. Regression in 2.0.x reported as working in 1.3.40 by xantares on swig-user mailing list.
  4828. Version 2.0.2 (20 February 2011)
  4829. ================================
  4830. 2011-02-19: wsfulton
  4831. [PHP] Add missing INPUT, OUTPUT and INOUT typemaps in the typemaps.i library
  4832. for primitive reference types as well as signed char * and bool *.
  4833. 2011-02-19: olly
  4834. [PHP] Address bug in PHP on some platforms/architectures which
  4835. results in zend_error_noreturn() not being available using
  4836. SWIG_ZEND_ERROR_NORETURN which defaults to zend_error_noreturn but
  4837. can be overridden when building the module by passing
  4838. -DSWIG_ZEND_ERROR_NORETURN=zend_error to the compiler. This may
  4839. result in compiler warnings, but should at least allow a module
  4840. to be built on those platforms/architectures (SF#3166423).
  4841. 2011-02-18: wsfulton
  4842. Fix #3184549 - vararg functions and function overloading when using the -fastdispatch option.
  4843. 2011-02-18: olly
  4844. [PHP] An overloaded method which can return an object or a
  4845. primitive type no longer causes SWIG to segfault. Reported by Paul
  4846. Colby in SF#3168531.
  4847. 2011-02-18: olly
  4848. [PHP] Fix invalid erase during iteration of std::map in generated
  4849. director code. Reported by Cory Bennett in SF#3175820.
  4850. 2011-02-17: wsfulton
  4851. Preprocessing now warns if extra tokens appear after #else and #end.
  4852. 2011-02-16: wsfulton
  4853. Fix #1653092 Preprocessor does not error out when #elif is missing an expression.
  4854. This and other cases of missing preprocessor expressions now result in an error.
  4855. 2011-02-14: wsfulton
  4856. [Ocaml] Apply patch #3151788 from Joel Reymont. Brings Ocaml support up to date
  4857. (ver 3.11 and 3.12), including std::string.
  4858. 2011-02-13: wsfulton
  4859. [Ruby] Apply patch #3176274 from James Masters - typecheck typemap for time_t.
  4860. 2011-02-13: wsfulton
  4861. Apply patch #3171793 from szager - protected director methods failing when -fvirtual is used.
  4862. 2011-02-13: wsfulton
  4863. Fix #1927852 - #include directives don't preprocess the file passed to it. The fix is for
  4864. #include with -importall or -includeall, %include and %import, for example:
  4865. #define FILENAME "abc.h"
  4866. %include FILENAME
  4867. 2011-02-12: wsfulton
  4868. Fix #1940536, overactive preprocessor which was expanding defined(...) outside of #if and #elif
  4869. preprocessor directives.
  4870. 2011-02-05: wsfulton
  4871. [MzScheme] SF #2942899 Add user supplied documentation to help getting started with MzScheme.
  4872. Update chapter name to MzScheme/Racket accounting for the rename of MzScheme to Racket.
  4873. 2011-02-05: wsfulton
  4874. [C#] SF #3085906 - Possible fix running test-suite on Mac OS X.
  4875. 2011-02-05: wsfulton
  4876. SF #3173367 Better information during configure about Boost prerequisite for running
  4877. the test-suite.
  4878. 2011-02-05: wsfulton
  4879. SF #3127633 Fix infinite loop in recursive typedef resolution.
  4880. 2011-02-04: wsfulton
  4881. [R] SF #3168676 Fix %rename not working for member variables and methods.
  4882. 2011-02-04: wsfulton
  4883. [clisp] SF #3148200 Fix segfault parsing nested unions.
  4884. 2011-02-01: wsfulton
  4885. [C#] Directors - a call to a method being defined in the base class, not
  4886. overridden in a subclass, but again overridden in a class derived from
  4887. the first subclass was not being dispatched correctly to the most derived class.
  4888. See director_alternating.i for an example.
  4889. 2011-02-01: wsfulton
  4890. [C#, Java] Any 'using' statements in the protected section of a class were previously
  4891. ignored with director protected (dirprot) mode.
  4892. 2011-01-30: wsfulton
  4893. Fix overloading with const pointer reference (SWIGTYPE *const&) parameters for a
  4894. number of scripting languages.
  4895. 2011-01-17: wsfulton
  4896. New warning for smart pointers if only some of the classes in the inheritance
  4897. chain are marked as smart pointer, eg, %shared_ptr should be used for all classes
  4898. in an inheritance hierarchy, so this new warning highlights code where this is
  4899. not the case.
  4900. example.i:12: Warning 520: Base class 'A' of 'B' is not similarly marked as a smart pointer.
  4901. example.i:16: Warning 520: Derived class 'C' of 'B' is not similarly marked as a smart pointer.
  4902. 2011-01-14: wsfulton
  4903. Added some missing multi-argument typemaps: (char *STRING, size_t LENGTH) and
  4904. (char *STRING, int LENGTH). Documentation for this updated. Java patch from
  4905. Volker Grabsch.
  4906. 2011-01-11: iant
  4907. Require Go version 7077 or later.
  4908. 2010-12-30: klickverbot
  4909. [C#, D, Java] Check for collision of parameter names with target
  4910. language keywords when generating the director glue code.
  4911. The situation in which the generated could would previously be
  4912. invalid is illustrated in the new 'director_keywords' test case.
  4913. 2010-12-23: wsfulton
  4914. [C#] Fix $csinput special variable not being expanded for csvarin typemaps
  4915. when used for global variables. Reported by Vadim Zeitlin.
  4916. 2010-12-14: wsfulton
  4917. Fix $basemangle expansion in array typemaps. For example if type is int *[3],
  4918. $basemangle expands to _p_int.
  4919. 2010-12-07: iant
  4920. Check that we are using a sufficiently new version of the
  4921. 6g or 8g Go compiler during configure time. If not, disable Go.
  4922. Minimum version is now 6707.
  4923. *** POTENTIAL INCOMPATIBILITY ***
  4924. 2010-12-06: wsfulton
  4925. Fix #3127394 - use of network paths on Windows/MSys.
  4926. 2010-11-18: klickverbot
  4927. [D] Added the D language module.
  4928. 2010-11-12: vadz
  4929. Fix handling of multiple regex-using %renames attached to the same
  4930. declaration. For example, now
  4931. %rename("%(regex:/^Set(.*)/put\\1/)s") "";
  4932. %rename("%(regex:/^Get(.*)/get\\1/)s") "";
  4933. works as expected whereas before only the last anonymous rename was
  4934. taken into account.
  4935. 2010-10-17: drjoe
  4936. [R] Fix failure in overloaded functions which was breaking
  4937. QuantLib-SWIG
  4938. 2010-10-14: olly
  4939. [PHP] Allow compilation on non-conforming Microsoft C++ compilers
  4940. which don't accept: return function_returning_void();
  4941. Reported by Frank Vanden Berghen on the SWIG mailing list.
  4942. 2010-10-12: wsfulton
  4943. Fix unary scope operator (::) (global scope) regression introduced in 2.0.0, reported by
  4944. Ben Walker. The mangled symbol names were incorrect, sometimes resulting in types being
  4945. incorrectly treated as opaque types.
  4946. Also fixes #2958781 and some other type problems due to better typedef resolution, eg
  4947. std::vector<T *>::value_type didn't resolve to T * when it should have. The mangled type
  4948. was incorrectly SWIGTYPE_std__vectorT_Test_p_std__allocatorT_Test_p_t_t__value_type and now
  4949. it is correctly SWIGTYPE_p_Test.
  4950. Version 2.0.1 (4 October 2010)
  4951. ==============================
  4952. 2010-10-03: wsfulton
  4953. Apply patch #3066958 from Mikael Johansson to fix default smart pointer
  4954. handling when the smart pointer contains both a const and non-const operator->.
  4955. 2010-10-01: wsfulton
  4956. Add -pcreversion option to display PCRE version information.
  4957. 2010-10-01: olly
  4958. [Ruby] Avoid segfault when a method node has no parentNode
  4959. (SF#3034054).
  4960. 2010-10-01: olly
  4961. [Python] Allow reinitialisation to work with an embedded Python
  4962. interpreter (patch from Jim Carroll in SF#3075178).
  4963. 2010-09-28: wsfulton
  4964. [C#] Apply patch from Tomas Dirvanauskas for std::map wrappers to avoid
  4965. throwing exceptions with normal usage of iterators.
  4966. 2010-09-27: olly
  4967. [Python] Improve error message given when a parameter of the wrong
  4968. type is passed to an overloaded method (SF#3027355).
  4969. 2010-09-25: wsfulton
  4970. Apply SF patch #3075150 - Java directors using static variables in
  4971. named namespace.
  4972. 2010-09-24: wsfulton
  4973. More file and line error/warning reporting fixes where SWIG macros
  4974. are used within {} braces (where the preprocessor expands macros),
  4975. for example macros within %inline {...} and %fragment(...) {...}
  4976. and nested structs.
  4977. 2010-09-18: wsfulton
  4978. More file and line error/warning reporting fixes for various inherited
  4979. class problems.
  4980. 2010-09-15: wsfulton
  4981. A much improved debugging of SWIG source experience is now available and
  4982. documented in the "Debugging SWIG" section in the Doc/Devel/internals.html
  4983. file, including a swig.dbg support file for the gdb debugger.
  4984. 2010-09-11: wsfulton
  4985. Fix incorrect line number reporting in errors/warnings when a macro
  4986. definition ends with '/' and it is not the end of a C comment.
  4987. 2010-09-11: wsfulton
  4988. Fix incorrect line number reporting in errors/warnings after parsing
  4989. macro invocations with parameters given over more than one line.
  4990. 2010-09-10: wsfulton
  4991. Remove extraneous extra line in preprocessed output after including files
  4992. which would sometimes lead to error/warning messages two lines after the
  4993. end of the file.
  4994. 2010-09-10: wsfulton
  4995. Fix #2149523 - Incorrect line number reporting in errors after parsing macros
  4996. containing C++ comments.
  4997. 2010-09-08: olly
  4998. [PHP] Fix handling of OUTPUT typemaps (Patch from Ryan in SF#3058394).
  4999. 2010-09-03: wsfulton
  5000. Fix erroneous line numbers in error messages for macro expansions, for example,
  5001. the error message now points to instantiation of the macro, ie the last line here:
  5002. #define MACRO2(a, b)
  5003. #define MACRO1(NAME) MACRO2(NAME,2,3)
  5004. MACRO1(abc)
  5005. 2010-09-02: wsfulton
  5006. Fix line numbers in error and warning messages for preprocessor messages within
  5007. %inline, for example:
  5008. %inline %{
  5009. #define FOOBAR 1
  5010. #define FOOBAR "hi"
  5011. %}
  5012. 2010-09-02: wsfulton
  5013. Fix line numbers in error and warning messages which were cumulatively one
  5014. less than they should have been after parsing each %include/%import - bug
  5015. introduced in swig-1.3.32. Also fix line numbers in error and warning messages
  5016. when new line characters appear between the %include / %import statement and
  5017. the filename.
  5018. 2010-08-30: wsfulton
  5019. Fix line number and file name reporting for some macro preprocessor warnings.
  5020. The line number of the macro argument has been corrected and the line number
  5021. of the start of the macro instead of one past the end of the macro is used.
  5022. Some examples:
  5023. file.h:11: Error: Illegal macro argument name '..'
  5024. file.h:19: Error: Macro 'DUPLICATE' redefined,
  5025. file.h:15: Error: previous definition of 'DUPLICATE'.
  5026. file.h:25: Error: Variable-length macro argument must be last parameter
  5027. file.h:32: Error: Illegal character in macro argument name
  5028. file.i:37: Error: Macro 'SIT' expects 2 arguments
  5029. 2010-08-26: wsfulton
  5030. Fix __LINE__ and __FILE__ expansion reported by Camille Gillot. Mostly this
  5031. did not work at all. Also fixes SF #2822822.
  5032. 2010-08-17: wsfulton
  5033. [Perl] Fix corner case marshalling of doubles - errno was not being correctly
  5034. set before calling strtod - patch from Justin Vallon - SF Bug #3038936.
  5035. 2010-08-17: wsfulton
  5036. Fix make distclean when some of the more obscure languages are detected by
  5037. configure - fixes from Torsten Landschoff.
  5038. 2010-07-28: wsfulton
  5039. Restore configuring out of source for the test-suite since it broke in 1.3.37.
  5040. As previously, if running 'make check-test-suite' out of source, it needs to be
  5041. done by invoking configure with a relative path. Invoking configure with an
  5042. absolute path will not work. Running the full 'make check' still needs to be
  5043. done in the source tree.
  5044. 2010-07-16: wsfulton
  5045. Fix wrapping of function pointers and member function pointers when the function
  5046. returns by reference.
  5047. 2010-07-13: vadz
  5048. Removed support for the old experimental "rxspencer" encoder and
  5049. "[not]rxsmatch" in %rename (see the 01/16/2006 entry). The new and
  5050. officially supported "regex" encoder and "[not]regexmatch" checks
  5051. should be used instead (see the two previous entries). Please
  5052. replace "%(rxspencer:[pat][subst])s" with "%(regex:/pat/subst/)s"
  5053. when upgrading. Notice that you will also need to replace the back-
  5054. references of form "@1" with the more standard "\\1" and may need to
  5055. adjust your regular expressions syntax as the new regex encoder uses
  5056. Perl-compatible syntax and not (extended) POSIX syntax as the old one.
  5057. *** POTENTIAL INCOMPATIBILITY ***
  5058. 2010-07-13: vadz
  5059. Add "regexmatch", "regextarget" and "notregexmatch" which can be
  5060. used to apply %rename directives to the declarations matching the
  5061. specified regular expression only. The first two can be used
  5062. interchangeably, both of the %renames below do the same thing:
  5063. %rename("$ignore", regexmatch$name="Old$") "";
  5064. %rename("$ignore", regextarget=1) "Old$";
  5065. (namely ignore the declarations having "Old" suffix).
  5066. "notregexmatch" restricts the match to only the declarations which
  5067. do not match the regular expression, e.g. here is how to rename to
  5068. lower case versions all declarations except those consisting from
  5069. capital letters only:
  5070. %rename("$(lowercase)s", notregexmatch$name="^[A-Z]+$") "";
  5071. 2010-07-13: vadz
  5072. Add the new "regex" encoder that can be used in %rename, e.g.
  5073. %rename("regex:/(\\w+)_(.*)/\\2/") "";
  5074. to remove any alphabetical prefix from all identifiers. The syntax
  5075. of the regular expressions is Perl-like and PCRE library
  5076. (http://www.pcre.org/) is used to implement this feature but notice
  5077. that backslashes need to be escaped as usual inside C strings.
  5078. Original patch from Torsten Landschoff.
  5079. 2010-07-08: wsfulton
  5080. Fix #3024875 - shared_ptr of classes with non-public destructors. This also fixes
  5081. the "unref" feature when used on classes with non-public destructors.
  5082. 2010-06-17: ianlancetaylor
  5083. [Go] Add the Go language module.
  5084. 2010-06-10: wsfulton
  5085. [Lua] Fix SWIG_lua_isnilstring multiply defined when using multiple
  5086. modules and wrapping strings. Patch from 'Number Cruncher'.
  5087. 2010-06-10: olly
  5088. [PHP] Fix directors to correctly call a method with has a
  5089. different name in PHP to C++ (we were always using the C++ name
  5090. in this case).
  5091. 2010-06-03: wsfulton
  5092. Fix uncompilable code when %rename results in two enum items
  5093. with the same name. Reported by Vadim Zeitlin.
  5094. Version 2.0.0 (2 June 2010)
  5095. ===========================
  5096. 2010-06-02: wsfulton
  5097. [C#] Fix SWIG_STD_VECTOR_ENHANCED macro used in std::vector to work with
  5098. types containing commas, for example:
  5099. SWIG_STD_VECTOR_ENHANCED(std::pair< double, std::string >)
  5100. 2010-06-01: wsfulton
  5101. Add in std_shared_ptr.i for wrapping std::shared_ptr. Requires the %shared_ptr
  5102. macro like in the boost_shared_ptr.i library. std::tr1::shared_ptr can also be
  5103. wrapped if the following macro is defined:
  5104. #define SWIG_SHARED_PTR_SUBNAMESPACE tr1
  5105. %include <std_shared_ptr.i>
  5106. shared_ptr is also documented in Library.html now.
  5107. 2010-05-27: wsfulton
  5108. Add the ability for $typemap special variable macros to call other $typemap
  5109. special variable macros, for example:
  5110. %typemap(cstype) CC "CC"
  5111. %typemap(cstype) BB "$typemap(cstype, CC)"
  5112. %typemap(cstype) AA "$typemap(cstype, BB)"
  5113. void hah(AA aa);
  5114. This also fixes C# std::vector containers of shared_ptr and %shared_ptr.
  5115. Also added diagnostics for $typemap with -debug-tmsearch, for example, the
  5116. above displays additional diagnostic lines starting "Containing: ":
  5117. example.i:34: Searching for a suitable 'cstype' typemap for: AA aa
  5118. Looking for: AA aa
  5119. Looking for: AA
  5120. Using: %typemap(cstype) AA
  5121. Containing: $typemap(cstype, BB)
  5122. example.i:31: Searching for a suitable 'cstype' typemap for: BB
  5123. Looking for: BB
  5124. Using: %typemap(cstype) BB
  5125. Containing: $typemap(cstype, CC)
  5126. example.i:29: Searching for a suitable 'cstype' typemap for: CC
  5127. Looking for: CC
  5128. Using: %typemap(cstype) CC
  5129. 2010-05-26: olly
  5130. Fix %attribute2ref not to produce a syntax error if the last
  5131. argument (AccessorMethod) is omitted. Patch from David Piepgras
  5132. in SF#2235756.
  5133. 2010-05-26: olly
  5134. [PHP] When using %throws or %catches, SWIG-generated PHP5 wrappers
  5135. now throw PHP Exception objects instead of giving a PHP error of
  5136. type E_ERROR.
  5137. This change shouldn't cause incompatibility issues, since you can't
  5138. set an error handler for E_ERROR, so previously PHP would just exit
  5139. which also happens for unhandled exceptions. The benefit is you can
  5140. now catch them if you want to.
  5141. Fixes SF#2545578 and SF#2955522.
  5142. 2010-05-25: olly
  5143. [PHP] Add missing directorin typemap for const std::string &.
  5144. Fixes SF#3006404 reported by t-Legiaw.
  5145. 2010-05-23: wsfulton
  5146. [C#] Fix #2957375 - SWIGStringHelper and SWIGExceptionHelper not always being
  5147. initialized before use in .NET 4 as the classes were not marked beforefieldinit.
  5148. A static constructor has been added to the intermediary class like this:
  5149. %pragma(csharp) imclasscode=%{
  5150. static $imclassname() {
  5151. }
  5152. %}
  5153. If you had added your own custom static constructor to the intermediary class in
  5154. the same way as above, you will have to modify your approach to use static variable
  5155. initialization or define SWIG_CSHARP_NO_IMCLASS_STATIC_CONSTRUCTOR - See csharphead.swg.
  5156. *** POTENTIAL INCOMPATIBILITY ***
  5157. 2010-05-23: wsfulton
  5158. Fix #2408232. Improve shared_ptr and intrusive_ptr wrappers for classes in an
  5159. inheritance hierarchy. No special treatment is needed for derived classes.
  5160. The proxy class also no longer needs to be specified, it is automatically
  5161. deduced. The following macros are deprecated:
  5162. SWIG_SHARED_PTR(PROXYCLASS, TYPE)
  5163. SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE)
  5164. and have been replaced by
  5165. %shared_ptr(TYPE)
  5166. Similarly for intrusive_ptr wrappers, the following macro is deprecated:
  5167. SWIG_INTRUSIVE_PTR(PROXYCLASS, TYPE)
  5168. SWIG_INTRUSIVE_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE)
  5169. and have been replaced by
  5170. %intrusive_ptr(TYPE)
  5171. 2010-05-21: olly
  5172. [PHP] Stop generating a bogus line of code in certain constructors.
  5173. This was mostly harmless, but caused a PHP notice to be issued, if
  5174. enabled (SF#2985684).
  5175. 2010-05-18: wsfulton
  5176. [Java] Fix member pointers on 64 bit platforms.
  5177. 2010-05-14: wsfulton
  5178. Fix wrapping of C++ enum boolean values reported by Torsten Landschoff:
  5179. typedef enum { PLAY = true, STOP = false } play_state;
  5180. 2010-05-14: olly
  5181. [PHP] Fix wrapping of global variables which was producing
  5182. uncompilable code in some cases.
  5183. 2010-05-12: drjoe
  5184. [R] Add two more changes from Wil Nolan. Get garbage
  5185. collection to work. Implement newfree
  5186. 2010-05-09: drjoe
  5187. Fix bug reported by Wil Nolan change creation of string so
  5188. that R 2.7.0+ can use char hashes
  5189. 2010-05-07: wsfulton
  5190. Apply patch #2955146 from Sergey Satskiy to fix expressions containing divide by
  5191. operator in constructor initialization lists.
  5192. 2010-05-05: wsfulton
  5193. [R] Memory leak fix handling const std::string & inputs, reported by Will Nolan.
  5194. 2010-05-01: wsfulton
  5195. Typemap matching enhancement for non-default typemaps. Previously all
  5196. qualifiers were stripped in one step, now they are stripped one at a time
  5197. starting with the left most qualifier. For example, int const*const
  5198. is first stripped to int *const then int *.
  5199. *** POTENTIAL INCOMPATIBILITY ***
  5200. 2010-04-25: bhy
  5201. [Python] Fix #2985655 - broken constructor renaming.
  5202. 2010-04-14: wsfulton
  5203. Typemap fragments are now official and documented in Typemaps.html.
  5204. 2010-04-09: wsfulton
  5205. [Ruby] Fix #2048064 and #2408020.
  5206. Apply Ubuntu patch to fix Ruby and std::vector wrappers with -minherit.
  5207. https://bugs.launchpad.net/ubuntu/+source/swig1.3/+bug/522874
  5208. 2010-04-09: wsfulton
  5209. [Mzscheme] Apply Ubuntu patch to fix std::map wrappers:
  5210. https://bugs.launchpad.net/ubuntu/+source/swig1.3/+bug/203876
  5211. 2010-04-09: wsfulton
  5212. [Python] Apply patch #2952374 - fix directors and the -nortti option.
  5213. 2010-04-09: wsfulton
  5214. [Lua] Fix #2887254 and #2946032 - SWIG_Lua_typename using wrong stack index.
  5215. 2010-04-03: wsfulton
  5216. [Python] Fix exceptions being thrown with the -threads option based on patch from Arto Vuori.
  5217. Fixes bug #2818499.
  5218. 2010-04-03: wsfulton
  5219. Fix Makefile targets: distclean and maintainer-clean
  5220. 2010-04-02: wsfulton
  5221. [Lua] Fix char pointers, wchar_t pointers and char arrays so that nil can be passed as a
  5222. valid value. Bug reported by Gedalia Pasternak.
  5223. 2010-04-01: wsfulton
  5224. Numerous subtle typemap matching rule fixes when using the default type. The typemap
  5225. matching rules are to take a type and find the best default typemap (SWIGTYPE, SWIGTYPE* etc),
  5226. then look for the next best match by reducing the chosen default type. The type deduction
  5227. now follows C++ class template partial specialization matching rules.
  5228. Below are the set of changes made showing the default type deduction
  5229. along with the old reduced type and the new version of the reduced type:
  5230. SWIGTYPE const &[ANY]
  5231. new: SWIGTYPE const &[]
  5232. old: SWIGTYPE (&)[ANY]
  5233. SWIGTYPE *const [ANY]
  5234. new: SWIGTYPE const [ANY]
  5235. old: SWIGTYPE *[ANY]
  5236. SWIGTYPE const *const [ANY]
  5237. new: SWIGTYPE *const [ANY]
  5238. old: SWIGTYPE const *[ANY]
  5239. SWIGTYPE const *const &
  5240. new: SWIGTYPE *const &
  5241. old: SWIGTYPE const *&
  5242. SWIGTYPE *const *
  5243. new: SWIGTYPE const *
  5244. old: SWIGTYPE **
  5245. SWIGTYPE *const &
  5246. new: SWIGTYPE const &
  5247. old: SWIGTYPE *&
  5248. Additionally, a const SWIGTYPE lookup is used now for any constant type. Some examples, where
  5249. T is some reduced type, eg int, struct Foo:
  5250. T const
  5251. new: SWIGTYPE const
  5252. old: SWIGTYPE
  5253. T *const
  5254. new: SWIGTYPE *const
  5255. old: SWIGTYPE *
  5256. T const[]
  5257. new: SWIGTYPE const[]
  5258. old: SWIGTYPE[]
  5259. enum T const
  5260. new: enum SWIGTYPE const
  5261. old: enum SWIGTYPE
  5262. T (*const )[]
  5263. new: SWIGTYPE (*const )[]
  5264. old: SWIGTYPE (*)[]
  5265. Reminder: the typemap matching rules can now be seen for any types being wrapped by using
  5266. either the -debug-tmsearch or -debug-tmused options.
  5267. In practice this leads to some subtle matching rule changes and the majority of users
  5268. won't notice any changes, except in the prime area of motivation for this change: Improve
  5269. STL containers of const pointers and passing const pointers by reference. This is fixed
  5270. because many of the STL containers use a type 'T const&' as parameters and when T is
  5271. a const pointer, for example, 'K const*', then the full type is 'K const*const&'. This
  5272. means that the 'SWIGTYPE *const&' typemaps now match when T is either a non-const or
  5273. const pointer. Furthermore, some target languages incorrectly had 'SWIGTYPE *&' typemaps
  5274. when these should have been 'SWIGTYPE *const&'. These have been corrected (Java, C#, Lua, PHP).
  5275. *** POTENTIAL INCOMPATIBILITY ***
  5276. 2010-03-13: wsfulton
  5277. [Java] Some very old deprecated pragma warnings are now errors.
  5278. 2010-03-13: wsfulton
  5279. Improve handling of file names and directories containing double/multiple path separators.
  5280. 2010-03-10: mutandiz (Mikel Bancroft)
  5281. [allegrocl] Use fully qualified symbol name of cl::identity in emit_defun().
  5282. 2010-03-06: wsfulton
  5283. [Java] The intermediary JNI class modifiers are now public by default meaning these
  5284. intermediary low level functions are now accessible by default from outside any package
  5285. used. The proxy class pointer constructor and getCPtr() methods are also now public.
  5286. These are needed in order for the nspace option to work without any other mods.
  5287. The previous default of protected access can be restored using:
  5288. SWIG_JAVABODY_METHODS(protected, protected, SWIGTYPE)
  5289. %pragma(java) jniclassclassmodifiers = "class"
  5290. 2010-03-06: wsfulton
  5291. [C#] Added the nspace feature for C#. Documentation for the nspace feature is now available.
  5292. 2010-03-04: wsfulton
  5293. Added the nspace feature. This adds some improved namespace support. Currently only Java
  5294. is supported for target languages, where C++ namespaces are automatically translated into
  5295. Java packages. The feature only applies to classes,struct,unions and enums declared within
  5296. a namespace. Methods and variables declared in namespaces still effectively have their
  5297. namespaces flattened. Example usage:
  5298. %feature(nspace) Outer::Inner1::Color;
  5299. %feature(nspace) Outer::Inner2::Color;
  5300. namespace Outer {
  5301. namespace Inner1 {
  5302. struct Color {
  5303. ...
  5304. };
  5305. }
  5306. namespace Inner2 {
  5307. struct Color {
  5308. ...
  5309. };
  5310. }
  5311. }
  5312. For Java, the -package option is also required when using the nspace feature. Say
  5313. we use -package com.myco, the two classes can then be accessed as follows from Java:
  5314. com.myco.Outer.Inner1.Color and com.myco.Outer.Inner2.Color.
  5315. 2010-02-27: wsfulton
  5316. [Python] Remove -dirvtable from the optimizations included by -O as it this option
  5317. currently leads to memory leaks as reported by Johan Blake.
  5318. 2010-02-27: wsfulton
  5319. License code changes: SWIG Source is GPL-v3 and library code license is now clearer
  5320. and is provided under a very permissive license. See https://www.swig.org/legal.html.
  5321. 2010-02-13: wsfulton
  5322. [Ruby] A few fixes for compiling under ruby-1.9.x including patch from 'Nibble'.
  5323. 2010-02-13: wsfulton
  5324. [Ruby] Apply patch from Patrick Bennett to fix RARRAY_LEN and RARRAY_PTR usage for Ruby 1.9.x
  5325. used in various STL wrappers.
  5326. 2010-02-13: wsfulton
  5327. [C#, Java] Fix incorrect multiply defined symbol name error when an enum item
  5328. and class name have the same name, as reported by Nathan Krieger. Example:
  5329. class Vector {};
  5330. namespace Text {
  5331. enum Preference { Vector };
  5332. }
  5333. This also fixes other incorrect corner case target language symbol name clashes.
  5334. 2010-02-11: wsfulton
  5335. Add the -debug-lsymbols option for displaying the target language layer symbols.
  5336. 2010-02-09: wsfulton
  5337. Fix -MM and -MMD options on Windows. They were not omitting files in the SWIG library as
  5338. they should be.
  5339. 2010-02-08: wsfulton
  5340. Fix #1807329 - When Makefile dependencies are being generated using the -M family of options
  5341. on Windows, the file paths have been corrected to use single backslashes rather than double
  5342. backslashes as path separators.
  5343. 2010-02-06: wsfulton
  5344. Fix #2918902 - language specific files not being generated in correct directory on
  5345. Windows when using forward slashes for -o, for example:
  5346. swig -python -c++ -o subdirectory/theinterface_wrap.cpp subdirectory/theinterface.i
  5347. 2010-02-05: wsfulton
  5348. Fix #2894405 - assertion when using -xmlout.
  5349. 2010-01-28: wsfulton
  5350. Fix typemap matching bug when a templated type has a typemap both specialized and not
  5351. specialized. For example:
  5352. template<typename T> struct XX { ... };
  5353. %typemap(in) const XX & "..."
  5354. %typemap(in) const XX< int > & "..."
  5355. resulted in the 2nd typemap being applied for all T in XX< T >.
  5356. 2010-01-22: wsfulton
  5357. Fix #2933129 - typemaps not being found when the unary scope operator (::) is used to denote
  5358. global scope, the typemap is now used in situations like this:
  5359. struct X {};
  5360. %typemap(in) const X & "..."
  5361. void m(const ::X &);
  5362. and this:
  5363. struct X {};
  5364. %typemap(in) const ::X & "..."
  5365. void m(const X &);
  5366. 2010-01-20: wsfulton
  5367. Fix some unary scope operator (::) denoting global scope problems in the types generated
  5368. into the C++ layer. Previously the unary scope operator was dropped in the generated code
  5369. if the type had any sort of qualifier, for example when using pointers, references, like
  5370. ::foo*, ::foo&, bar< ::foo* >.
  5371. 2010-01-13: olly
  5372. [PHP] Add datetime to the list of PHP predefined classes (patch
  5373. from David Fletcher in SF#2931042).
  5374. 2010-01-11: wsfulton
  5375. Slight change to warning, error and diagnostic reporting. The warning number is no
  5376. longer shown within brackets. This is to help default parsing of warning messages by
  5377. other tools, vim on Unix in particular.
  5378. Example original display using -Fstandard:
  5379. example.i:20: Warning(401): Nothing known about base class 'B'. Ignored.
  5380. New display:
  5381. example.i:20: Warning 401: Nothing known about base class 'B'. Ignored.
  5382. Also subtle fix to -Fmicrosoft format adding in missing space. Example original display:
  5383. example.i(20): Warning(401): Nothing known about base class 'Base'. Ignored.
  5384. New display:
  5385. example.i(20) : Warning 401: Nothing known about base class 'Base'. Ignored.
  5386. 2010-01-10: wsfulton
  5387. Fix a few inconsistencies in reporting of file/line numberings including modifying
  5388. the overload warnings 509, 512, 516, 474, 475 to now be two line warnings.
  5389. 2010-01-10: wsfulton
  5390. Modify -debug-tags output to use standard file name/line reporting so that editors
  5391. can easily navigate to the appropriate lines.
  5392. Was typically:
  5393. . top . include . include (/usr/share/swig/temp/trunk/Lib/swig.swg:312)
  5394. . top . include . include . include (/usr/share/swig/temp/trunk/Lib/swigwarnings.swg:39)
  5395. now:
  5396. /usr/share/swig/temp/trunk/Lib/swig.swg:312: . top . include . include
  5397. /usr/share/swig/temp/trunk/Lib/swigwarnings.swg:39: . top . include . include . include
  5398. 2010-01-03: wsfulton
  5399. Fix missing file/line numbers for typemap warnings and in output from the
  5400. -debug-tmsearch/-debug-tmused options.
  5401. 2010-01-03: wsfulton
  5402. Add typemaps used debugging option (-debug-tmused). When used each line displays
  5403. the typemap used for each type for which code is being generated including the file
  5404. and line number related to the type. This is effectively a condensed form of the
  5405. -debug-tmsearch option. Documented in Typemaps.html.
  5406. 2009-12-23: wsfulton
  5407. Fix for %javaexception and directors so that all the appropriate throws clauses
  5408. are generated. Problem reported by Peter Greenwood.
  5409. 2009-12-20: wsfulton
  5410. Add -debug-tmsearch option for debugging the typemap pattern matching rules.
  5411. Documented in Typemaps.html.
  5412. 2009-12-12: wsfulton
  5413. [Octave] Remove the -api option and use the new OCTAVE_API_VERSION_NUMBER
  5414. macro provided in the octave headers for determining the api version instead.
  5415. 2009-12-04: olly
  5416. [Ruby] Improve support for Ruby 1.9 under GCC. Addresses part of
  5417. SF#2859614.
  5418. 2009-12-04: olly
  5419. Fix handling of modulo operator (%) in constant expressions
  5420. (SF#2818562).
  5421. 2009-12-04: olly
  5422. [PHP] "empty" is a reserved word in PHP, so rename empty() method
  5423. on STL classes to "is_empty()" (previously this was automatically
  5424. renamed to "c_empty()").
  5425. *** POTENTIAL INCOMPATIBILITY ***
  5426. 2009-12-03: olly
  5427. [PHP] Add typemaps for long long and unsigned long long, and for
  5428. pointer to method.
  5429. 2009-12-02: olly
  5430. [PHP] Fix warning and rename of reserved class name to be case
  5431. insensitive.
  5432. 2009-12-01: wsfulton
  5433. Revert support for %extend and memberin typemaps added in swig-1.3.39. The
  5434. memberin typemaps are ignored again for member variables within a %extend block.
  5435. Documentation inconsistency reported by Torsten Landschoff.
  5436. 2009-11-29: wsfulton
  5437. [Java, C#] Fix generated quoting when using %javaconst(1)/%csconst(1) for
  5438. static const char member variables.
  5439. %javaconst(1) A;
  5440. %csconst(1) A;
  5441. struct X {
  5442. static const char A = 'A';
  5443. };
  5444. 2009-11-26: wsfulton
  5445. [Java, C#] Fix %javaconst(1)/%csconst(1) for static const member variables to
  5446. use the actual constant value if it is specified, rather than the C++ code to
  5447. access the member.
  5448. %javaconst(1) EN;
  5449. %csconst(1) EN;
  5450. struct X {
  5451. static const int EN = 2;
  5452. };
  5453. 2009-11-23: wsfulton
  5454. C++ nested typedef classes can now be handled too, for example:
  5455. struct Outer {
  5456. typedef Foo { } FooTypedef1, FooTypedef2;
  5457. };
  5458. 2009-11-18: wsfulton
  5459. The wrappers for C nested structs are now generated in the same order as declared
  5460. in the parsed code.
  5461. 2009-11-18: wsfulton
  5462. Fix #491476 - multiple declarations of nested structs, for example:
  5463. struct Outer {
  5464. struct {
  5465. int val;
  5466. } inner1, inner2, *inner3, inner4[1];
  5467. } outer;
  5468. 2009-11-17: wsfulton
  5469. Fix parsing of enum declaration and initialization, for example:
  5470. enum ABC {
  5471. a,
  5472. b,
  5473. c
  5474. } A = a, *pC = &C, array[3] = {a, b, c};
  5475. 2009-11-17: wsfulton
  5476. Fix parsing of struct declaration and initialization, for example:
  5477. struct S {
  5478. int x;
  5479. } instance = { 10 };
  5480. 2009-11-15: wsfulton
  5481. Fix #1960977 - Syntax error parsing derived nested class declaration and member
  5482. variable instance.
  5483. 2009-11-14: wsfulton
  5484. Fix #2310483 - function pointer typedef within extern "C" block.
  5485. 2009-11-13: wsfulton
  5486. Fix usage of nested template classes within templated classes so that compilable code
  5487. is generated.
  5488. 2009-11-13: olly
  5489. [php] Fix place where class prefix (as specified with -prefix)
  5490. wasn't being used. Patch from gverbruggen in SF#2892647.
  5491. 2009-11-12: wsfulton
  5492. Fix usage of nested template classes so that compilable code is generated - the nested
  5493. template class is now treated like a normal nested classes, that is, as an opaque type
  5494. unless the nestedworkaround feature is used.
  5495. 2009-11-12: wsfulton
  5496. Replace SWIGWARN_PARSE_NESTED_CLASS with SWIGWARN_PARSE_NAMED_NESTED_CLASS and
  5497. SWIGWARN_PARSE_UNNAMED_NESTED_CLASS for named and unnamed nested classes respectively.
  5498. Named nested class ignored warnings can now be suppressed by name using %warnfilter, eg:
  5499. %warnfilter(SWIGWARN_PARSE_NAMED_NESTED_CLASS) Outer::Inner;
  5500. but clearly unnamed nested classes cannot and the global suppression is still required, eg:
  5501. #pragma SWIG nowarn=SWIGWARN_PARSE_UNNAMED_NESTED_CLASS
  5502. 2009-11-11: wsfulton
  5503. Added the nestedworkaround feature as a way to use the full functionality of a nested class
  5504. (C++ mode only). It removes the nested class from SWIG's type information so it is as if SWIG
  5505. had never parsed the nested class. The documented nested class workarounds using a global
  5506. fake class stopped working when SWIG treated the nested class as an opaque pointer, and
  5507. this feature reverts this behaviour. The documentation has been updated with details of how
  5508. to use and implement it, see the "Nested classes" section in SWIGPlus.html.
  5509. 2009-11-11: wsfulton
  5510. There were a number of C++ cases where nested classes/structs/unions were being handled
  5511. as if C code was being parsed which would oftentimes lead to uncompilable code as an
  5512. attempt was made to wrap the nested structs like it is documented for C code. Now all
  5513. nested structs/classes/unions are ignored in C++ mode, as was always documented. However,
  5514. there is an improvement as usage of nested structs/classes/unions is now always treated
  5515. as an opaque type by default, resulting in generated code that should always compile.
  5516. *** POTENTIAL INCOMPATIBILITY ***
  5517. 2009-11-09: drjoe
  5518. Fix R for -fcompact and add std_map.i
  5519. 2009-11-08: wsfulton
  5520. Fix inconsistency for nested structs/unions/classes. Uncompilable code was being
  5521. generated when inner struct and union declarations were used as types within the
  5522. inner struct. The inner struct/union is now treated as a forward declaration making the
  5523. behaviour the same as an inner class. (C++ code), eg:
  5524. struct Outer {
  5525. struct InnerStruct { int x; };
  5526. InnerStruct* getInnerStruct();
  5527. };
  5528. 2009-11-08: wsfulton
  5529. Ignored nested class/struct warnings now display the name of the ignored class/struct.
  5530. 2009-11-07: wsfulton
  5531. Bug #1514681 - Fix nested template classes within a namespace generated uncompilable
  5532. code and introduced strange side effects to other wrapper code especially code
  5533. after the nested template class. Note that nested template classes are still ignored.
  5534. 2009-11-07: wsfulton
  5535. Add new debug options:
  5536. -debug-symtabs - Display symbol tables information
  5537. -debug-symbols - Display target language symbols in the symbol tables
  5538. -debug-csymbols - Display C symbols in the symbol tables
  5539. 2009-11-03: wsfulton
  5540. Fix some usage of unary scope operator (::) denoting global scope, for example:
  5541. namespace AA { /* ... */ }
  5542. using namespace ::AA;
  5543. and bug #1816802 - SwigValueWrapper should be used:
  5544. struct CC {
  5545. CC(int); // no default constructor
  5546. };
  5547. ::CC x();
  5548. and in template parameter specializations:
  5549. struct S {};
  5550. template <typename T> struct X { void a() {} };
  5551. template <> struct X<S> { void b() {} };
  5552. %template(MyTConcrete) X< ::S >;
  5553. plus probably some other corner case usage of ::.
  5554. 2009-11-02: olly
  5555. [Python] Fix potential memory leak in initialisation code for the
  5556. generated module.
  5557. 2009-10-23: wsfulton
  5558. Fix seg fault when using a named nested template instantiation using %template(name)
  5559. within a class. A warning that these are not supported is now issued plus processing
  5560. continues as if no name was given.
  5561. 2009-10-20: wsfulton
  5562. [Python] Fix std::vector<const T*>. This would previously compile, but not run correctly.
  5563. 2009-10-20: wsfulton
  5564. Fixed previously fairly poor template partial specialization and explicit
  5565. specialization support. Numerous bugs in this area have been fixed including:
  5566. - Template argument deduction implemented for template type arguments, eg this now
  5567. works:
  5568. template<typename T> class X {};
  5569. template<typename T> class X<T *> {};
  5570. %template(X1) X<const int *>; // Chooses T * specialization
  5571. and more complex cases with multiple parameters and a mix of template argument
  5572. deduction and explicitly specialised parameters, eg:
  5573. template <typename T1, typename T2> struct TwoParm { void a() {} };
  5574. template <typename T1> struct TwoParm<T1 *, int *> { void e() {} };
  5575. %template(E) TwoParm<int **, int *>;
  5576. Note that the primary template must now be in scope, like in C++, when
  5577. an explicit or partial specialization is instantiated with %template.
  5578. *** POTENTIAL INCOMPATIBILITY ***
  5579. 2009-09-14: wsfulton
  5580. [C#] Add %csattributes for adding C# attributes to enum values, see docs for example.
  5581. 2009-09-11: wsfulton
  5582. Fix memmove regression in cdata.i as reported by Adriaan Renting.
  5583. 2009-09-07: wsfulton
  5584. Fix constant expressions containing <= or >=.
  5585. 2009-09-02: wsfulton
  5586. The following operators in constant expressions now result in type bool for C++
  5587. wrappers and remain as type int for C wrappers, as per each standard:
  5588. && || == != < > <= >= (Actually the last 4 are still broken). For example:
  5589. #define A 10
  5590. #define B 10
  5591. #define A_EQ_B A == B // now wrapped as type bool for C++
  5592. #define A_AND_B A && B // now wrapped as type bool for C++
  5593. 2009-09-02: wsfulton
  5594. Fix #2845746. true and false are now recognised keywords (only when wrapping C++).
  5595. Constants such as the following are now wrapped (as type bool):
  5596. #define FOO true
  5597. #define BAR FOO && false
  5598. Version 1.3.40 (18 August 2009)
  5599. ===============================
  5600. 2009-08-17: olly
  5601. [Perl] Add "#undef do_exec" to our clean up of Perl global
  5602. namespace pollution.
  5603. 2009-08-17: olly
  5604. [PHP] Fix to wrap a resource returned by __get() in a PHP object (SF#2549217).
  5605. 2009-08-17: wsfulton
  5606. Fix #2797485 After doing a 'make clean', install fails if yodl2man or yodl2html
  5607. is not available.
  5608. 2009-08-16: wsfulton
  5609. [Octave] Caught exceptions display the type of the C++ exception instead of the
  5610. generic "c++-side threw an exception" message.
  5611. 2009-08-16: wsfulton
  5612. [Java] When %catches is used, fix so that any classes specified in the "throws"
  5613. attribute of the "throws" typemap are generated into the Java method's throws clause.
  5614. 2009-08-16: wsfulton
  5615. [C#] Fix exception handling when %catches is used, reported by Juan Manuel Alvarez.
  5616. 2009-08-15: wsfulton
  5617. Fix %template seg fault on some cases of overloading the templated method.
  5618. Bug reported by Jan Kupec.
  5619. 2009-08-15: wsfulton
  5620. [Ruby] Add numerous missing wrapped methods for std::vector<bool> specialization
  5621. as reported by Youssef Jones.
  5622. 2009-08-14: wsfulton
  5623. [Perl] Add SWIG_ConvertPtrAndOwn() method into the runtime for smart pointer
  5624. memory ownership control. shared_ptr support still to be added. Patch from
  5625. David Fletcher.
  5626. 2009-08-14: olly
  5627. [PHP] PHP5 now wraps static member variables as documented.
  5628. 2009-08-14: olly
  5629. [PHP] Update the PHP "class" example to work with PHP5 and use
  5630. modern wrapping features.
  5631. 2009-08-13: wsfulton
  5632. [PHP] std::vector wrappers overhaul. They no longer require the
  5633. specialize_std_vector() macro. Added wrappers for capacity() and reserve().
  5634. 2009-08-13: wsfulton
  5635. [PHP] Add const reference typemaps. const reference primitive types are
  5636. now passed by value rather than pointer like the other target languages.
  5637. Fixes SF#2524029.
  5638. 2009-08-08: wsfulton
  5639. [Python] More user friendly AttributeError is raised when there are
  5640. no constructors generated for the proxy class in the event that the
  5641. class is abstract - the error message is now
  5642. "No constructor defined - class is abstract" whereas if there are no
  5643. public constructors for any other reason and the class is not abstract,
  5644. the message remains
  5645. "No constructor defined".
  5646. [tcl] Similarly for tcl when using -itcl.
  5647. 2009-08-04: olly
  5648. [PHP] Fix generated code to work with PHP 5.3.
  5649. 2009-08-04: vmiklos
  5650. [PHP] Various mathematical functions (which would conflict
  5651. with the built-in PHP ones) are now automatically handled by
  5652. adding a 'c_' prefix.
  5653. 2009-08-03: wsfulton
  5654. [C#] The std::vector<T> implementation is improved and now uses $typemap such
  5655. that the proxy class for T no longer has to be specified in some macros
  5656. for correct C# compilation; the following macros are deprecated, where
  5657. CSTYPE was the C# type for the C++ class CTYPE:
  5658. SWIG_STD_VECTOR_SPECIALIZE_MINIMUM(CSTYPE, CTYPE)
  5659. usage should be removed altogether
  5660. SWIG_STD_VECTOR_SPECIALIZE(CSTYPE, CTYPE)
  5661. should be replaced with:
  5662. SWIG_STD_VECTOR_ENHANCED(CTYPE)
  5663. Some more details in csharp/std_vector.i
  5664. *** POTENTIAL INCOMPATIBILITY ***
  5665. 2009-07-31: olly
  5666. [Python] Fix indentation so that we give a useful error if the
  5667. module can't be loaded. Patch from Gaetan Lehmann in SF#2829853.
  5668. 2009-07-29: wsfulton
  5669. Add $typemap(method, typelist) special variable macro. This allows
  5670. the contents of a typemap to be inserted within another typemap.
  5671. Fully documented in Typemaps.html.
  5672. 2009-07-29: vmiklos
  5673. [PHP] Static member variables are now prefixed with the
  5674. class name. This allows static member variables with the
  5675. same name in different classes.
  5676. 2009-07-29: olly
  5677. [Python] Add missing locks to std::map wrappers. Patch from
  5678. Paul Hampson in SF#2813836.
  5679. 2009-07-29: olly
  5680. [PHP] Fix memory leak in PHP OUTPUT typemaps. Reported by Hitoshi
  5681. Amano in SF#2826322.
  5682. 2009-07-29: olly
  5683. [PHP] Fix memory leak in PHP resource destructor for classes
  5684. without a destructor and non-class types. Patch from Hitoshi Amano
  5685. in SF#2825303.
  5686. 2009-07-28: olly
  5687. [PHP] Update warnings about clashes between identifiers and PHP
  5688. keywords and automatic renaming to work with the PHP5 class
  5689. wrappers. Fixes SF#1613679.
  5690. 2009-07-28: vmiklos
  5691. [PHP] If a member function is not public but it has a base
  5692. which is public, then now a warning is issued and the member
  5693. function will be public, as PHP requires this.
  5694. 2009-07-21: vmiklos
  5695. [PHP] Director support added.
  5696. 2009-07-15: olly
  5697. [Perl] Don't specify Perl prototype "()" for a constructor with a
  5698. different name to the class, as such constructors can still take
  5699. parameters.
  5700. 2009-07-12: xavier98
  5701. [Octave] Add support for Octave 3.2 API
  5702. 2009-07-05: olly
  5703. [PHP] Update the list of PHP keywords - "cfunction" is no longer a
  5704. keyword in PHP5 and PHP 5.3 added "goto", "namespace", "__DIR__",
  5705. and "__NAMESPACE__".
  5706. 2009-07-03: olly
  5707. [Tcl] To complement USE_TCL_STUBS, add support for USE_TK_STUBS
  5708. and SWIG_TCL_STUBS_VERSION. Document all three in the Tcl chapter
  5709. of the manual. Based on patch from SF#2810380 by Christian
  5710. Gollwitzer.
  5711. 2009-07-02: vmiklos
  5712. [PHP] Added factory.i for PHP, see the li_factory testcase
  5713. for more info on how to use it.
  5714. 2009-07-02: wsfulton
  5715. Fix -Wallkw option as reported by Solomon Gibbs.
  5716. 2009-07-02: wsfulton
  5717. Fix syntax error when a nested struct contains a comment containing a * followed
  5718. eventually by a /. Regression from 1.3.37, reported by Solomon Gibbs.
  5719. 2009-07-01: vmiklos
  5720. [PHP] Unknown properties are no longer ignored in proxy
  5721. classes.
  5722. 2009-07-01: vmiklos
  5723. [PHP] Fixed %newobject behaviour, previously any method
  5724. marked with %newobject was handled as a constructor.
  5725. 2009-06-30: olly
  5726. [Ruby] Undefine close and connect macros defined by Ruby API
  5727. headers as we don't need them and they can clash with C++ methods
  5728. being wrapped. Patch from Vit Ondruch in SF#2814430.
  5729. 2009-06-26: olly
  5730. [Ruby] Fix to handle FIXNUM values greater than MAXINT passed for a
  5731. double parameter.
  5732. 2009-06-24: wsfulton
  5733. Fix wrapping methods with default arguments and the compactdefaultargs feature
  5734. where a class is passed by value and is assigned a default value. The SwigValueWrapper
  5735. template workaround for a missing default constructor is no longer used as the code
  5736. generated does not call the default constructor.
  5737. 2009-06-16: wsfulton
  5738. [Java,C#] Fix enum marshalling when %ignore is used on one of the enum items.
  5739. Incorrect enum values were being passed to the C++ layer or compilation errors resulted.
  5740. 2009-06-02: talby
  5741. [Perl] Resolved reference.i overload support problem
  5742. identified by John Potowsky.
  5743. 2009-05-26: wsfulton
  5744. [C#] Improved std::map wrappers based on patch from Yuval Baror. The C# proxy
  5745. now implements System.Collections.Generic.IDictionary<>.
  5746. These std:map wrappers have a non-backwards compatible overhaul to make them
  5747. like a .NET IDictionary. Some method names have changed as following:
  5748. set -> setitem (use this[] property now)
  5749. get -> getitem (use this[] property now)
  5750. has_key -> ContainsKey
  5751. del -> Remove
  5752. clear -> Clear
  5753. The following macros used for std::map wrappers are deprecated and will no longer work:
  5754. specialize_std_map_on_key
  5755. specialize_std_map_on_value
  5756. specialize_std_map_on_both
  5757. *** POTENTIAL INCOMPATIBILITY ***
  5758. 2009-05-20: vmiklos
  5759. [PHP] Add the 'thisown' member to classes. The usage of it
  5760. is the same as the Python thisown one: it's 1 by default and
  5761. you can set it to 0 if you want to prevent freeing it. (For
  5762. example to prevent a double free.)
  5763. 2009-05-14: bhy
  5764. [Python] Fix the wrong pointer value returned by SwigPyObject_repr().
  5765. 2009-05-13: mutandiz (Mikel Bancroft)
  5766. [allegrocl] Minor tweak when wrapping in -nocwrap mode.
  5767. 2009-05-11: wsfulton
  5768. [C#] Improved std::vector wrappers on the C# proxy side from Yuval Baror. These
  5769. implement IList<> instead of IEnumerable<> where possible.
  5770. 2009-04-29: wsfulton
  5771. [Java, C#] Add the 'notderived' attribute to the javabase and csbase typemaps.
  5772. When this attribute is set, the typemap will not apply to classes that are derived
  5773. from a C++ base class, eg
  5774. %typemap(csbase, notderived="1") SWIGTYPE "CommonBase"
  5775. 2009-04-29: olly
  5776. [Python] Don't attempt to acquire the GIL in situations where we
  5777. know that it will already be locked. This avoids some dead-locks
  5778. with mod_python (due to mod_python bugs which are apparently
  5779. unlikely to ever be fixed), and results in smaller wrappers which
  5780. run a little faster (in tests with Xapian on x86-64 Ubuntu 9.04,
  5781. the stripped wrapper library was 11% smaller and ran 2.7% faster).
  5782. 2009-04-21: wsfulton
  5783. [C#] Fix #2753469 - bool &OUTPUT and bool *OUTPUT typemaps initialisation.
  5784. 2009-04-09: wsfulton
  5785. Fix #2746858 - C macro expression using floating point numbers
  5786. 2009-03-30: olly
  5787. [PHP] The default out typemap for char[ANY] now returns the string up to a
  5788. zero byte, or the end of the array if there is no zero byte. This
  5789. is the same as Python does, and seems more generally useful than
  5790. the previous behaviour of returning the whole contents of the array
  5791. including any zero bytes. If you want the old behaviour, you can provide
  5792. your own typemap to do this:
  5793. %typemap(out) char [ANY]
  5794. %{
  5795. RETVAL_STRINGL($1, $1_dim0, 1);
  5796. %}
  5797. Version 1.3.39 (21 March 2009)
  5798. ==============================
  5799. 2009-03-19: bhy
  5800. [Python] Fix the memory leak related to Python 3 unicode and C char* conversion,
  5801. which can be shown in the following example before this fix:
  5802. from li_cstring import *
  5803. i=0
  5804. while True:
  5805. i += 1
  5806. n = str(i)*10
  5807. test3(n)
  5808. This fix affected SWIG_AsCharPtrAndSize() so you cannot call this function with
  5809. a null alloc and non-null cptr argument in Python 3, otherwise a runtime error
  5810. will be raised.
  5811. 2009-03-18: wsfulton
  5812. [C#] std::vector<T> wrapper improvements for .NET 2 and also providing the
  5813. necessary machinery to use the std::vector<T> wrappers with more advanced features such
  5814. as LINQ - the C# proxy class now derives from IEnumerable<>. The default is now to
  5815. generate code requiring .NET 2 as a minimum, although the C# code can be compiled
  5816. for .NET 1 by defining the SWIG_DOTNET_1 C# preprocessor constant. See the
  5817. std_vector.i file for more details.
  5818. *** POTENTIAL INCOMPATIBILITY ***
  5819. 2009-03-12: wsfulton
  5820. [Ruby] Fix #2676738 SWIG generated symbol name clashes.
  5821. 2009-03-01: bhy
  5822. [Python] Some fixes for Python 3.0.1 and higher support. In 3.0.1, the C API function
  5823. PyObject_Compare is removed, so PyObject_RichCompareBool is used for replacement.
  5824. Struct initilization of SwigPyObject and SwigPyObject_as_number changed to reflect
  5825. the drop of tp_compare and nb_long.
  5826. 2009-03-01: bhy
  5827. [Python] Fix SF#2583160. Now the importer in Python shadow wrapper take care of the
  5828. case that module already imported at other place.
  5829. 2009-02-28: bhy
  5830. [Python] Fix SF#2637352. Move struct declaration of SWIG_module in pyinit.swg before
  5831. the method calls, since some C compiler don't allow declaration in middle of function
  5832. body.
  5833. 2009-02-21: wsfulton
  5834. [Allegrocl] Fix seg fault wrapping some constant variable (%constant) types.
  5835. 2009-02-20: wsfulton
  5836. [CFFI] Fix seg faults when for %extend and using statements.
  5837. 2009-02-20: wsfulton
  5838. Fix SF #2605955: -co option which broke in 1.3.37.
  5839. 2009-02-20: wsfulton
  5840. New %insert("begin") section added. Also can be used as %begin. This is a new
  5841. code section reserved entirely for users and the code within the section is generated
  5842. at the top of the C/C++ wrapper file and so provides a means to put custom code
  5843. into the wrapper file before anything else that SWIG generates.
  5844. 2009-02-17: wsfulton
  5845. 'make clean-test-suite' will now run clean on ALL languages. Previously it only
  5846. ran the correctly configured languages. This way it is now possible to clean up
  5847. properly after running 'make partialcheck-test-suite'.
  5848. 2009-02-14: wsfulton
  5849. Extend attribute library support for structs/classes and the accessor functions use
  5850. pass/return by value semantics. Two new macros are available and usage is identical
  5851. to %attribute. These are %attributeval for structs/classes and %attributestring for
  5852. string classes, like std::string. See attribute.swg for more details.
  5853. 2009-02-13: wsfulton
  5854. Add support for %extend and memberin typemaps. Previously the memberin typemaps were
  5855. ignored for member variables within a %extend block.
  5856. 2009-02-12: wsfulton
  5857. Remove unnecessary temporary variable when wrapping return values that are references.
  5858. Example of generated code for wrapping:
  5859. struct XYZ {
  5860. std::string& refReturn();
  5861. };
  5862. used to be:
  5863. std::string *result = 0 ;
  5864. ...
  5865. {
  5866. std::string &_result_ref = (arg1)->refReturn();
  5867. result = (std::string *) &_result_ref;
  5868. }
  5869. Now it is:
  5870. std::string *result = 0 ;
  5871. ...
  5872. result = (std::string *) &(arg1)->refReturn();
  5873. 2009-02-08: bhy
  5874. Change the SIZE mapped by %pybuffer_mutable_binary and %pybuffer_binary in pybuffer.i from
  5875. the length of the buffer to the number of items in the buffer.
  5876. 2009-02-08: wsfulton
  5877. Fix %feature not working for conversion operators, reported by Matt Sprague, for example:
  5878. %feature("cs:methodmodifiers") operator bool "protected";
  5879. 2009-02-07: wsfulton
  5880. [MzScheme] Apply #2081967 configure changes for examples to build with recent PLT versions.
  5881. Also fixes Makefile errors building SWIG executable when mzscheme package is installed
  5882. (version 3.72 approx and later).
  5883. 2009-02-04: talby
  5884. [Perl] Fix SF#2564192 reported by David Kolovratnk.
  5885. SWIG_AsCharPtrAndSize() now handles "get" magic.
  5886. Version 1.3.38 (31 January 2009)
  5887. ================================
  5888. 2009-01-31: bhy
  5889. [Python] Fix SF#2552488 reported by Gaetan Lehmann. Now %pythonprepend
  5890. and %pythonappend have correct indentation.
  5891. 2009-01-31: bhy
  5892. [Python] Fix SF#2552048 reported by Gaetan Lehmann. The parameter list
  5893. of static member function in generated proxy code should not have the
  5894. 'self' parameter.
  5895. 2009-01-29: wsfulton
  5896. Fix regression introduced in 1.3.37 where the default output directory
  5897. for target language specific files (in the absence of -outdir) was no
  5898. longer the same directory as the generated c/c++ file.
  5899. 2009-01-28: wsfulton
  5900. [Java, C#] Fix proxy class not being used when the global scope operator
  5901. was used for parameters passed by value. Reported by David Piepgrass.
  5902. 2009-01-15: wsfulton
  5903. [Perl] Fix seg fault when running with -v option, reported by John Ky.
  5904. Version 1.3.37 (13 January 2009)
  5905. ================================
  5906. 2009-01-13: mgossage
  5907. [Lua] Added contract support for requiring that unsigned numbers are >=0
  5908. Rewrote much of Examples/Lua/embed3.
  5909. Added a lot to the Lua documentation.
  5910. 2009-01-13: wsfulton
  5911. Fix compilation error when using directors on protected virtual overloaded
  5912. methods reported by Sam Hendley.
  5913. 2009-01-12: drjoe
  5914. [R] Fixed handling of integer arrays
  5915. 2009-01-10: drjoe
  5916. [R] Fix integer handling in r to deal correctly with signed
  5917. and unsigned issues
  5918. 2009-01-10: wsfulton
  5919. Patch #1992756 from Colin McDonald - %contract not working for classes
  5920. in namespace
  5921. 2009-01-05: olly
  5922. Mark SWIGPERL5, SWIGPHP5, and SWIGTCL8 as deprecated in the source
  5923. code and remove documentation of them.
  5924. 2008-12-30: wsfulton
  5925. Bug #2430756. All the languages now define a macro in the generated C/C++
  5926. wrapper file indicating which language is being wrapped. The macro name is the
  5927. same as those defined when SWIG is run, eg SWIGJAVA, SWIGOCTAVE, SWIGCSHARP etc
  5928. and are listed in the "Conditional Compilation" section in the documentation.
  5929. 2008-12-23: wsfulton
  5930. [Java] Fix #2153773 - %nojavaexception was clearing the exception feature
  5931. instead of disabling it. Clearing checked Java exceptions also didn't work.
  5932. The new %clearjavaexception can be used for clearing the exception feature.
  5933. 2008-12-22: wsfulton
  5934. Fix #2432801 - Make SwigValueWrapper exception safe for when copy constructors
  5935. throw exceptions.
  5936. 2008-12-21: wsfulton
  5937. Apply patch #2440046 which fixes possible seg faults for member and global
  5938. variable char arrays when the strings are larger than the string array size.
  5939. 2008-12-20: wsfulton
  5940. The ccache compiler cache has been adapted to work with SWIG and
  5941. named ccache-swig. It now works with C/C++ compilers as well as SWIG
  5942. and can result in impressive speedups when used to recompile unchanged
  5943. code with either a C/C++ compiler or SWIG. Documentation is in CCache.html
  5944. or the installed ccache-swig man page.
  5945. 2008-12-12: wsfulton
  5946. Apply patch from Kalyanov Dmitry which fixes parsing of nested structs
  5947. containing comments.
  5948. 2008-12-12: wsfulton
  5949. Fix error message in some nested struct and %inline parsing error situations
  5950. such as unterminated strings and comments.
  5951. 2008-12-07: olly
  5952. [PHP] Fix warnings when compiling generated wrapper with GCC 4.3.
  5953. 2008-12-06: wsfulton
  5954. [PHP] Deprecate %pragma(php4). Please use %pragma(php) instead.
  5955. The following two warnings have been renamed:
  5956. WARN_PHP4_MULTIPLE_INHERITANCE -> WARN_PHP_MULTIPLE_INHERITANCE
  5957. WARN_PHP4_UNKNOWN_PRAGMA -> WARN_PHP_UNKNOWN_PRAGMA
  5958. *** POTENTIAL INCOMPATIBILITY ***
  5959. 2008-12-04: bhy
  5960. [Python] Applied patch SF#2158938: all the SWIG symbol names started with Py
  5961. are changed, since they are inappropriate and discouraged in Python
  5962. documentation (from http://www.python.org/doc/2.5.2/api/includes.html):
  5963. "All user visible names defined by Python.h (except those defined by
  5964. the included standard headers) have one of the prefixes "Py" or "_Py".
  5965. Names beginning with "_Py" are for internal use by the Python implementation
  5966. and should not be used by extension writers. Structure member names do
  5967. not have a reserved prefix.
  5968. Important: user code should never define names that begin with "Py" or "_Py".
  5969. This confuses the reader, and jeopardizes the portability of the user
  5970. code to future Python versions, which may define additional names beginning
  5971. with one of these prefixes."
  5972. Here is a brief list of what changed:
  5973. PySwig* -> SwigPy*
  5974. PyObject_ptr -> SwigPtr_PyObject
  5975. PyObject_var -> SwigVar_PyObject
  5976. PySequence_Base, PySequence_Cont, PySequence_Ref ->
  5977. SwigPySequence_Base, SwigPySequence_Cont, SwigPySequence_Ref
  5978. PyMap* -> SwigPyMap*
  5979. We provided a pyname_compat.i for backward compatibility. Users whose code having
  5980. these symbols and do not want to change it could simply include this file
  5981. at front of your code. A better solution is to run the converting tool on
  5982. your code, which has been put in SWIG's SVN trunk (Tools/pyname_patch.py) and
  5983. you can download it here:
  5984. https://swig.svn.sourceforge.net/svnroot/swig/trunk/Tools/pyname_patch.py
  5985. *** POTENTIAL INCOMPATIBILITY ***
  5986. 2008-12-02: wsfulton
  5987. [Python] Apply patch #2143727 from Serge Monkewitz to fix importing base classes
  5988. when the package option is specified in %module and that module is %import'ed.
  5989. 2008-11-28: wsfulton
  5990. [UTL] Fix #2080497. Some incorrect acceptance of types in the STL, eg a double * element
  5991. passed into a vector<int *> constructor would be accepted, but the ensuing behaviour
  5992. was undefined. Now the type conversion correctly raises an exception.
  5993. 2008-11-24: wsfulton
  5994. Add -outcurrentdir option. This sets the default output directory to the current
  5995. directory instead of the path specified by the input file. This option enables
  5996. behaviour similar to c/c++ compilers. Note that this controls the output directory,
  5997. but only in the absence of the -o and/or -outdir options.
  5998. 2008-11-23: wsfulton
  5999. [ruby] Apply patch #2263850 to fix ruby/file.i ... rubyio.h filename change in
  6000. ruby 1.9.
  6001. 2008-11-23: wsfulton
  6002. Apply patch #2319790 from Johan Hake to fix shared_ptr usage in std::tr1 namespace.
  6003. 2008-11-21: wsfulton
  6004. The use of the include path to find the input file is now deprecated.
  6005. This makes the behaviour of SWIG the same as C/C++ compilers in preparation
  6006. for use with ccache.
  6007. 2008-11-16: wsfulton
  6008. Fix -nopreprocess option to:
  6009. - correctly report file names in warning and error messages.
  6010. - use the original input filename that created the preprocessed output when
  6011. determining the C++ wrapper file name (in the absence of -o). Previously
  6012. the name of the input file containing the preprocessed output was used.
  6013. 2008-11-11: wsfulton
  6014. [Java] Add patch #2152691 from MATSUURA Takanori which fixes compiles using the
  6015. Intel compiler
  6016. 2008-11-01: wsfulton
  6017. Add patch #2128249 from Anatoly Techtonik which corrects the C/C++ proxy
  6018. class being reported for Python docstrings when %rename is used.
  6019. 2008-11-01: wsfulton
  6020. Add the strip encoder patch from Anatoly Techtonik #2130016. This enables an
  6021. easy way to rename symbols by stripping a commonly used prefix in all the
  6022. function/struct names. It works in the same way as the other encoders, such as
  6023. title, lower, command etc outlined in CHANGES file dated 12/30/2005. Example
  6024. below will rename wxAnotherWidget to AnotherWidget and wxDoSomething to
  6025. DoSomething:
  6026. %rename("%(strip:[wx])s") "";
  6027. struct wxAnotherWidget {
  6028. void wxDoSomething();
  6029. };
  6030. 2008-09-26: mutandiz
  6031. [allegrocl]
  6032. Lots of test-suite work.
  6033. - Fix ordering of wrapper output and %{ %} header output.
  6034. - Fix declarations of local vars in C wrappers.
  6035. - Fix declaration of defined constants in C wrappers.
  6036. - Fix declaration of EnumValues in C wrappers.
  6037. - add some const typemaps to allegrocl.swg
  6038. - add rename for operator bool() overloads.
  6039. 2008-09-25: olly
  6040. [PHP5] Fill in typemaps for SWIGTYPE and void * (SF#2095186).
  6041. 2008-09-22: mutandiz (Mikel Bancroft)
  6042. [allegrocl]
  6043. - Support wrapping of types whose definitions are not seen by
  6044. SWIG. They are treated as forward-referenced classes and if a
  6045. definition is not seen are treated as (* :void).
  6046. - Don't wrap the contents of unnamed namespaces.
  6047. - More code cleanup. Removed some extraneous warnings.
  6048. - start work on having the allegrocl mod pass the cpp test-suite.
  6049. 2008-09-19: olly
  6050. [PHP5] Add typemaps for long long and unsigned long long.
  6051. 2008-09-18: wsfulton
  6052. [C#] Added C# array typemaps provided by Antti Karanta.
  6053. The arrays provide a way to use MarshalAs(UnmanagedType.LPArray)
  6054. and pinning the array using 'fixed'. See arrays_csharp.i library file
  6055. for details.
  6056. 2008-09-18: wsfulton
  6057. Document the optional module attribute in the %import directive,
  6058. see Modules.html. Add a warning for Python wrappers when the
  6059. module name for an imported base class is missing, requiring the
  6060. module attribute to be added to %import, eg
  6061. %import(module="FooModule") foo.h
  6062. 2008-09-18: olly
  6063. [PHP5] Change the default input typemap for char * to turn PHP
  6064. Null into C NULL (previously it was converted to an empty string).
  6065. The new behaviour is consistent with how the corresponding output
  6066. typemap works (SF#2025719).
  6067. If you want to keep the old behaviour, add the following typemap
  6068. to your interface file (PHP's convert_to_string_ex() function does
  6069. the converting from PHP Null to an empty string):
  6070. %typemap(in) char * {
  6071. convert_to_string_ex($input);
  6072. $1 = Z_STRVAL_PP($input);
  6073. }
  6074. 2008-09-18: olly
  6075. [PHP5] Fix extra code added to proxy class constructors in the case
  6076. where the only constructor takes no arguments.
  6077. 2008-09-18: olly
  6078. [PHP5] Fix wrapping of a renamed enumerated value of an enum class
  6079. member (SF#2095273).
  6080. 2008-09-17: mutandiz (Mikel Bancroft)
  6081. [allegrocl]
  6082. - Fix how forward reference typedefs are handled, so as not to conflict
  6083. with other legit typedefs.
  6084. - Don't (for now) perform an ffitype typemap lookup when trying to
  6085. when calling compose_foreign_type(). This is actually a useful thing
  6086. to do in certain cases, the test cases for which I can't currently
  6087. locate :/. It's breaking some wrapping behavior that is more commonly
  6088. seen, however. I'll readd in a more appropriate way when I can
  6089. recreate the needed test case, or a user complains (which means
  6090. they probably have a test case).
  6091. - document the -isolate command-line arg in the 'swig -help' output.
  6092. It was in the html docs, but not there.
  6093. - small amount of code cleanup, removed some unused code.
  6094. - some minor aesthetic changes.
  6095. 2008-09-12: bhy
  6096. [Python] Python 3.0 support branch merged into SWIG trunk. Thanks to
  6097. Google Summer of Code 2008 for supporting this project! By default
  6098. SWIG will generate interface files compatible with both Python 2.x
  6099. and 3.0. And there's also some Python 3 new features that can be
  6100. enabled by passing a "-py3" command line option to SWIG. These
  6101. features are:
  6102. - Function annotation support
  6103. Also, the parameter list of proxy function will be generated,
  6104. even without the "-py3" option. However, the parameter list
  6105. will fallback to *args if the function (or method) is overloaded.
  6106. - Buffer interface support
  6107. - Abstract base class support
  6108. For details of Python 3 support and these features, please see the
  6109. "Python 3 Support" section in the "SWIG and Python" chapter of the SWIG
  6110. documentation.
  6111. The "-apply" command line option and support of generating codes
  6112. using apply() is removed. Since this is only required by very old
  6113. Python.
  6114. This merge also patched SWIG's parser to solve a bug. By this patch,
  6115. SWIG features able to be correctly applied on C++ conversion operator,
  6116. such like this:
  6117. %feature("shadow") *::operator bool %{ ... %}
  6118. 2008-09-02: richardb
  6119. [Python] Commit patch #2089149: Director exception handling mangles
  6120. returned exception. Exceptions raised by Python code in directors
  6121. are now passed through to the caller without change. Also, remove
  6122. the ": " prefix which used to be added to other director exceptions
  6123. (eg, those due to incorrect return types).
  6124. 2008-09-02: wsfulton
  6125. [Python] Commit patch #1988296 GCItem multiple module linking issue when using
  6126. directors.
  6127. 2008-09-02: wsfulton
  6128. [C#] Support for 'using' and 'fixed' blocks in the 'csin' typemap is now
  6129. possible through the use of the pre attribute and the new terminator attribute, eg
  6130. %typemap(csin,
  6131. pre=" using (CDate temp$csinput = new CDate($csinput)) {",
  6132. terminator=" } // terminate temp$csinput using block",
  6133. ) const CDate &
  6134. "$csclassname.getCPtr(temp$csinput)"
  6135. See CSharp.html for more info.
  6136. 2008-09-01: wsfulton
  6137. [CFFI] Commit patch #2079381 submitted by Boris Smilga - constant exprs put into
  6138. no-eval context in DEFCENUM
  6139. 2008-08-02: wuzzeb
  6140. [Chicken,Allegro] Commit Patch 2019314
  6141. Fixes a build error in chicken, and several build errors and other errors
  6142. in Allegro CL
  6143. 2008-07-19: wsfulton
  6144. Fix building of Tcl examples/test-suite on Mac OS X reported by Gideon Simpson.
  6145. 2008-07-17: wsfulton
  6146. Fix SF #2019156 Configuring with --without-octave or --without-alllang
  6147. did not disable octave.
  6148. 2008-07-14: wsfulton
  6149. [Java, C#] Fix director typemaps for pointers so that NULL pointers are correctly
  6150. marshalled to C#/Java null in director methods.
  6151. 2008-07-04: olly
  6152. [PHP] For std_vector.i and std_map.i, rename empty() to is_empty()
  6153. since "empty" is a PHP reserved word. Based on patch from Mark Klein
  6154. in SF#1943417.
  6155. 2008-07-04: olly
  6156. [PHP] The deprecated command line option "-make" has been removed.
  6157. Searches on Google codesearch suggest that nobody is using it now
  6158. anyway.
  6159. 2008-07-04: olly
  6160. [PHP] The SWIG cdata.i library module is now supported.
  6161. 2008-07-03: olly
  6162. [PHP] The deprecated command line option "-phpfull" has been
  6163. removed. We recommend building your extension as a dynamically
  6164. loadable module.
  6165. 2008-07-02: olly
  6166. [PHP4] Support for PHP4 has been removed. The PHP developers are
  6167. no longer making new PHP4 releases, and won't even be providing
  6168. patches for critical security issues after 2008-08-08.
  6169. 2008-07-02: olly
  6170. [Python] Import the C extension differently for Python 2.6 and
  6171. later so that an implicit relative import doesn't produce a
  6172. deprecation warning for 2.6 and a failure for 2.7 and later.
  6173. Patch from Richard Boulton in SF#2008229, plus follow-up patches
  6174. from Richard and Haoyu Bai.
  6175. Version 1.3.36 (24 June 2008)
  6176. =============================
  6177. 06/24/2008: wsfulton
  6178. Remove deprecated -c commandline option (runtime library generation).
  6179. 06/24/2008: olly
  6180. [PHP] Fix assertion failure when handling %typemap(in,numinputs=0)
  6181. (testcase ignore_parameter).
  6182. 06/24/2008: olly
  6183. [PHP] Fix segfault when wrapping a non-class function marked with
  6184. %newobject (testcase char_strings).
  6185. 06/22/2008: wsfulton
  6186. [Java] Add a way to use AttachCurrentThreadAsDaemon instead of AttachCurrentThread
  6187. in director code. Define the SWIG_JAVA_ATTACH_CURRENT_THREAD_AS_DAEMON macro, see
  6188. Lib/java/director.swg.
  6189. 06/21/2008: wsfulton
  6190. [Ruby] Fix crashing in the STL wrappers (reject! and delete_if methods)
  6191. 06/19/2008: wsfulton
  6192. [Java, C#] C# and Java keywords will be renamed instead of just issuing a warning
  6193. and then generating uncompilable code. Warning 314 gives the new name when a
  6194. keyword is found.
  6195. 06/19/2008: wsfulton
  6196. [R] Keyword handling added. R Keywords will be renamed as necessary.
  6197. Warning 314 gives the new name when a keyword is found.
  6198. 06/17/2008: mgossage
  6199. [Lua] Added missing support for bool& and bool*. Added runtest for li_typemaps testcase.
  6200. (Bug #1938142)
  6201. 06/07/2008: bhy
  6202. Added test case keyword_rename, then made the keyword renaming works properly
  6203. by fixing Swig_name_make() for a incomplete condition checking.
  6204. 06/02/2008: wsfulton
  6205. [Java, C#] Fix enum wrappers when using -noproxy.
  6206. 05/30/2008: bhy
  6207. Added std::wstring into Lib/typemaps/primtypes.swg, since it is also a primitive
  6208. type in SWIG - fixed SF #1976978.
  6209. 05/29/2008: wsfulton
  6210. [Java, C#] Fix variable wrappers when using -noproxy.
  6211. 05/29/2008: bhy
  6212. [Python] Fixed a typo of %#ifdef in Lib/python/pycontainer.swg, which is related
  6213. to -extranative SWIG option - SF #1971977.
  6214. 05/20/2008: wsfulton
  6215. New partialcheck makefile targets for partial testing of the test-suite. These
  6216. just invoke SWIG, ie no compilation and no runtime testing. It can be faster
  6217. when developing by just doing a directory diff of the files SWIG generates
  6218. against those from a previous run. Example usage from the top level directory:
  6219. make partialcheck-test-suite
  6220. make partialcheck-java-test-suite
  6221. This change also encompasses more flexibility in running the test-suite, eg
  6222. it is possible to prefix the command line which runs any target language test
  6223. with a tool. See the RUNTOOL, COMPILETOOL and SWIGTOOL targets in the common.mk
  6224. file and makefiles in the test-suite directory. For example it is possible to
  6225. run the runtime tests through valgrind using:
  6226. make check RUNTOOL="valgrind --leak-check=full"
  6227. or invoke SWIG under valgrind using:
  6228. make check SWIGTOOL="valgrind --tool=memcheck"
  6229. 05/19/2008: drjoe
  6230. [R] Fixed define that was breaking pre-2.7. Checked in
  6231. patch from Soren Sonnenburg that creates strings in
  6232. version independent way
  6233. 05/15/2008: wsfulton
  6234. [Java] Fix variable name clash in directors - SF #1963316 reported by Tristan.
  6235. 05/14/2008: wsfulton
  6236. Add an optimisation for functions that return objects by value, reducing
  6237. the number of copies of the object that are made. Implemented using an
  6238. optional attribute in the "out" typemap called "optimal". Details in
  6239. Typemaps.html.
  6240. 05/11/2008: olly
  6241. [PHP] Check for %feature("notabstract") when generating PHP5 class
  6242. wrapper.
  6243. 05/11/2008: wsfulton
  6244. Fix SF #1943608 - $self substitution in %contract, patch submitted by
  6245. Toon Verstraelen.
  6246. 05/09/2008: olly
  6247. [PHP] Fix char * typemaps to work when applied to signed char * and
  6248. unsigned char * (uncovered by testcase apply_strings).
  6249. 05/09/2008: wsfulton
  6250. Fix wrapping of char * member variables when using allprotected mode.
  6251. Bug reported by Warren Wang.
  6252. 05/09/2008: olly
  6253. [PHP] Fix bad PHP code generated when wrapping an enum in a
  6254. namespace (uncovered by testcase arrays_scope).
  6255. 05/09/2008: olly
  6256. [PHP] SWIG now runs the PHP testsuite using PHP5, not PHP4. PHP4
  6257. is essentially obsolete now, so we care much more about solid PHP5
  6258. support.
  6259. 05/07/2008: wsfulton
  6260. STL fixes when using %import rather than %include and the Solaris Workshop
  6261. compiler and the Roguewave STL.
  6262. 05/07/2008: wsfulton
  6263. Fix wrapping of overloaded protected methods when using allprotected mode.
  6264. Bug reported by Warren Wang.
  6265. 05/03/2008: wsfulton
  6266. Commit patch #1956607 to add -MT support from Richard Boulton.
  6267. This patch mirrors the gcc -MT option which allows one to change the default
  6268. Makefile target being generated when generating makefiles with the -M family
  6269. of options. For example:
  6270. $ swig -java -MM -MT overriddenname -c++ example.i
  6271. overriddenname: \
  6272. example.i \
  6273. example.h
  6274. 04/30/2008: mgossage
  6275. [Lua] Removed generation of _wrap_delete_XXXXX (wrappered destructor)
  6276. which was unused and causing warning with g++ -Wall.
  6277. Removed other unused warning in typemaps.i and other places.
  6278. Added Examples/lua/embed3, and run tests a few test cases.
  6279. 04/24/2008: olly
  6280. [Python] Fix generated code for IBM's C++ compiler on AIX (patch
  6281. from Goeran Uddeborg in SF#1928048).
  6282. 04/24/2008: olly
  6283. Rename BSIZE in Examples/test-suite/arrays_scope.i to BBSIZE to
  6284. avoid a clash with BSIZE defined by headers on AIX with Perl
  6285. (reported in SF#1928048).
  6286. 04/20/2008: wsfulton
  6287. Add the ability to wrap all protected members when using directors.
  6288. Previously only the virtual methods were available to the target language.
  6289. Now all protected members, (static and non-static variables, non-virtual methods
  6290. and static methods) are wrapped when using the allprotected mode. The allprotected
  6291. mode is turned on in the module declaration:
  6292. %module(directors="1", allprotected="1") modulename
  6293. Version 1.3.35 (7 April 2008)
  6294. =============================
  6295. 04/07/2008: wsfulton
  6296. [Lua] Add missing pointer reference typemaps
  6297. 04/06/2008: wsfulton
  6298. Fix stack overflow when using typemap warning suppression, eg
  6299. %warnfilter(SWIGWARN_TYPEMAP_CHARLEAK_MSG)
  6300. 04/05/2008: wsfulton
  6301. [Python] Fix shared_ptr typemaps so that %pythonnondynamic can be used. Also corrects
  6302. display of the proxy class type. Reported by Robert Lupton.
  6303. 04/04/2008: olly
  6304. [Python] Add %newobject reference to python memory management subsection of manual
  6305. (patch from mdbeachy in SF#1894610).
  6306. 03/27/2008: wsfulton
  6307. [Python] Fix shared_ptr typemaps where the pointer type is a templated type with
  6308. with more than one parameter. Reported by Robert Lupton.
  6309. 03/27/2008: mgossage
  6310. [Lua] Added a typemap DISOWN for SWIGTYPE* and SWIGTYPE[], and support for %delobject feature.
  6311. Added Examples/lua/owner which demonstrates the use of the memory management.
  6312. 03/26/2008: wsfulton
  6313. [Java] Apply patch #1844301 from Monty Taylor to suppress enum constructor
  6314. unused warnings.
  6315. 03/26/2008: wsfulton
  6316. [Python] Apply patch #1924524 from Casey Raymondson which ensures the
  6317. "No constructor defined" message is displayed when attempting to call a
  6318. constructor on a class that doesn't have a constructor wrapper, eg if
  6319. the C++ class is abstract.
  6320. 03/26/2008: wsfulton
  6321. [Python] Apply patch #1925702 from Casey Raymondson which removes warning 512
  6322. for std::vector wrappers.
  6323. 03/26/2008: olly
  6324. [Python] Apply GCC 4.3 warnings patch from Philipp Thomas
  6325. (SF#1925122).
  6326. 03/21/2008: wsfulton
  6327. [Python] Thread safety patch for STL iterators from Abhinandan Jain.
  6328. 03/17/2008: mgossage
  6329. [Lua] Added %luacode feature to add source code into wrappers.
  6330. Updated documentation to document this.
  6331. Added Examples/lua/arrays to show its use (and typemaps)
  6332. 03/17/2008: olly
  6333. Fix nonportable sed usage which failed on Mac OS X (and probably
  6334. other platforms). Fixes SF#1903612.
  6335. 03/17/2008: olly
  6336. Fix memory leak in SWIG's parser (based on patch from Russell
  6337. Bryant in SF#1914023).
  6338. 03/12/2008: wsfulton
  6339. Fix bug #1878285 - unnecessary cast for C struct creation wrappers.
  6340. 03/12/2008: wsfulton
  6341. [Python] Remove debugging info when using shared_ptr support
  6342. 03/06/2008: mgossage
  6343. [Lua] Updated documentation for Lua exceptions.
  6344. Added Examples/lua/exception and Examples/lua/embed2.
  6345. Small updates to the typemaps.
  6346. 03/04/2008: wsfulton
  6347. [Java, C#] Add char *& typemaps.
  6348. 03/04/2008: wsfulton
  6349. Fix occasional seg fault when attempting to report overloaded methods as being ignored.
  6350. 02/29/2008: wsfulton
  6351. [Perl] Fix #1904537 Swig causes a Perl warning "x used only once" in Perl 5.10
  6352. reported by Ari Jolma
  6353. 02/29/2008: wsfulton
  6354. [Python] Add shared_ptr varin/varout typemaps for wrapping global variables.
  6355. 02/25/2008: wsfulton
  6356. Fix $wrapname to work in %exception (fixes some wrap:name assertions)
  6357. Version 1.3.34 (27 February 2008)
  6358. =================================
  6359. 02/13/2008: wsfulton
  6360. [R] Fix wrapping of global function pointer variables.
  6361. 02/13/2008: wsfulton
  6362. Add new special variables for use within %exception:
  6363. $wrapname - language specific wrapper name
  6364. $overname - if a method is overloaded this contains the extra mangling used on
  6365. the overloaded method
  6366. $decl - the fully qualified C/C++ declaration of the method being wrapped
  6367. without the return type
  6368. $fulldecl - the fully qualified C/C++ declaration of the method being wrapped
  6369. including the return type
  6370. 02/12/2008: drjoe
  6371. [R] Now setting S4 flag in SWIG created objects. This
  6372. fixes R-SWIG for 2.6 and warning for 2.6 failure has been removed.
  6373. 02/11/2008: mgossage
  6374. [Lua] Added a patch by Torsten Landschoff to fix the unary minus issue
  6375. Ran 'astyle --style=kr -2' across lua.cxx to neaten it up
  6376. 02/10/2008: wsfulton
  6377. Bump SWIG_RUNTIME_VERSION to 4. This is because of the recently introduced API
  6378. change in the conversion functions, ie change in definition of swig_converter_func.
  6379. Anyone calling SWIG_TypeCast must pass in a valid value for the new additional
  6380. (third) parameter and then handle the newly created memory if the returned value
  6381. is set to SWIG_CAST_NEW_MEMORY else a memory leak will ensue.
  6382. 02/09/2008: wsfulton
  6383. [Python] Experimental shared_ptr typemaps added. Usage is the same as the recently
  6384. added Java and C# shared_ptr typemaps. Two macros are available, although these
  6385. may well change in a future version:
  6386. For base classes or classes not in an inheritance chain:
  6387. SWIG_SHARED_PTR(PROXYCLASS, TYPE)
  6388. For derived classes:
  6389. SWIG_SHARED_PTR_DERIVED(PROXYCLASS, BASECLASSTYPE, TYPE)
  6390. The PROXYCLASS is the name of the proxy class, but is only required for Java/C#.
  6391. Example usage:
  6392. %include "boost_shared_ptr.i"
  6393. SWIG_SHARED_PTR(Klass, Space::Klass)
  6394. SWIG_SHARED_PTR_DERIVED(KlassDerived, Space::Klass, Space::KlassDerived)
  6395. namespace Space {
  6396. struct Klass { ... };
  6397. struct KlassDerived : Klass { ... };
  6398. }
  6399. Further details to follow in future documentation, but the following features
  6400. should be noted:
  6401. - Not restricted to boost::shared_ptr, eg std::tr1::shared_ptr can also be used.
  6402. - Available typemap groups:
  6403. (a) Typemaps for shared_ptr passed by value, reference, pointer and pointer
  6404. reference.
  6405. - (b) Typemaps for passing by raw value, raw pointer, raw reference, raw pointer
  6406. reference.
  6407. - The code being wrapped does not even have to use shared_ptr, SWIG can use
  6408. shared_ptr as the underlying storage mechanism instead of a raw pointer due to
  6409. the typemaps in group (b) above.
  6410. - No array support as shared_ptr does not support arrays.
  6411. - This works quite differently to the usual SWIG smart pointer support when
  6412. operator-> is parsed by SWIG:
  6413. - An additional smart pointer class is not generated reducing code bloat in
  6414. the wrappers.
  6415. - Using smart pointers and raw pointers can be mixed seamlessly.
  6416. - Missing constructors for the smart pointers is no longer a problem and so
  6417. separate factory type functions do not have to be written and wrapped.
  6418. - The implicit C++ shared_ptr< derived class > to shared_ptr< base class >
  6419. cast also works in the target language. This negates the necessity to write
  6420. an explicit helper cast function providing the upcast which would need
  6421. calling prior to passing a derived class to a method taking a shared_ptr to
  6422. a base class.
  6423. 02/09/2008: wsfulton
  6424. [Python] Add support for overriding the class registration function via a new
  6425. "smartptr" feature. This is a very low level of customisation most users
  6426. would never need to know. The feature will typically be used for intrusive
  6427. smart pointers along with additional typemaps. Example usage of the feature:
  6428. %feature("smartptr", noblock=1) Foo { boost::shared_ptr< Foo > }
  6429. class Foo {};
  6430. The generated Foo_swigregister function will then register boost::shared < Foo >
  6431. (SWIGTYPE_p_boost__shared_ptrTFoo_t instead of SWIGTYPE_p_Foo) as the underlying
  6432. type for instantiations of Foo.
  6433. 02/09/2008: wsfulton
  6434. Features now supports the optional 'noblock' attribute for all usage of %feature.
  6435. When specified, the { } braces are removed from the feature code. This is identical
  6436. in behaviour to usage of 'noblock' in typemaps and is used when the preprocessor
  6437. is required to operate on the code in the feature and the enclosing { } braces
  6438. are not required. Example:
  6439. #define FOO foo
  6440. %feature("smartptr", noblock="1") { FOO::bar }
  6441. The preprocessor then reduces this as if this had been used instead:
  6442. %feature("smartptr") "foo::bar"
  6443. 02/01/2008: olly
  6444. [Python] Fix format string bug (SF#1882220).
  6445. 01/31/2008: wsfulton
  6446. Additions to the %types directive. Now the conversion / casting code can be
  6447. overridden to some custom code in the %types directive, like so:
  6448. %types(fromtype = totype) %{
  6449. ... code to convert fromtype to totype and return ...
  6450. %}
  6451. The special variable $from will be replaced by the name of the parameter of the
  6452. type being converted from. The code must return the totype cast to void *. Example:
  6453. class Time;
  6454. class Date;
  6455. Date &Time::dateFromTime();
  6456. %types(Time = Date) %{
  6457. Time *t = (Time *)$from;
  6458. Date &d = t->dateFromTime();
  6459. return (void *) &d;
  6460. %}
  6461. resulting in the conversion / casting code looking something like:
  6462. static void *_p_TimeTo_p_Date(void *x) {
  6463. Time *t = (Time *)x;
  6464. Date &d = t->dateFromTime();
  6465. return (void *) &d;
  6466. }
  6467. This is advanced usage, please use only if you understand the runtime type system.
  6468. 01/30/2008: mgossage
  6469. Small update to documentation in Typemaps.html, to warn about use of local
  6470. variables in typemaps for multiple types.
  6471. 01/25/2008: wsfulton
  6472. [Java] Fix bug reported by Kevin Mills in ARRAYSOFCLASSES typemaps where any
  6473. changes made to an array element passed from Java to C are not reflected back
  6474. into Java.
  6475. 01/24/2008: mgossage
  6476. More updates to the configure script for detecting lua.
  6477. Also looks in /usr/include/lua*
  6478. Also changed typemaps.i not to check for NULL before freeing a pointer
  6479. 01/21/2008: wsfulton
  6480. [Python] For STL containers, SWIG no longer attempts to convert from one
  6481. STL container to another, eg from std::vector<int> to std::vector<double>
  6482. or std::list<int> to std::vector<int> or even std::vector<Foo> to
  6483. std::vector<Bar> as it previously did. In fact SWIG no longer attempts to
  6484. convert any SWIG wrapped C++ proxy class that is also a Python sequence,
  6485. whereas previously it would. Any non-SWIG Python sequence will still be
  6486. accepted wherever an STL container is accepted. Overloaded methods using
  6487. containers should be faster.
  6488. 01/18/2008: wsfulton
  6489. [C#] Add 'directorinattributes' and 'directoroutattributes' typemap attributes
  6490. for the imtype typemap. These should contain C# attributes which will
  6491. be generated into the C# director delegate methods.
  6492. 01/18/2008: olly
  6493. Fix handling of byte value 255 in input files on platforms where
  6494. char is signed (it was getting mapped to EOF). Fixes SF#1518219.
  6495. 01/16/2008: wsfulton
  6496. Fix template member variables wrapped by a smart pointer. Bug reported
  6497. by Robert Lupton.
  6498. 01/14/2008: mgossage
  6499. Substantial changes to configure script for detecting lua.
  6500. Code can now link to liblua.a, liblua50.a or liblua51.a
  6501. It's also a lot neater now.
  6502. 12/16/2007: wsfulton
  6503. [Perl] Backed out #1798728 - numbers can be passed to functions taking char *
  6504. 12/16/2007: wsfulton
  6505. Fix #1832613 - Templates and some typedefs involving pointers or function pointers
  6506. 12/12/2007: wsfulton
  6507. [Java] Fix #1632625 - Compilation errors on Visual C++ 6 when using directors.
  6508. 12/12/2007: wsfulton
  6509. [Perl] Fix #1798728 - numbers can be passed to functions taking char *.
  6510. 12/12/2007: wsfulton
  6511. Fix #1819847 %template with just one default template parameter
  6512. template<typename T = int> class Foo {...};
  6513. %template(FooDefault) Foo<>;
  6514. 12/12/2007: mgossage
  6515. [Lua] Small correction on Lua.html
  6516. 12/09/2007: wsfulton
  6517. Apply patch #1838248 from Monty Taylor for vpath builds of SWIG.
  6518. 12/08/2007: wsfulton
  6519. [Lua] Fixes to remove gcc-4.2 warnings
  6520. 12/06/2007: wsfulton
  6521. Fix #1734415 - template template parameters with default arguments such as:
  6522. template<typename t_item, template<typename> class t_alloc = pfc::alloc_fast >
  6523. class list_t : public list_impl_t<t_item,pfc::array_t<t_item,t_alloc> > { ... };
  6524. 12/04/2007: mgossage
  6525. [lua] Fix a bug in the class hierachy code, where the methods were not propagated,
  6526. if the name ordering was in a certain order.
  6527. Added new example programs (dual, embed) and runtime tests for test-suite.
  6528. 11/30/2007: wsfulton
  6529. Fix using statements using a base class method where the methods were overloaded.
  6530. Depending on the order of the using statements and method declarations, these
  6531. were previously generating uncompilable wrappers, eg:
  6532. struct Derived : Base {
  6533. virtual void funk();
  6534. using Base::funk;
  6535. };
  6536. Version 1.3.33 (November 23, 2007)
  6537. ==================================
  6538. 11/21/2007: mikel
  6539. [allegrocl] omit private slot type info in the classes/types
  6540. defined on the lisp side. Fix bug in mapping of C/++ types
  6541. to lisp types. Fix typo in modules generated defpackage form.
  6542. Have std::string *'s automatically marshalled between foreign
  6543. and lisp strings.
  6544. 11/20/2007: olly
  6545. [Python] Fill in Python Dictionary functions list (patch from
  6546. Jelmer Vernooij posted to swig-devel).
  6547. 11/20/2007: beazley
  6548. Fixed a bug in the C scanner related to backslash characters.
  6549. 11/19/2007: wsfulton
  6550. [Perl] Fix broken compilation of C++ wrappers on some compilers.
  6551. 11/16/2007: olly
  6552. [Python] Don't pass Py_ssize_t for a %d printf-like format as
  6553. that's undefined behaviour when sizeof(Py_ssize_t) != sizeof(int).
  6554. Version 1.3.32 (November 15, 2007)
  6555. ==================================
  6556. 11/14/2007: wsfulton
  6557. [R] Package name and dll name is now the same as the SWIG module
  6558. name. It used to be the module name with _wrap as a suffix. The package
  6559. and dll names can be modified using the -package and -dll commandline
  6560. options.
  6561. *** POTENTIAL INCOMPATIBILITY ***
  6562. 11/11/2007: wsfulton
  6563. [R] Add support for Windows (Visual C++ 8 tested)
  6564. 11/10/2007: olly
  6565. [php] Fix makefile generated by -make (SF#1633679). Update
  6566. documentation to mark "-make" as deprecated (none of the other
  6567. SWIG backends seem to offer such a feature, it can't realistically
  6568. generate a fully portable makefile, and the commands to build an
  6569. extension are easy enough to write for the user's preferred build
  6570. tool). Also recommend against the use of "-phpfull" (it's only
  6571. really useful when static linking, and a dynamically loadable
  6572. module is virtually always the better approach).
  6573. 11/09/2007: olly
  6574. Fix --help output to note that `export SWIG_FEATURES' is required.
  6575. 10/29/2007: wsfulton
  6576. [R] Fix seg fault on Windows
  6577. [R] Examples R scripts are now platform independent
  6578. 10/30/2007: mgossage
  6579. [lua] fixed bug in template classes which cases template_default2
  6580. and template_specialization_defarg to fail.
  6581. Added several warning filters into the overload's test cases.
  6582. Added runtime tests for several codes.
  6583. You can now make check-lua-test-suite with no errors and only a few warnings.
  6584. 10/30/2007: olly
  6585. [guile] Fix the configure test to put GUILELINK in LIBS not LDFLAGS
  6586. (SF#1822430).
  6587. 10/30/2007: olly
  6588. [guile] Fix the guile examples on 64-bit platforms.
  6589. 10/29/2007: wsfulton
  6590. [C#] Fix member pointers on 64 bit platforms.
  6591. 10/28/2007: olly
  6592. [lua] Fix swig_lua_class instances to be static to allow multiple
  6593. SWIG wrappers to be compiled into the same executable statically.
  6594. Patch from Andreas Fredriksson (posted to the swig mailing list).
  6595. 10/28/2007: olly
  6596. [lua] Fix Examples/lua to pass SRCS for C tests rather than CXXSRCS.
  6597. The code as it was happened to work on x86, but broke on x86_64 (and
  6598. probably any other platforms which require -fPIC).
  6599. 10/28/2007: wsfulton
  6600. [Java, C#] New approach for fixing uninitialised variable usage on error in director
  6601. methods using the new templated initialisation function SwigValueInit().
  6602. 10/28/2007: wsfulton
  6603. [Perl] Use more efficient SvPV_nolen(x) instead of SvPV(x,PL_na) if SvPV_nolen is
  6604. supported.
  6605. 10/26/2007: wuzzeb
  6606. [Chicken] Fix global variables of class member function pointers.
  6607. Other minor fixes, so all tests in the chicken test suite now pass
  6608. 10/25/2007: olly
  6609. Fix UTL typecheck macro for a function taking char[] or const
  6610. char[] (SF#1820132).
  6611. 10/22/2007: mkoeppe
  6612. [Guile] Filter out -ansi -pedantic from CFLAGS while compiling test programs for Guile
  6613. in configure. This enables running the test suite for Guile if it is installed and
  6614. usable.
  6615. 10/22/2007: mkoeppe
  6616. [Guile -scm] Fix testcases apply_signed_char and apply_strings
  6617. by adding explicit casts to the appropriate $ltype.
  6618. 10/22/2007: wsfulton
  6619. [Java, C#] Fix uninitialised variable usage on error in director methods.
  6620. 10/19/2007: wsfulton
  6621. [Java, C#] Bug #1794247 - fix generated code for derived classes when csbase or javabase
  6622. typemaps are used with the replace="1" attribute.
  6623. 10/19/2007: wsfulton
  6624. [Python] Docs updated to suggest using distutils. Patch #1796681 from Christopher Barker.
  6625. 10/19/2007: olly
  6626. [perl5] Clear errno before calls to strtol(), strtoul(), strtoll()
  6627. and strtoull() which we check errno after to avoid seeing a junk
  6628. value of errno if there isn't an error in the call.
  6629. 10/16/2007: wsfulton
  6630. Deprecate %attribute_ref and replace with %attributeref. There is just an argument
  6631. order change in order to maintain consistency with %attribute, from:
  6632. %attribute_ref(Class, AttributeType, AccessorMethod, AttributeName)
  6633. to
  6634. %attributeref(Class, AttributeType, AttributeName, AccessorMethod)
  6635. 10/16/2007: olly
  6636. [Tcl] Fix several occurrences of "warning: deprecated conversion
  6637. from string constant to 'char*'" from GCC 4.2 in generated C/C++
  6638. code.
  6639. 10/16/2007: olly
  6640. [PHP] Fix many occurrences of "warning: deprecated conversion from
  6641. string constant to 'char*'" from GCC 4.2 in generated C/C++ code
  6642. when compiling with a new enough version of PHP 5 (tested with
  6643. PHP 5.2.3, but PHP 5.2.1 is probably the minimum requirement).
  6644. 10/15/2007: wsfulton
  6645. Patch #1797133 from David Piepgrass fixes %attribute when the getter has the same name
  6646. as the attribute name and no longer generate non-functional setter for read-only attributes.
  6647. 10/15/2007: olly
  6648. [Tcl] Prevent SWIG_Tcl_ConvertPtr from calling the unknown proc.
  6649. Add Examples/tcl/std_vector/ which this change fixes. Patch
  6650. is from "Cliff C" in SF#1809819.
  6651. 10/12/2007: wsfulton
  6652. [Java] Add DetachCurrentThread back in for directors. See entry dated 08/11/2006 and
  6653. search for DetachCurrentThread on the mailing lists for details. The crashes on Solaris
  6654. seem to be only present in jdk-1.4.2 and lower (jdk-1.5.0 and jdk-1.6.0 are okay), so
  6655. anyone using directors should use a recent jdk on Solaris, or define (see director.swg)
  6656. SWIG_JAVA_NO_DETACH_CURRENT_THREAD to the C++ compiler to get old behaviour.
  6657. 10/12/2007: wsfulton
  6658. [Java] Ensure the premature garbage collection prevention parameter (pgcpp) is generated
  6659. when there are C comments in the jtype and jstype typemaps.
  6660. 10/12/2007: wuzzeb
  6661. Added a testsuite entry for Bug #1735931
  6662. 10/09/2007: olly
  6663. Automatically rerun autogen.sh if configure.in is modified.
  6664. 10/09/2007: olly
  6665. Enhance check-%-test-suite rule and friends to give a more helpful
  6666. error message if you try them for a language which doesn't exist
  6667. (e.g. "make check-php-test-suite" rather than the correct
  6668. "make check-php4-test-suite").
  6669. 10/09/2007: olly
  6670. Add make rule to regenerate Makefile from Makefile.in if it has
  6671. changed.
  6672. 10/09/2007: olly
  6673. [php] Fix long-standing memory leak in wrapped constructors and
  6674. wrapped functions/methods which return an object.
  6675. 10/08/2007: olly
  6676. Fix Makefile.in to read check.list files correctly in a VPATH
  6677. build.
  6678. 10/07/2007: wsfulton
  6679. [C#, Java] Experimental shared_ptr typemaps added
  6680. 09/27/2007: mgossage
  6681. [lua] added more verbose error messages for incorrect typechecks.
  6682. Added a routine which checks the exact number of parameters passed to a function
  6683. (breaks operator_overloading for unary minus operator, currently disabled).
  6684. Reorganised the luatypemaps.swg to tidy it up.
  6685. Added a lot of %ignores on the operators not supported by lua.
  6686. Added support for constant member function pointers & runtest for member_pointer.i
  6687. Added first version of wchar.i
  6688. 09/25/2007: wsfulton
  6689. [C#, Java] throws typemaps for std::wstring using C# patch #1799064 from David Piepgrass
  6690. 09/24/2007: wsfulton
  6691. [Tcl] Apply #1771313 to fix bug #1650229 - fixes long long and unsigned long long
  6692. handling.
  6693. 09/20/2007: olly
  6694. [Java] Eliminate some unnecessary uses of a temporary buffer
  6695. allocated using new[]. SF#1796609.
  6696. 09/19/2007: wsfulton
  6697. [C#] The $csinput special variable can be used in the csvarin typemap where it is always
  6698. expanded to 'value'.
  6699. 09/19/2007: wsfulton
  6700. [C#] Fix bug reported by Glenn A Watson and #1795260 where the cstype typemap used the 'ref'
  6701. keyword in the typemap body, it produced uncompilable C# properties (variable wrappers).
  6702. The type for the property now correctly comes from the 'out' attribute in the cstype typemap.
  6703. 09/19/2007: wsfulton
  6704. [Java] Fix const std::wstring& typemaps
  6705. 09/19/2007: wsfulton
  6706. [Java] Ensure the premature garbage collection prevention parameter (pgcpp) is generated
  6707. where a parameter is passed by pointer reference, eg in the std::vector wrappers. The pgcpp
  6708. is also generated now when user's custom typemaps use a proxy class in the jstype typemap
  6709. and a 'long' in the jtype typemap.
  6710. 09/18/2007: olly
  6711. [php] Add typemaps for handling parameters of type std::string &
  6712. which are modified by the wrapped function.
  6713. 09/17/2007: olly
  6714. [python] Split potentially long string literals to avoid hitting
  6715. MSVC's low fixed limit on string literal length - patch from
  6716. SF#1723770, also reported as SF#1630855.
  6717. 09/17/2007: olly
  6718. [ocaml] Fix renaming of overloaded methods in the method_table -
  6719. my patch from SF#940399.
  6720. 09/17/2007: olly
  6721. [python] Simpler code for SWIG_AsVal_bool() which fixes a "strict
  6722. aliasing" warning from GCC - patch from SF#1724581 by Andrew
  6723. Baumann.
  6724. 09/17/2007: olly
  6725. [perl5] Use sv_setpvn() to set a scalar from a pointer and length
  6726. - patch from SF#174460 by "matsubaray".
  6727. 09/17/2007: olly
  6728. When wrapping C++ code, generate code which uses
  6729. std::string::assign(PTR, LEN) rather than assigning
  6730. std::string(PTR, LEN). Using assign generates more efficient code
  6731. (tested with GCC 4.1.2).
  6732. 09/07/2007: wsfulton
  6733. Fix %ignore on constructors which are not explicitly declared [SF #1777712]
  6734. 09/05/2007: wuzzeb (John Lenz)
  6735. - Change r_ltype in typesys.c to store a hashtable instead of a single value.
  6736. several very subtle bugs were being caused by multiple ltypes being mapped
  6737. to a single mangled type, mostly when using typedefed template parameters.
  6738. Now, r_ltype stores a hashtable of possible ltypes, and when generating the
  6739. type table, all the ltypes are added into the swig_type_info structure.
  6740. 08/31/2007: wsfulton
  6741. SF #1754967 from James Bigler.
  6742. - Fix bug in turning on warnings that were turned off by default. Eg 'swig -w+309' will now
  6743. turn on the normally suppressed warning 309.
  6744. - New -Wextra commandline option which enables the extra warning numbers:
  6745. 202,309,403,512,321,322 (this is the list of warnings that have always been suppressed by
  6746. default). By specifying -Wextra, all warnings will be turned on, but unlike -Wall,
  6747. warnings can still be selectively turned on/off using %warnfilter,
  6748. #pragma SWIG nowarn or further -w commandline options, eg:
  6749. swig -Wextra -w309
  6750. will turn on all warnings except 309.
  6751. 08/28/2007: wsfulton
  6752. - New debugging options, -debug-module <n> and -debug-top <n> to display the parse tree at
  6753. various stages, where <n> is a comma separated list of stages 1-4.For example, to
  6754. display top of parse tree at stages 1 and 3:
  6755. swig -debug-top 1,3
  6756. - Deprecate the following options which have equivalents below:
  6757. -dump_parse_module => -debug-module 1
  6758. -dump_module => -debug-module 4
  6759. -dump_parse_top => -debug-top 1
  6760. -dump_top => -debug-top 4
  6761. - Renamed some commandline options for naming consistency across all options:
  6762. -debug_template => -debug-template
  6763. -debug_typemap => -debug-typemap
  6764. -dump_classes => -debug-classes
  6765. -dump_tags => -debug-tags
  6766. -dump_typedef => -debug-typedef
  6767. -dump_memory => -debug-memory
  6768. 08/25/2007: olly
  6769. [PHP5] Fix handling of double or float parameters with an integer
  6770. default value.
  6771. 08/25/2007: olly
  6772. [PHP5] Generate __isset() methods for setters for PHP 5.1 and later.
  6773. 08/20/2007: wsfulton
  6774. [Java C#] Fix director bug #1776651 reported by Stephane Routelous which occurred when
  6775. the director class name is the same as the start of some other symbols used within
  6776. the director class.
  6777. 08/17/2007: wsfulton
  6778. Correct behaviour for templated methods used with %rename or %ignore and the empty
  6779. template declaration - %template(). A warning is issued if the method has not been
  6780. renamed.
  6781. 08/16/2007: mutandiz (Mikel Bancroft)
  6782. [allegrocl] Name generated cl file based on input file rather than by
  6783. module name. It was possible to end up with a mypackage.cl and a test_wrap.c
  6784. when parsing a test.i input file. Confusing. Also, include external-format
  6785. templates for :fat and :fat-le automatically to avoid these being compiled
  6786. at runtime.
  6787. 08/15/2007: efuzzyone
  6788. [cffi] Apply patch #1766076 from Leigh Smith adding support for newly introduced
  6789. in cffi :long-long and :unsigned-long-long.
  6790. 08/10/2007: wsfulton
  6791. [Java] Add documentation patch #1743573 from Jeffrey Sorensen. It contains a neat
  6792. idea with respect to better memory management by the JVM of C++ allocated memory.
  6793. 08/10/2007: wsfulton
  6794. [Perl] Apply patch #1771410 from Wade Brainerd to fix typedef XS(SwigPerlWrapper) in
  6795. perlrun.swg for ActiveState Perl build 822 and Perl 5.8.9 and 5.10 branches.
  6796. 08/10/2007: wsfulton
  6797. [Lua] const enum reference typemaps fixed.
  6798. 08/09/2007: wsfulton
  6799. [C#] Added missing support for C++ class member pointers.
  6800. 08/09/2007: wsfulton
  6801. [C#, Java] Add support for $owner in the "out" typemaps like in the scripting
  6802. language modules. Note that $owner has always been supported in the "javaout" / "csout"
  6803. typemaps.
  6804. 08/01/2007: wsfulton
  6805. Fix smart pointer handling for classes that have templated methods within the smart
  6806. pointer type. Problem reported by craigdo at ee.washington.edu.
  6807. 07/31/2007: efuzzyone
  6808. [cffi] fixed memory access after being freed bug. thanks to Martin Percossi.
  6809. package name clos changed to cl. thanks to Ralf Mattes
  6810. 07/24/2007: wsfulton
  6811. Parallel make support added for the examples and test-suite for developers who have
  6812. more than one CPU. Now parallel make can be used for checking in addition to building
  6813. the SWIG executable. Some typical checking examples:
  6814. make -j8 -k check
  6815. make -j4 check-java-test-suite
  6816. make -j2 check-java-examples
  6817. 07/19/2007: mgossage
  6818. Fixed bug that stopped configure working on mingw (applied dos2unix to configure.in)
  6819. 07/10/2007: mgossage
  6820. [lua] Extra compatibility with Lua 5.1 (updated SWIG_init, docs, examples, test suite)
  6821. Removed name clash for static link of multiple modules
  6822. 07/05/2007: mgossage
  6823. [lua] Fix a bug in SWIG_ALLOC_ARRAY()
  6824. improved the error messages for incorrect arguments.
  6825. Changed the output of swig_type() to use the human readable form of the type,
  6826. rather than the raw swig type.
  6827. 07/03/2007: wsfulton
  6828. [C#] Fix directors for some overloaded methods where the imtype resulted in identical
  6829. methods being generated in the C# director class, eg void foo(int *) and void foo(double *)
  6830. used to generated two of these:
  6831. private void SwigDirectorfoo(IntPtr p) { ... }
  6832. 06/25/2007: wsfulton
  6833. [Java, C#] Some parameter name changes in std_vector.i allowing better targeting
  6834. of typemaps for method parameters (for memory management of containers of pointers).
  6835. 06/07/2007: mutandiz (Mikel Bancroft)
  6836. [allegrocl]
  6837. fix foreign-type constructor to properly look for ffitype typemap
  6838. bindings. fix inout_typemaps.i for strings.
  6839. 06/06/2007: olly
  6840. [Ruby]
  6841. Use whichever of "long" or "long long" is the same size as "void*"
  6842. to hold pointers as integers, rather than whichever matches off_t.
  6843. Fixes compilation on OS X and GCC warnings on platforms where
  6844. sizeof(void*) < sizeof(off_t) (SF patch #1731979).
  6845. 06/06/2007: olly
  6846. [PHP5]
  6847. Fix handling of a particular case involving overloaded functions
  6848. with default parameters.
  6849. 06/05/2007: mutandiz (Mikel Bancroft)
  6850. [allegrocl]
  6851. Fix case where we'd pass fully qualified identifiers
  6852. (i.e. NS1::NS2::FOO) to swig-insert-id. All namespaces
  6853. should be stripped.
  6854. Fix bug in TypedefHandler introduced by last fix.
  6855. 06/05/2007: olly
  6856. Fix reporting of filenames in errors after %include (patch from
  6857. Leigh Smith in #1731040; also reported as #1699940).
  6858. 05/31/2007: olly
  6859. [Python]
  6860. Fix "missing initialiser" warning when compiling generated C/C++
  6861. wrapper code with Python 2.5 with warnings enabled (patch from
  6862. bug#1727668 from Luke Moore).
  6863. 05/29/2007: olly
  6864. [Python]
  6865. Split docstrings into separate string literals at each newline when
  6866. generating C/C++ wrapper code (the C/C++ compiler will just combine
  6867. them back into a single string literal). This avoids MSVC
  6868. complaining that the strings are too long (problem reported by
  6869. Bo Peng on the mailing list).
  6870. 05/28/2007: olly
  6871. [Python]
  6872. Escape backslashes in docstrings.
  6873. 05/26/2007: olly
  6874. [Python]
  6875. Fix autodoc generation of enums to be more consistent with how the
  6876. enums are wrapped - patch #1697226 from Josh Cherry.
  6877. 05/26/2007: olly
  6878. [PHP5]
  6879. Fix wrapping of methods and functions which return a pointer to a
  6880. class (bug#1700788) and those which have overloaded forms returning
  6881. both classes and non-classes (bug#1712717, thanks to Simon
  6882. Berthiaume for the patch).
  6883. 05/25/2007: wsfulton
  6884. Fixed %rename inconsistency in conversion operators as reported by Zhong Ren. The matching
  6885. is now done on the operator name in the same way as it is done for parameters. For example:
  6886. %rename(opABC) Space::ABC::operator ABC() const;
  6887. %rename(methodABC) Space::ABC::method(ABC a) const;
  6888. namespace Space {
  6889. class ABC {
  6890. public:
  6891. void method(ABC a) const {}
  6892. operator ABC() const { ABC a; return a; }
  6893. };
  6894. }
  6895. Note that qualifying the conversion operator previously may or may not have matched.
  6896. Now it definitely won't, so this will not match:
  6897. %rename(opABC) Space::ABC::operator Space::ABC() const;
  6898. in the same way that this does not match:
  6899. %rename(methodABC) Space::ABC::method(Space::ABC a) const;
  6900. The documentation has been improved with respect to %rename, namespaces and templates.
  6901. Conversion operators documentation too.
  6902. *** POTENTIAL INCOMPATIBILITY ***
  6903. 05/16/2007: mutandiz
  6904. [allegrocl]
  6905. Fix bad generation of local var ltype's in functionWrapper().
  6906. Try to work better with the backward order in which swig
  6907. unrolls nested class definitions.
  6908. cleaned up a little unnecessary code/debug printf's.
  6909. Remove warning when replacing $ldestructor for ff:foreign-pointer
  6910. 05/12/2007: olly
  6911. [Python]
  6912. swig -python -threads now generates C/C++ code which uses Python's
  6913. own threading abstraction (from pythread.h) rather than OS specific
  6914. code. The old code failed to compile on MS Windows. (See SF patch
  6915. tracker #1710341).
  6916. 05/04/2007: gga
  6917. [Ruby]
  6918. Changed STL renames to be global renames. This fixes
  6919. STL functions not being renamed when autorename is on.
  6920. This is a not a totally perfect work-around, but better.
  6921. Someone really needs to fix the template renaming code.
  6922. (See bug #1545634)
  6923. 05/04/2007 gga
  6924. [All]
  6925. Changed %rename("%(undercase)s") a little so that single
  6926. numbers at the end of a function are not undercased. That is:
  6927. getSomething -> get_something
  6928. get2D -> get_2d
  6929. get234 -> get_234
  6930. BUT:
  6931. asFloat2 -> as_float2
  6932. (Bug #1699714)
  6933. 05/03/2007: gga
  6934. [Ruby]
  6935. Made __swigtype__ => @__swigtype__ so it can be accessed
  6936. from the scripting language (and follows Ruby's official
  6937. documentation, just in case).
  6938. Made tracking => @__trackings__ for same reason.
  6939. Currently storing ivars without the @ seems valid, but
  6940. the PickAxe says this is not correct, so just in case...
  6941. 05/03/2007: gga
  6942. [Ruby]
  6943. Applied patch for -minherit bug and exception classes.
  6944. This issue should be revisited more closely, as Multiple
  6945. Inheritance in Ruby is still problematic.
  6946. (patch/bug #1604878)
  6947. 05/03/2007: gga
  6948. [Ruby]
  6949. Overloaded functions in ruby will now report to the user
  6950. the possible prototypes when the user mistypes the number or
  6951. type of a parameter.
  6952. 05/03/2007: gga
  6953. [Ruby]
  6954. Forgot to document the bug fixing of an old bug regarding
  6955. exceptions.
  6956. (bug #1458247)
  6957. 05/03/2007: gga
  6958. [Ruby]
  6959. Fixed Ruby documentation to use the proper css styles for
  6960. each section. Added autodoc section to Ruby's docs to
  6961. document the features supported by Ruby in documenting its modules.
  6962. Made rdoc documentation spit out the full name of the class +
  6963. method name. Albeit this will make the current rdoc not recognize
  6964. the method, this is still needed to disambiguate between different
  6965. classes with similar methods (rdoc was created to document the
  6966. ruby source which only contains one class per c file, unlike swig)
  6967. I have patched rdoc to make it more friendly to swig. This
  6968. patch needs to be merged in the ruby std library now.
  6969. 05/03/2007: gga
  6970. [Ruby]
  6971. Changed flag -feature to be -init_name to better reflect its
  6972. purpose and avoid confusion with -features.
  6973. 05/03/2007: gga
  6974. [Ruby]
  6975. Improved autodoc generation.
  6976. Added autodoc .swg files to Ruby library for easily adding
  6977. documentation to common Ruby methods and STL methods.
  6978. Fixed autodoc documenting of getters and setters and module.
  6979. Made test suite always generate autodocs.
  6980. 05/03/2007: gga
  6981. [Ruby]
  6982. Removed some warnings from STL and test suite.
  6983. 05/02/2007: mgossage
  6984. [Lua] Fixed issues with C++ classes and hierachies across multiple
  6985. source files. Fixed imports test case & added run test.
  6986. Added Examples/imports.
  6987. Added typename for raw lua_State*
  6988. Added documentation on native functions.
  6989. 05/02/2007: gga
  6990. [Ruby]
  6991. Docstrings are now supported.
  6992. %feature("autodoc") and %feature("docstring") are now
  6993. properly supported in Ruby. These features will generate
  6994. a _wrap.cxx file with rdoc comments in them.
  6995. 05/02/2007: gga
  6996. [Ruby]
  6997. STL files have been upgraded to follow the new swig/python
  6998. Lib/std conventions.
  6999. This means std::vector, std::set, std::map, set::multimap,
  7000. std::multiset, std::deque and std::string are now properly
  7001. supported, including their iterators, support for containing
  7002. ruby objects (swig::GC_VALUE) and several other ruby
  7003. enhancements.
  7004. std::complex, std::ios, std::iostream, std::iostreambuf and
  7005. std::sstream are now also supported.
  7006. std::wstring, std::wios, std::wiostream, std::wiostreambuf
  7007. and std::wsstream are supported verbatim with no unicode
  7008. conversion.
  7009. std_vector.i now mimics the behavior of Ruby Arrays much more
  7010. closely, supporting slicing, shifting, unshifting,
  7011. multiple indexing and proper return values on assignment.
  7012. COMPATABILITY NOTE: this changes the older api a little bit in
  7013. that improper indexing would previously (incorrectly) raise
  7014. exceptions. Now, nil is returned instead, following ruby's
  7015. standard Array behavior.
  7016. 05/02/2007: gga
  7017. [Ruby]
  7018. Changed the value of SWIG_TYPECHECK_BOOL to be 10000 (ie. higher
  7019. than that of all integers).
  7020. This is because Ruby allows typecasting
  7021. integers down to booleans which can make overloaded functions on
  7022. bools and integers to fail.
  7023. (bug# 1488142)
  7024. 05/02/2007: gga
  7025. [Ruby]
  7026. Fixed a subtle bug in multiple argouts that could get triggered if
  7027. the user returned two or more arguments and the first one was an
  7028. array.
  7029. 05/01/2007: gga
  7030. [Ruby]
  7031. Improved the documentation to document the new features
  7032. added, add directorin/out/argout typemaps, etc.
  7033. 05/01/2007: gga
  7034. [Ruby]
  7035. Added %initstack and %ignorestack directives for director
  7036. functions. These allow you to control whether a director
  7037. function should re-init the Ruby stack.
  7038. This is sometimes needed for an embedded Ruby where the
  7039. director method is used as a C++ callback and not called
  7040. by the user from ruby code.
  7041. Explanation:
  7042. Ruby's GC needs to be aware of the running OS stack in order to
  7043. mark any VALUE (Ruby objects) it finds there to avoid collection
  7044. of them. This allows the ruby API to be very simple and allows
  7045. you to write code like "VALUE a = sth" anywhere without needing
  7046. to do things like refcounting like python.
  7047. By default, the start of the stack is set when ruby_init() is
  7048. called. If ruby is inited within main(), as it usually is the
  7049. case with the main ruby executable, ruby will be able to calculate
  7050. its stack properly. However, when this is not possible, as when
  7051. ruby is embedded as a plugin to an application where main is not
  7052. available, ruby_init() will be called in the wrong place, and
  7053. ruby will be incorrectly tracking the stack from the function
  7054. that called ruby_init() forwards only, which can lead to
  7055. all sorts of weird crashes or to ruby thinking it has run out of
  7056. stack space incorrectly.
  7057. To avoid this, director (callback) functions can now be tagged
  7058. to try to reset the ruby stack, which will solve the issues.
  7059. NOTE: ruby1.8.6 still contains a bug in it in that its function
  7060. to reset the stack will not always do so. This bug is triggered
  7061. very rarely, when ruby is called from two very distinct places
  7062. in memory, like a branch of main() and another dso. This bug
  7063. has now been reported to ruby-core and is pending further
  7064. investigation.
  7065. (bug #1700535 and patch #1702907)
  7066. 04/30/2007: wsfulton
  7067. Fix #1707582 - Restore building from read-only source directories.
  7068. 04/30/2007: gga
  7069. [Ruby]
  7070. Ruby will now report the parameter index properly on type
  7071. errors as well as the class and value of the incorrect
  7072. argument passed.
  7073. (feature request #1699670)
  7074. 04/30/2007: gga
  7075. [Ruby]
  7076. Ruby no longer creates the free_Class function if the class
  7077. contains its own user defined free function (%freefunc).
  7078. (bug #1702882)
  7079. 04/30/2007: gga
  7080. [Ruby]
  7081. Made directors raise a ruby exception for incorrect argout
  7082. returned values if RUBY_EMBEDDED is set, instead of throwing
  7083. an actual SwigDirector exception.
  7084. This will prevent crashes when ruby is embedded and unaware
  7085. of the SwigDirector exception.
  7086. 04/30/2007: gga
  7087. [Ruby]
  7088. Removed the need for -DSWIGEXTERN.
  7089. Changed swig_ruby_trackings to be a static variable, but also
  7090. be kept within a hidden instance variable in the SWIG module.
  7091. This allows properly dealing with trackings across multiple
  7092. DSOs, which was previously broken.
  7093. (bug #1700535 and improvement to patch #1702907)
  7094. 04/29/2007: gga
  7095. [Ruby] Fixed GC memory issues with trackings that could lead
  7096. to segfaults when dealing, mainly, with static variables.
  7097. (bug #1700535 and patch #1702907)
  7098. 04/29/2007: gga
  7099. [Ruby]
  7100. Fixed String conversion using old ruby1.6 macros. Now
  7101. StringValuePtr() is used if available. This removes warnings
  7102. when converting strings with \0 in them.
  7103. (bug #1700535 and patch #1702907)
  7104. 04/29/2007: gga
  7105. [Ruby]
  7106. Fixed the argout count in directors for Ruby. Previously,
  7107. ignored or "numinputs=0" typemaps would incorrectly not get
  7108. counted towards the argout count.
  7109. (bug/patch #1545585)
  7110. 04/29/2007: gga
  7111. [Ruby]
  7112. Upgraded Ruby converter to recognize "numinputs=0". Previously,
  7113. only the old "ignore" flag was checked (which would currently
  7114. still work properly, but is deprecated).
  7115. 04/29/2007: gga
  7116. [Ruby - but should be made generic]
  7117. %feature("numoutputs","0") added.
  7118. This feature allows you to ignore the output of a function so
  7119. that it is not added to a list of output values
  7120. ( ie. argouts ).
  7121. This should also become a feature of %typemap(directorout)
  7122. as "numoutputs"=0, just like "numinputs"=0 exists.
  7123. %feature("directors"=1)
  7124. %include <typemaps.i>
  7125. %feature("numoutputs","0") { Class::member_function1 };
  7126. %typemap(out) MStatus { // some code, like check mstatus
  7127. // and raise exception if wrong };
  7128. %inline %{
  7129. typedef int MStatus;
  7130. class Class {
  7131. // one argument returned, but director out code added
  7132. // MStatus is discarded as a return (out) parameter.
  7133. virtual MStatus member_function1( int& OUTPUT );
  7134. // two arguments returned, director out code added
  7135. // MStatus is not discarded
  7136. virtual MStatus member_function2( int& OUTPUT );
  7137. };
  7138. %}
  7139. 04/21/2007: olly
  7140. Fix parsing of float constants with an exponent (e.g. 1e-02f)
  7141. (bug #1699646).
  7142. 04/20/2007: olly
  7143. [Python] Fix lack of generation of docstrings when -O is used.
  7144. Also, fix generation of docstrings containing a double quote
  7145. character. Patch from Richard Boulton in bug#1700146.
  7146. 04/17/2007: wsfulton
  7147. [Java, C#] Support for adding in Java/C# code before and after the intermediary call,
  7148. specifically related to the marshalling of the proxy type to the intermediary type.
  7149. The javain/csin typemap now supports the 'pre' and 'post' attributes to achieve this.
  7150. The javain typemap also supports an optional 'pgcppname' attribute for premature garbage
  7151. collection prevention parameter naming and the csin typemap supports an optional 'cshin'
  7152. attribute for the parameter type used in a constructor helper generated when the type is used
  7153. in a constructor. Details in the Java.html and CSharp.html documentation.
  7154. 04/16/2007: olly
  7155. Don't treat `restrict' as a reserved identifier in C++ mode
  7156. (bug#1685534).
  7157. 04/16/2007: olly
  7158. [PHP5] Fix how zend_throw_exception() is called (bug #1700785).
  7159. 04/10/2007: olly
  7160. Define SWIGTEMPLATEDISAMBIGUATOR to template for aCC (reported on
  7161. swig-user that this is needed).
  7162. 04/04/2007: olly
  7163. [PHP5] If ZTS is enabled, release <module>_globals_id in MSHUTDOWN
  7164. to avoid PHP interpreter crash on shutdown. This solution was
  7165. suggested here: http://bugs.php.net/bug.php?id=40985
  7166. 04/03/2007: olly
  7167. [PHP4] Add missing ZTS annotations to generated C++ wrapper code
  7168. to fix compilation failures when using ZTS enabled SWIG (Linux
  7169. distributions tend to disable ZTS, but notably the Windows build
  7170. uses it by default).
  7171. 04/01/2007: efuzzyone
  7172. [CFFI] Patch #1684261: fixes handling of unsigned int literals, thanks Leigh Smith.
  7173. Also, improved documentation.
  7174. 03/30/2007: olly
  7175. Avoid generating '<:' token when using SwigValueWrapper<> on a type
  7176. which starts with '::' (patch #1690948).
  7177. 03/25/2007: wuzzeb (John Lenz)
  7178. [perl5] Add SWIG_fail to the SWIG_exception macro. Fixes a few problems reported
  7179. on the mailing list.
  7180. 03/23/2007: wsfulton
  7181. String copying patch from Josh Cherry reducing memory consumption by about 25%.
  7182. 03/21/2007: wsfulton
  7183. [Java] Apply patch #1631987 from Ulrik Peterson - bool INOUT typemaps
  7184. fail on big endian machines.
  7185. 03/16/2007: wsfulton
  7186. Fix seg fault given dodgy C++ code: namespace abc::def { }
  7187. 03/16/2007: wsfulton
  7188. [Java] Fixes so that ARRAYSOFCLASSES and ARRAYSOFENUMS in arrays_java.i can be applied
  7189. to pointer types.
  7190. 03/03/2007: olly
  7191. [PHP5] When we know the literal numeric value for a constant, use
  7192. that to initialise the const member in the PHP wrapper class.
  7193. 03/02/2007: olly
  7194. [PHP5] Fix PHP wrapper code generated for certain cases of
  7195. overloaded forms with default arguments.
  7196. 02/26/2007: efuzzyone
  7197. [CFFI] Patch #1656395: fixed hex and octal values bug, thanks to Arthur Smyles.
  7198. 02/22/2007: mgossage
  7199. [Lua] Fixed bug in typemaps which caused derived_byvalue and rname test cases to fail.
  7200. Updated derived_byvalue.i to explain how to find and fix the problem
  7201. 01/25/2007: wsfulton
  7202. Fix #1538522 and #1338527, forward templated class declarations without a
  7203. name for the templated class parameters, such as:
  7204. template <typename, class> class X;
  7205. 01/23/2007: mgossage
  7206. [Lua] Patch #1640862: <malloc.h> replaced by <stdlib.h>
  7207. Patch #1598063 Typo in typemaps.i
  7208. 01/22/2007: mgossage
  7209. [Lua] Added a lua specific carrays.i which adds the operator[] support.
  7210. modified the main code to make it not emit all the class member functions & accessors
  7211. Note: C structs are created using new_XXX() while C++ classes use XXX() (should be standardised)
  7212. Updated test case: li_carrays
  7213. Updated the documentation.
  7214. 01/12/2007: wsfulton
  7215. [Php] Add support for newfree typemaps (sometimes used by %newobject)
  7216. 01/12/2007: beazley
  7217. New command line option -macroerrors. When supplied, this will force
  7218. the C scanner/parser to report proper location information for code contained
  7219. inside SWIG macros (defined with %define). By default, SWIG merely reports
  7220. errors on the line at which a macro is used. With this option, you
  7221. can expand the error back to its source---something which may simplify
  7222. debugging.
  7223. 01/12/2007: beazley
  7224. [Internals] Major overhaul of C/C++ scanning implementation. For quite
  7225. some time, SWIG contained two completely independent C/C++ tokenizers--
  7226. the legacy scanner in CParse/cscanner.c and a general purpose scanner
  7227. in Swig/scanner.c. SWIG still has two scanning modules, but the C parser
  7228. scanner (CParse/cscanner.c) now relies upon the general purpose
  7229. scanner found in Swig/scanner.c. As a result, it is much smaller and
  7230. less complicated. This change also makes it possible to maintain all
  7231. of the low-level C tokenizing in one central location instead of two
  7232. places as before.
  7233. ***POTENTIAL FLAKINESS***
  7234. This change may cause problems with accurate line number reporting
  7235. as well as error reporting more generally. I have tried to resolve this
  7236. as much as possible, but there might be some corner cases.
  7237. 01/12/2007: mgossage
  7238. [Lua] Added typemap throws for std::string*, typemap for SWIGTYPE DYNAMIC,
  7239. changed the existing throws typemap to throw a string instead of making a copy of
  7240. the object (updating a few test cases to deal with the change).
  7241. fixed test case: dynamic_casts, exception_partial_info, li_std_string, size_t
  7242. 01/03/2007: beazley
  7243. [Internals]. Use of swigkeys.c/.h variables is revoked. Please use
  7244. simple strings for attribute names.
  7245. 12/30/2006: beazley
  7246. Internal API functions HashGetAttr() and HashCheckAttr() have been revoked.
  7247. Please use Getattr() to retrieve attributes. The function Checkattr() can
  7248. be used to check attributes. Note: These functions have been revoked
  7249. because they only added a marginal performance improvement at the expense
  7250. code clarity.
  7251. 12/26/2006: mgossage
  7252. [Lua] Added more STL (more exceptions, map, size_t),
  7253. fixed test case: conversion_ns_template.
  7254. 12/21/2006: mgossage
  7255. [Lua] Update to throw errors when setting immutables,
  7256. and allowing user addition of module variables.
  7257. 12/20/2006: wsfulton
  7258. Fix typedef'd variable wrappers that use %naturalvar, eg, std::string.
  7259. 12/14/2006: wsfulton
  7260. [C#] Add std::wstring and wchar_t typemaps
  7261. 12/14/2006: olly
  7262. [php] Fix bug #1613673 (bad PHP5 code generated for getters and
  7263. setters).
  7264. 12/02/2006: wsfulton, John Lenz, Dave Beazley
  7265. Move from cvs to Subversion for source control
  7266. 11/30/2006: beazley
  7267. Cleaned up swigwarnings.swg file not to use nested macro
  7268. definitions.
  7269. 11/12/2006: wsfulton
  7270. [Java, C#] Fix for %extend to work for static member variables.
  7271. Version 1.3.31 (November 20, 2006)
  7272. ==================================
  7273. 11/12/2006: Luigi Ballabio
  7274. [Python] Alternate fix for Python exceptions bug #1578346 (the previous one broke Python
  7275. properties in modern classes)
  7276. 11/12/2006: wsfulton
  7277. -fakeversion commandline option now generates the fake version into the generated wrappers
  7278. as well as displaying it when the -version commandline option is used.
  7279. 14/11/2006: mgossage
  7280. [lua] update to typemap for object by value, to make it c89 compliant
  7281. Version 1.3.30 (November 13, 2006)
  7282. ==================================
  7283. 11/12/2006: wsfulton
  7284. [java] Remove DetachCurrentThread patch from 08/11/2006 - it causes segfaults
  7285. on some systems.
  7286. 11/12/2006: wsfulton
  7287. [python] Fix #1578346 - Python exceptions with -modern
  7288. 11/10/2006: wsfulton
  7289. Fix #1593291 - Smart pointers and inheriting from templates
  7290. 11/09/2006: wsfulton
  7291. Fix director operator pointer/reference casts - #1592173.
  7292. 11/07/2006: wsfulton
  7293. Add $self special variable for %extend methods. Please use this instead of just 'self'
  7294. as the C++ 'this' pointer.
  7295. 11/07/2006: mutandiz
  7296. [allegrocl]
  7297. allegrocl.swg: swig-defvar updated to allow specifying of
  7298. non-default foreign type (via :ftype keyword arg).
  7299. allegrocl.cxx: Specify proper access type for enum values.
  7300. 11/03/2006: wsfulton
  7301. [Java/C#] Fix const std::string& return types for directors as reported by
  7302. Mark Donselzmann
  7303. 10/29/2006: wsfulton
  7304. [Java] Remove DeleteLocalRef from end of director methods for now as it is causing a
  7305. seg fault when run on Solaris 8.
  7306. 10/29/2006: wuzzeb (John Lenz)
  7307. [Guile] Patch from Chris Shoemaker to clean up some warnings in the generated code.
  7308. 10/29/2006: wsfulton
  7309. [Java] Important fix to prevent early garbage collection of the Java proxy class
  7310. while it is being used in a native method. The finalizer could destroy the underlying
  7311. C++ object while it was being used. The problem occurs when the proxy class is no
  7312. longer strongly reachable after a native call. The problem seems to occur in
  7313. memory stress situations on some JVMs. It does not seem to occur on the
  7314. Sun client JVM up to jdk 1.5. However the 1.6 client jdk has a more aggressive garbage
  7315. collector and so the problem does occur. It does occur on the Sun server
  7316. JVMs (certainly 1.4 onwards). The fix entails passing the proxy class into the native
  7317. method in addition to the C++ pointer in the long parameter, as Java classes are not
  7318. collected when they are passed into JNI methods. The extra parameter can be suppressed
  7319. by setting the nopgcpp attribute in the jtype typemap to "1" or using the new -nopgcpp
  7320. commandline option.
  7321. See Java.html#java_pgcpp for further details on this topic.
  7322. 10/24/2006: wsfulton
  7323. [C#] Fix smart pointer wrappers. The virtual/override/new keyword is not generated
  7324. for each method as the smart pointer class does not mirror the underlying pointer
  7325. class inheritance hierarchy. SF #1496535
  7326. 10/24/2006: mgossage
  7327. [lua] added support for native methods & member function pointers.
  7328. fixed test cases arrays_dimensionless & cpp_basic. Added new example (functor).
  7329. tidied up a little of the code (around classHandler).
  7330. 10/17/2006: wsfulton
  7331. [C#, Java] directorout typemap changes to fall in line with the other director
  7332. languages. $result is now used where $1 used to be used. Please change your typemaps
  7333. if you have a custom directorout typemap.
  7334. 10/18/2006: wsfulton
  7335. Some fixes for applying the char array typemaps to unsigned char arrays.
  7336. 10/17/2006: wsfulton
  7337. [C#, Java] Add in const size_t& and const std::size_t& typemaps.
  7338. 10/15/2006: efuzzyone
  7339. [CFFI] Suppress generating defctype for enums, thanks to Arthur Smyles. Patch 1560983.
  7340. 10/14/2006: wuzzeb (John Lenz)
  7341. [Chicken] Minor fix to make SWIG work with the (as yet unreleased) chicken 2.5
  7342. [Guile,Chicken] Fix SF Bug 1573892. Added an ext_test to the test suite to test
  7343. this bug, but this test can not really be made generic because the external code must
  7344. plug into the target language interpreter directly.
  7345. See Examples/test-suite/chicken/ext_test.i and ext_test_external.cxx
  7346. Added a %.externaltest to common.mk, and any interested language modules can
  7347. copy and slightly modify either the chicken or the guile ext_test.i
  7348. 10/14/2006: mgossage
  7349. [Lua] added OUTPUT& for all number types, added a long long type
  7350. fixed several test cases.
  7351. update: changed typemaps to use SWIG_ConvertPtr rather than SWIG_MustGetPointer
  7352. started spliting lua.swg into smaller parts to make it neater
  7353. 10/13/2006: wsfulton
  7354. [C#, Java] Marginally better support for multiple inheritance only in that you can
  7355. control what the base class is. This is done using the new 'replace' attribute in the
  7356. javabase/csbase typemap, eg in the following, 'Me' will be the base class,
  7357. no matter what Foo is really derived from in the C++ layer.
  7358. %typemap(javabase, replace="1") Foo "Me"
  7359. %typemap(csbase, replace="1") Foo "Me"
  7360. Previously it was not possible for the javabase/csbase typemaps to override the C++ base.
  7361. 10/12/2006: wsfulton
  7362. [Java] Remove potential race condition on the proxy class' delete() method
  7363. (it is now a synchronized method, but is now customisable by changing the
  7364. methodmodifiers attribute in the javadestruct or javadestruct_derived typemap)
  7365. [C#] Remove potential race condition on the proxy class' Dispose() method,
  7366. similar to Java's delete() above.
  7367. *** POTENTIAL INCOMPATIBILITY ***
  7368. 10/12/2006: wsfulton
  7369. [Ruby, Python] Remove redundant director code in %extend methods (%extend
  7370. methods cannot be director methods)
  7371. 10/12/2006: wsfulton
  7372. [Ruby, Python] Fix #1505594 - director objects not returned as director objects
  7373. in %extend methods.
  7374. 10/11/2006: wsfulton
  7375. [Java] Fix #1238798 - Directors using unsigned long long or any other type
  7376. marshalled across the JNI boundary using a Java class (where the jni typemap
  7377. contains jobject).
  7378. 10/06/2006: wsfulton
  7379. Fix #1162194 - #include/%include within a structure
  7380. 10/06/2006: wsfulton
  7381. Fix #1450661, string truncation in String_seek truncating Java/C# enums.
  7382. 10/06/2006: mgossage
  7383. [Lua] Fix #1569587. The name is now correct.
  7384. 10/04/2006: wsfulton
  7385. Director fixes for virtual conversion operators
  7386. 10/04/2006: olly
  7387. [php] Fix #1569587 for PHP. Don't use sizeof() except with string
  7388. literals. Change some "//" comments to "/* */" for portability.
  7389. 10/04/2006: mgossage
  7390. [Lua] Partial Fix #1569587. The type is now correct, but the name is still not correct.
  7391. 10/03/2006: wsfulton
  7392. [Ruby] Fix #1527885 - Overloaded director virtual methods sometimes produced
  7393. uncompilable code when used with the director:except feature.
  7394. 10/03/2006: wsfulton
  7395. Directors: Directors are output in the order in which they are declared in
  7396. the C++ class rather than in some pseudo-random order.
  7397. 10/03/2006: mmatus
  7398. Fix #1486281 and #1471039.
  7399. 10/03/2006: olly
  7400. [Perl] Fix for handling strings with zero bytes from Stephen Hutsal.
  7401. 09/30/2006: efuzzyone
  7402. [CFFI] Bitfield support and vararg support due to Arthur Smyles.
  7403. C expression to Lisp conversion, thanks to Arthur Smyles for the initial
  7404. idea, it now supports conversion for a whole range of C expressions.
  7405. 09/28/2006: wsfulton
  7406. Fix #1508327 - Overloaded methods are hidden when using -fvirtual optimisation.
  7407. Overloaded methods are no longer candidates for elimination - this mimics
  7408. C++ behaviour where all overloaded methods must be defined and implemented
  7409. in a derived class in order for them to be available.
  7410. 09/25/2006: wsfulton
  7411. [Ruby, Python, Ocaml] Fix #1505591 Throwing exceptions in extended directors
  7412. 09/25/2006: wsfulton
  7413. Fix #1056100 - virtual operators.
  7414. 09/24/2006: olly
  7415. Don't accidentally create a "<:" token (which is the same as "[" in C++).
  7416. Fixes bug # 1521788.
  7417. 09/23/2006: olly
  7418. [Ruby] Support building with recent versions of the Ruby 1.9
  7419. development branch. Fixes bug #1560092.
  7420. 09/23/2006: olly
  7421. Templates can now be instantiated using negative numbers and
  7422. constant expressions, e.g.:
  7423. template<int q> class x {};
  7424. %template(x_minus1) x<-1>;
  7425. %template(x_1plus2) x<1+2>;
  7426. Also, constant expressions can now include comparisons (>, <, >=,
  7427. <=, !=, ==), modulus (%), and ternary conditionals (a ? b : c).
  7428. Fixes bugs #646275, #925555, #956282, #994301.
  7429. 09/22/2006: wsfulton
  7430. Fix %ignore on director methods - Bugs #1546254, #1543533
  7431. 09/20/2006: wsfulton
  7432. Fix %ignore on director constructors
  7433. 09/20/2006: wsfulton
  7434. Fix seg faults and asserts when director methods are ignored (#1543533)
  7435. 09/20/2006: wsfulton
  7436. Fix out of source builds - bug #1544718
  7437. 09/20/2006: olly
  7438. Treat a nested class definition as a forward declaration rather
  7439. than ignoring it completely, so that we generate correct code for
  7440. passing opaque pointers to the nested class (fixes SF bug #909387).
  7441. 09/20/2006: olly
  7442. *** POTENTIAL INCOMPATIBILITY ***
  7443. [php] Overload resolution now works. However to allow this, SWIG
  7444. generated wrappers no longer coerce PHP types (which reverts a change
  7445. made in 1.3.26). So for example, if a method takes a string, you
  7446. can no longer pass a number without explicitly converting it to a
  7447. string in PHP using: (string)x
  7448. 09/18/2006: mgossage
  7449. [ALL] fix on swiginit.swg, has been reported to crash on several test cases
  7450. found and fixed problem in imports under python (mingw)
  7451. 09/16/2006: wsfulton
  7452. [Python] Patch from Michal Marek for Python 2.5 to fix 64 bit array indexes on
  7453. 64 bit machines.
  7454. 09/13/2006: wsfulton
  7455. The explicitcall feature has been scrapped. This feature was introduced primarily
  7456. to solve recursive director method calls. Director upcall improvements made instead:
  7457. [Python, Ruby, Ocaml] The swig_up flag is no longer used. The required mutexes
  7458. wrapping this flag are also no longer needed. The recursive calls going from C++
  7459. to the target language and back again etc are now avoided by a subtlely different
  7460. approach. Instead of using the swig_up flag in each director method to indicate
  7461. whether the explicit C++ call to the appropriate base class method or a normal
  7462. polymorphic C++ call should be made, the new approach makes one of these calls
  7463. directly from the wrapper method.
  7464. [Java, C#] The recursive call problem when calling a C++ base class method from
  7465. Java/C# is now fixed. The implementation is slightly different to the other languages
  7466. as the detection as to whether the explicit call or a normal polymorphic call is made
  7467. in the Java/C# layer rather than in the C++ layer.
  7468. 09/11/2006: mgossage
  7469. [ALL] updated swiginit.swg to allow multiple interpreters to use multiple
  7470. swig modules at once. This has been tested in Lua (mingw & linux),
  7471. perl5 & python (linux) only.
  7472. 09/11/2006: mgossage
  7473. [lua] added support for passing function pointers as well as native lua object
  7474. into wrappered function.
  7475. Added example funcptr3 to demonstrate this feature
  7476. 09/05/2006: olly
  7477. [php] Rename ErrorCode and ErrorMsg #define-s to SWIG_ErrorCode
  7478. and SWIG_ErrorMsg to avoid clashes with code the user might be
  7479. wrapping (patch from Darren Warner in SF bug #1466086). Any
  7480. user typemaps which use ErrorCode and/or ErrorMsg directly will
  7481. need adjusting - you can easily fix them to work with both old
  7482. and new SWIG by changing to use SWIG_ErrorMsg and adding:
  7483. #ifndef SWIG_ErrorMsg
  7484. #define SWIG_ErrorMsg() ErrorMsg()
  7485. #endif
  7486. 08/29/2006: olly
  7487. [php] Move constant initialisation from RINIT to MINIT to fix a
  7488. warning when using Apache and mod_php. We only need to create
  7489. PHP constants once when we're first initialised, not for every HTTP
  7490. request.
  7491. 08/21/2006: mgossage
  7492. [Lua]
  7493. Bugfix #1542466 added code to allow mapping Lua nil's <-> C/C++ NULL's
  7494. updated various typemaps to work correctly with the changes
  7495. added voidtest_runme.lua to show the features working
  7496. 08/19/2006: wuzzeb (John Lenz)
  7497. [Guile] Add feature:constasvar to export constants as variables instead of functions
  7498. that return the constant value.
  7499. 08/11/2006: wsfulton
  7500. [Java] DetachCurrentThread calls have been added so that natively created threads
  7501. no longer prevent the JVM from exiting. Bug reported by Thomas Dudziak and
  7502. Paul Noll.
  7503. 08/10/2006: wsfulton
  7504. [C#] Fix director protected methods so they work
  7505. 07/25/2006: mutandiz
  7506. [allegrocl]
  7507. more additions to std::string, some tweaks and small bug fixes
  7508. -nocwrap mode.
  7509. 07/21/2006: mgossage
  7510. [Lua]
  7511. Bugfix #1526022 pdated std::string to support strings with '\0' inside them
  7512. updated typemaps.i to add support for pointer to pointers
  7513. 07/19/2006: mutandiz
  7514. [allegrocl]
  7515. - Add std_string.i support.
  7516. - Add newobject patch submitted by mkoeppe (thanks!)
  7517. - Fix type name mismatch issue for nested type definitions.
  7518. specifically typedefs in templated class defns.
  7519. 07/18/2006: mgossage
  7520. Bugfix #1522858
  7521. updated lua.cxx to support -external-runtime command
  7522. 07/14/2006: wuzzeb (John Lenz)
  7523. Increment the SWIG_RUNTIME_VERSION to 3, because of the
  7524. addition of the owndata member in swig_type_info.
  7525. Reported by: Prabhu Ramachandran
  7526. 07/05/2006: wsfulton
  7527. Search path fixes:
  7528. - Fix search path for library files to behave as documented in Library.html.
  7529. - Fix mingw/msys builds which did not find the SWIG library when installed.
  7530. - Windows builds also output the mingw/msys install location when running
  7531. swig -swiglib.
  7532. - The non-existent and undocumented config directory in the search path has
  7533. been removed.
  7534. 07/05/2006: wsfulton
  7535. Fix $symname special variable expansion.
  7536. 07/04/2006: wuzzeb (John Lenz)
  7537. [Chicken]
  7538. Add %feature("constasvar"), which instead of exporting a constant as a
  7539. scheme function, exports the constant as a scheme variable. Update the
  7540. documentation as well.
  7541. 07/04/2006: wsfulton
  7542. [See entry of 09/13/2006 - explicitcall feature and documentation to it removed]
  7543. New explicitcall feature which generates additional wrappers for virtual methods
  7544. that call the method explicitly, not relying on polymorphism to make the method
  7545. call. The feature is a feature flag and is enabled like any other feature flag.
  7546. It also recognises an attribute, "suffix" for mangling the feature name, see
  7547. SWIGPlus.html#SWIGPlus_explicitcall documentation for more details.
  7548. [Java, C#]
  7549. The explicitcall feature is also a workaround for solving the recursive calls
  7550. problem when a director method makes a call to a base class method. See
  7551. Java.html#java_directors_explicitcall for updated documentation.
  7552. 06/28/2006: joe (Joseph Wang)
  7553. [r] Initial support for R
  7554. 06/20/2006: wuzzeb (John Lenz)
  7555. [Chicken]
  7556. Minor fixes to get apply_strings.i testsuite to pass
  7557. Remove integers_runme.scm from the testsuite, because SWIG and Chicken does
  7558. handle overflows.
  7559. 06/19/2005: olly
  7560. [php] Add support for generating PHP5 class wrappers for C++
  7561. classes (use "swig -php5").
  7562. 06/17/2006: olly
  7563. [php] Added some missing keywords to the PHP4 keyword list, and
  7564. fixed __LINE__ and __FILE__ which were in the wrong category.
  7565. Also added all the keywords new in PHP5, and added comments
  7566. noting the PHP4 keywords which aren't keywords in PHP5.
  7567. 06/17/2006: olly
  7568. [php] Don't segfault if PHP Null is passed as this pointer (e.g.
  7569. Class_method(Null)) - give a PHP Error instead.
  7570. 06/15/2006: mutandiz
  7571. [allegrocl]
  7572. Add initial support for std::list container class.
  7573. Fix a few bugs in helper functions.
  7574. 05/13/2006: wsfulton
  7575. [Java] Replace JNIEXPORT with SWIGEXPORT, thereby enabling the possibility
  7576. of using gcc -fvisibility=hidden for potentially smaller faster loading wrappers.
  7577. 05/13/2006: wsfulton
  7578. Fix for Makefiles for autoconf-2.60 beta
  7579. 05/13/2006: wsfulton
  7580. Vladimir Menshakov patch for compiling wrappers with python-2.5 alpha.
  7581. 05/12/2006: wsfulton
  7582. Fix buffer overflow error when using large %feature(docstring) reported
  7583. by Joseph Winston.
  7584. 05/12/2006: wsfulton
  7585. [Perl] Operator overload fix from Daniel Moore.
  7586. 05/25/2006: mutandiz
  7587. [allegrocl]
  7588. Fix bug in generation of CLOS type declarations for unions
  7589. and equivalent types.
  7590. 05/24/2006: mutandiz
  7591. [allegrocl]
  7592. Don't require a full class definition to generate a CLOS wrapper.
  7593. 05/20/2006: olly
  7594. [php] GCC Visibility support now works with PHP.
  7595. 05/19/2006: olly
  7596. [php] Removed support for -dlname (use -module instead). Fixed
  7597. naming of PHP extension module to be consistent with PHP
  7598. conventions (no "php_" prefix on Unix; on PHP >= 4.3.0, handle Unix
  7599. platforms which use something other than ".so" as the extension.)
  7600. 05/13/2006: wsfulton
  7601. [C#] Director support added
  7602. 05/07/2006: olly
  7603. [php] Don't segfault if PHP Null is passed where a C++ reference
  7604. is wanted.
  7605. 05/05/2006: olly
  7606. [php] Fix wrappers generated for global 'char' variables to not
  7607. include a terminating zero byte in the PHP string.
  7608. 05/03/2006: wsfulton
  7609. Modify typemaps so that char * can be applied to unsigned char * or signed char *
  7610. types and visa versa.
  7611. 05/03/2006: efuzzyone
  7612. [cffi]Thanks to Luke J Crook for this idea.
  7613. - a struct/enum/union is replaced with :pointer only if
  7614. that slot is actually a pointer to that type. So,:
  7615. struct a_struct { int x; } and
  7616. struct b_struct { a_struct struct_1; };
  7617. will be converted as:
  7618. (cffi:defcstruct b_struct
  7619. (struct_1 a_struct))
  7620. - Other minor fixes in lispifying names.
  7621. 05/02/2006: wsfulton
  7622. Fix possible redefinition of _CRT_SECURE_NO_DEPRECATE for VC++.
  7623. 04/14/2006: efuzzyone
  7624. [cffi]
  7625. Thanks to Thomas Weidner for the patch.
  7626. - when feature export is set (export 'foo) is
  7627. generated for every symbol
  7628. - when feature inline is set (declaim (inline foo)) is
  7629. generated before every function definition
  7630. - when feature intern_function is set
  7631. #.(value-of-intern-function "name" "nodeType" package)
  7632. is emitted instead of the plain symbol. A sample swig-lispify
  7633. is provided.
  7634. - every symbol is prefixed by it's package.
  7635. 04/13/2006: efuzzyone
  7636. [cffi]
  7637. Fixed the generation of wrappers for global variables.
  7638. Added the option [no]swig-lisp which turns on/off generation
  7639. of code for swig helper lisp macro, functions, etc.
  7640. Version 1.3.29 (March 21, 2006)
  7641. ===============================
  7642. 04/05/2006: mutandiz
  7643. [allegrocl]
  7644. Fix output typemap of char so it produces a character instead
  7645. of an integer. Also adds input/output typemaps for 'char *'.
  7646. add command-line argument -isolate to generate an interface
  7647. file that won't interfere with other SWIG generated files that
  7648. may be used in the same application.
  7649. 03/20/2005: mutandiz
  7650. [allegrocl]
  7651. More tweaks to INPUT/OUTPUT typemaps for bool.
  7652. Fix constantWrapper for char and string literals.
  7653. find-definition keybindings should work in ELI/SLIME.
  7654. Output (in-package <module-name>) to lisp wrapper
  7655. instead of (in-package #.*swig-module-name*).
  7656. slight rework of multiple return values.
  7657. doc updates.
  7658. 03/17/2005: mutandiz
  7659. [allegrocl]
  7660. mangle names of constants generated via constantWrapper.
  7661. When using OUTPUT typemaps and the function has a non-void
  7662. return value, it should be first in the values-list, followed
  7663. by the OUTPUT mapped values.
  7664. Fix bug with boolean parameters, which needed to be
  7665. passed in as int values, rather than T or NIL.
  7666. 03/15/2006: mutandiz
  7667. [allegrocl]
  7668. Generate wrappers for constants when in C++ or -cwrap mode.
  7669. Make -cwrap the default, since it is most correct. Users
  7670. can use the -nocwrap option to avoid the creation of a .cxx
  7671. file when interfacing to C code.
  7672. When in -nocwrap mode, improve the handling of converting
  7673. infix literals to prefix notation for lisp. This is very
  7674. basic and not likely to be improved upon since this only
  7675. applies to the -nocwrap case. Literals we can't figure out
  7676. will result in a warning and be included in the generated
  7677. code.
  7678. validIdentifier now more closely approximates what may be
  7679. a legal common lisp symbol.
  7680. Fix typemap error in allegrocl.swg
  7681. 03/12/2006: mutandiz
  7682. [allegrocl]
  7683. fix up INPUT/OUTPUT typemaps for bool.
  7684. Generate c++ style wrapper functions for struct/union members
  7685. when -cwrap option specified.
  7686. 03/10/2006: mutandiz
  7687. [allegrocl]
  7688. Fix bug in C wrapper generation introduced by last allegrocl
  7689. commit.
  7690. 03/10/2006: wsfulton
  7691. [Java]
  7692. Commit #1447337 - Delete LocalRefs at the end of director methods to fix potential leak
  7693. 03/10/2006: wsfulton
  7694. Fix #1444949 - configure does not honor --program-prefix.
  7695. Removed non-standard configure option --with-release-suffix. Fix the autoconf standard
  7696. options --program-prefix and --program-suffix which were being shown in the help,
  7697. but were being ignored. Use --program-suffix instead of --with-release-suffix now.
  7698. 03/10/2006: wsfulton
  7699. [Java]
  7700. Fix #1446319 with patch from andreasth - more than one wstring parameter in director methods
  7701. 03/07/2006: mkoeppe
  7702. [Guile]
  7703. Fix for module names containing a "-" in non-"shadow" mode.
  7704. Patch from Aaron VanDevender (#1441474).
  7705. 03/04/2006: mmatus
  7706. - Add -O to the main program, which now enables -fastdispatch
  7707. [Python]
  7708. - Add the -fastinit option to enable faster __init__
  7709. methods. Setting 'this' as 'self.this.append(this)' in the python
  7710. code confuses PyLucene. Now the initialization is done in the
  7711. the C++ side, as reported by Andi and Robin.
  7712. - Add the -fastquery option to enable faster SWIG_TypeQuery via a
  7713. python dict cache, as proposed by Andi Vajda
  7714. - Avoid to call PyObject_GetAttr inside SWIG_Python_GetSwigThis,
  7715. since this confuses PyLucene, as reported by Andi Vajda.
  7716. 03/02/2006: wsfulton
  7717. [Java]
  7718. Removed extra (void *) cast when casting pointers to and from jlong as this
  7719. was suppressing gcc's "dereferencing type-punned pointer will break strict-aliasing rules"
  7720. warning. This warning could be ignored in versions of gcc prior to 4.0, but now the
  7721. warning is useful as gcc -O2 and higher optimisation levels includes -fstrict-aliasing which
  7722. generates code that doesn't work with these casts. The assignment is simply never made.
  7723. Please use -fno-strict-aliasing to both suppress the warning and fix the bad assembly
  7724. code generated. Note that the warning is only generated by the C compiler, but not
  7725. the C++ compiler, yet the C++ compiler will also generate broken code. Alternatively use
  7726. -Wno-strict-aliasing to suppress the warning for gcc-3.x. The typemaps affected
  7727. are the "in" and "out" typemaps in java.swg and arrays_java.swg. Users ought to fix
  7728. their own typemaps to do the same. Note that removal of the void * cast simply prevents
  7729. suppression of the warning for the C compiler and nothing else. Typical change:
  7730. From:
  7731. %typemap(in) SWIGTYPE * %{ $1 = *($&1_ltype)(void *)&$input; %}
  7732. To:
  7733. %typemap(in) SWIGTYPE * %{ $1 = *($&1_ltype)&$input; %}
  7734. From:
  7735. %typemap(out) SWIGTYPE * %{ *($&1_ltype)(void *)&$result = $1; %}
  7736. To:
  7737. %typemap(out) SWIGTYPE * %{ *($&1_ltype)&$result = $1; %}
  7738. 03/02/2006: mkoeppe
  7739. [Guile -scm]
  7740. Add typemaps for "long long"; whether the generated code compiles, however, depends
  7741. on the version and configuration of Guile.
  7742. 03/02/2006: wsfulton
  7743. [C#]
  7744. Add support for inner exceptions. If any of the delegates are called which construct
  7745. a pending exception and there is already a pending exception, it will create the new
  7746. exception with the pending exception as an inner exception.
  7747. 03/02/2006: wsfulton
  7748. [Php]
  7749. Added support for Php5 exceptions if compiling against Php5 (patch from Olly Betts).
  7750. 03/01/2006: mmatus
  7751. Use the GCC visibility attribute in SWIGEXPORT.
  7752. Now you can compile (with gcc 3.4 or later) using
  7753. CFLAGS="-fvisibility=hidden".
  7754. Check the difference for the 'std_containers.i' python
  7755. test case:
  7756. Sizes:
  7757. 3305432 _std_containers.so
  7758. 2383992 _std_containers.so.hidden
  7759. Exported symbols (nm -D <file>.so | wc -l):
  7760. 6146 _std_containers.so
  7761. 174 _std_containers.so.hidden
  7762. Execution times:
  7763. real 0m0.050s user 0m0.039s sys 0m0.005s _std_containers.so
  7764. real 0m0.039s user 0m0.026s sys 0m0.007s _std_containers.so.hidden
  7765. Read http://gcc.gnu.org/wiki/Visibility for more details.
  7766. 02/27/2006: mutandiz
  7767. [allegrocl]
  7768. Add support for INPUT, OUTPUT, and INOUT typemaps.
  7769. For OUTPUT variables, the lisp wrapper returns multiple
  7770. values.
  7771. 02/26/2006: mmatus
  7772. [Ruby] add argcargv.i library file.
  7773. Use it as follow:
  7774. %include argcargv.i
  7775. %apply (int ARGC, char **ARGV) { (size_t argc, const char **argv) }
  7776. %inline {
  7777. int mainApp(size_t argc, const char **argv)
  7778. {
  7779. return argc;
  7780. }
  7781. }
  7782. then in the ruby side:
  7783. args = ["asdf", "asdf2"]
  7784. n = mainApp(args);
  7785. This is the similar to the python version Lib/python/argcargv.i
  7786. 02/24/2006: mgossage
  7787. Small update Lua documents on troubleshooting problems
  7788. 02/22/2006: mmatus
  7789. Fix all the errors reported for 1.3.28.
  7790. - fix bug #1158178
  7791. - fix bug #1060789
  7792. - fix bug #1263457
  7793. - fix 'const char*&' typemap in the UTL, reported by Geoff Hutchison
  7794. - fixes for python 2.1 and the runtime library
  7795. - fix copyctor + template bug #1432125
  7796. - fix [ 1432152 ] %rename friend operators in namespace
  7797. - fix gcc warning reported by R. Bernstein
  7798. - avoid assert when finding a recursive scope inheritance,
  7799. emit a warning in the worst case, reported by Nitro
  7800. - fix premature object deletion reported by Paul in tcl3d
  7801. - fix warning reported by Nitro in VC7
  7802. - more fixes for old Solaris compiler
  7803. - fix for python 2.3 and gc_refs issue reported by Luigi
  7804. - fix fastproxy for methods using kwargs
  7805. - fix overload + protected member issue reported by Colin McDonald
  7806. - fix seterrormsg as reported by Colin McDonald
  7807. - fix directors, now the test-suite runs again using -directors
  7808. - fix for friend operator and Visual studio and bug 1432152
  7809. - fix bug #1435090
  7810. - fix using + %extend as reported by William
  7811. - fix bug #1094964
  7812. - fix for Py_NotImplemented as reported by Olly and Amaury
  7813. - fix nested namespace issue reported by Charlie
  7814. and also:
  7815. - allow director protected members by default
  7816. - delete extra new lines in swigmacros[UTL]
  7817. - cosmetic for generated python code
  7818. - add the factory.i library for UTL
  7819. - add swigregister proxy method and move __repr__ to a
  7820. single global module [python]
  7821. 02/22/2006: mmatus
  7822. When using directors, now swig will emit all the virtual
  7823. protected methods by default.
  7824. In previous releases, you needed to use the 'dirprot'
  7825. option to achieve the same.
  7826. If you want, you can disable the new default behaviour,
  7827. use the 'nodirprot' option:
  7828. swig -nodirprot ...
  7829. and/or the %nodirector feature for specific methods, i.e.:
  7830. %nodirector Foo::bar;
  7831. struct Foo {
  7832. virtual ~Foo();
  7833. protected:
  7834. virtual void bar();
  7835. };
  7836. As before, pure abstract protected members are allways
  7837. emitted, independent of the 'dirprot/nodirprot' options.
  7838. 02/22/2006: mmatus
  7839. Add the factory.i library for languages using the UTL (python,tcl,ruby,perl).
  7840. factory.i implements a more natural wrap for factory methods.
  7841. For example, if you have:
  7842. ---- geometry.h --------
  7843. struct Geometry {
  7844. enum GeomType{
  7845. POINT,
  7846. CIRCLE
  7847. };
  7848. virtual ~Geometry() {}
  7849. virtual int draw() = 0;
  7850. //
  7851. // Factory method for all the Geometry objects
  7852. //
  7853. static Geometry *create(GeomType i);
  7854. };
  7855. struct Point : Geometry {
  7856. int draw() { return 1; }
  7857. double width() { return 1.0; }
  7858. };
  7859. struct Circle : Geometry {
  7860. int draw() { return 2; }
  7861. double radius() { return 1.5; }
  7862. };
  7863. //
  7864. // Factory method for all the Geometry objects
  7865. //
  7866. Geometry *Geometry::create(GeomType type) {
  7867. switch (type) {
  7868. case POINT: return new Point();
  7869. case CIRCLE: return new Circle();
  7870. default: return 0;
  7871. }
  7872. }
  7873. ---- geometry.h --------
  7874. You can use the %factory with the Geometry::create method as follows:
  7875. %newobject Geometry::create;
  7876. %factory(Geometry *Geometry::create, Point, Circle);
  7877. %include "geometry.h"
  7878. and Geometry::create will return a 'Point' or 'Circle' instance
  7879. instead of the plain 'Geometry' type. For example, in python:
  7880. circle = Geometry.create(Geometry.CIRCLE)
  7881. r = circle.radius()
  7882. where 'circle' now is a Circle proxy instance.
  7883. 02/17/2006: mkoeppe
  7884. [MzScheme] Typemaps for all integral types now accept the full range of integral
  7885. values, and they signal an error when a value outside the valid range is passed.
  7886. [Guile] Typemaps for all integral types now signal an error when a value outside
  7887. the valid range is passed.
  7888. 02/13/2006: mgossage
  7889. [Documents] updated the extending documents to give a skeleton swigging code
  7890. with a few typemaps.
  7891. [Lua] added an extra typemap for void* [in], so a function which requires a void*
  7892. can take any kind of pointer
  7893. Version 1.3.28 (February 12, 2006)
  7894. ==================================
  7895. 02/11/2006: mmatus
  7896. Fix many issues with line counting and error reports.
  7897. 02/11/2006: mmatus
  7898. [Python] Better static data member support, if you have
  7899. struct Foo {
  7900. static int bar;
  7901. };
  7902. then now is valid to access the static data member, ie:
  7903. f = Foo()
  7904. f.bar = 3
  7905. just as in C++.
  7906. 02/11/2006: wsfulton
  7907. [Perl]
  7908. Fixed code generation to work again with old versions of Perl
  7909. (5.004 and later tested)
  7910. 02/04/2006: mmatus
  7911. [Python] Add the %extend_smart_pointer() directive to extend
  7912. SWIG smart pointer support in python.
  7913. For example, if you have a smart pointer as:
  7914. template <class Type> class RCPtr {
  7915. public:
  7916. ...
  7917. RCPtr(Type *p);
  7918. Type * operator->() const;
  7919. ...
  7920. };
  7921. you use the %extend_smart_pointer directive as:
  7922. %extend_smart_pointer(RCPtr<A>);
  7923. %template(RCPtr_A) RCPtr<A>;
  7924. then, if you have something like:
  7925. RCPtr<A> make_ptr();
  7926. int foo(A *);
  7927. you can do the following:
  7928. a = make_ptr();
  7929. b = foo(a);
  7930. ie, swig will accept a RCPtr<A> object where a 'A *' is
  7931. expected.
  7932. Also, when using vectors
  7933. %extend_smart_pointer(RCPtr<A>);
  7934. %template(RCPtr_A) RCPtr<A>;
  7935. %template(vector_A) std::vector<RCPtr<A> >;
  7936. you can type
  7937. a = A();
  7938. v = vector_A(2)
  7939. v[0] = a
  7940. ie, an 'A *' object is accepted, via implicit conversion,
  7941. where a RCPtr<A> object is expected. Additionally
  7942. x = v[0]
  7943. returns (and sets 'x' as) a copy of v[0], making reference
  7944. counting possible and consistent.
  7945. %extend_smart_pointer is just a collections of new/old
  7946. tricks, including %typemaps and the new %implicitconv
  7947. directive.
  7948. 02/02/2006: mgossage
  7949. bugfix #1356577, changed double=>lua_number in a few places.
  7950. added the std::pair wrapping
  7951. 01/30/2006: wsfulton
  7952. std::string and std::wstring member variables and global variables now use
  7953. %naturalvar by default, meaning they will now be wrapped as expected in all languages.
  7954. Previously these were wrapped as a pointer rather than a target language string.
  7955. It is no longer necessary to add the following workaround to wrap these as strings:
  7956. %apply const std::string & { std::string *}
  7957. *** POTENTIAL INCOMPATIBILITY ***
  7958. 01/28/2006: mkoeppe
  7959. [Guile -scm]
  7960. Add typemaps for handling of member function pointers.
  7961. 01/24/2006: mmatus
  7962. - Better support for the %naturalvar directive, now it
  7963. works with the scripting languages as well as
  7964. Java/C#.
  7965. Now, it can also be applied to class types:
  7966. %naturalvar std::string;
  7967. %include <std_string.i>
  7968. that will tell swig to use the 'natural' wrapping
  7969. mechanism to all std::string global and member
  7970. variables.
  7971. - Add support for the %allowexcept feature along the
  7972. scripting languages, which allows the %exception feature
  7973. to be applied to the variable access methods. Also, add
  7974. the %exceptionvar directive to specify a distintic
  7975. exception mechanism only for variables.
  7976. - Add more docs for the %delobject directive to mark a method as a
  7977. destructor, 'disowning' the first argument. For example:
  7978. %newobject create_foo;
  7979. %delobject destroy_foo;
  7980. Foo *create_foo() { return new Foo(); }
  7981. void destroy_foo(Foo *foo) { delete foo; }
  7982. or in a member method as:
  7983. %delobject Foo::destroy;
  7984. class Foo {
  7985. public:
  7986. void destroy() { delete this;}
  7987. private:
  7988. ~Foo();
  7989. };
  7990. 01/24/2006: mgossage
  7991. [Lua]
  7992. - Removed the type swig_lua_command_info & replace with luaL_reg
  7993. (which then broke the code), fixed this
  7994. - added an additional cast in the typemaps for enum's
  7995. due to the issue that VC.Net will not allow casting of
  7996. a double to an enum directly. Therefore cast to int then to enum
  7997. (thanks to Jason Rego for this observation)
  7998. 01/16/2006: mmatus (Change disabled... will be back in CVS soon)
  7999. Add initial support for regexp via the external library
  8000. RxSpencer. SWIG doesn't require this library to compile
  8001. and/or run. But if you specify --with-rxspencer, and the
  8002. library is found during installation, then swig will use
  8003. it in three places:
  8004. - In %renames rules, via the new rxsmatch rules, for example:
  8005. %rename("%(lowercase)",rxsmatch$name="GSL_.*") "";
  8006. %rename("%(lowercase)",rxsmatch$nodeType="enum GSL_.*") "";
  8007. rxsmatch is similar to the match rule, it just uses
  8008. the RxSpencer regexp library to decide if there is a
  8009. match with the provided regexp. As with the match
  8010. rule, you can also use the negate rule notrxsmatch.
  8011. - In the %rename target name via the rxstarget option, for example:
  8012. %rename("%(lowercase)",rxstarget=1) "GSL_.*";
  8013. where the target name "GSL.*" is now understood as a
  8014. regexp to be matched.
  8015. - In the new encoder "rxspencer", which looks like:
  8016. %(rxspencer:[regexp][replace])s
  8017. where "regexp" is the regular expression and "replace"
  8018. is a string used as a replacement, where the @0,@1,...,@9
  8019. pseudo arguments are used to represent the
  8020. corresponding matching items in the reg expression.
  8021. For example:
  8022. %(rxspencer:[GSL.*][@0])s <- Hello ->
  8023. %(rxspencer:[GSL.*][@0])s <- GSLHello -> GSLHello
  8024. %(rxspencer:[GSL(.*)][@1])s <- GSLHello -> Hello
  8025. %(rxspencer:[GSL(.*)][gsl@1])s <- GSLHello -> gslHello
  8026. Another example could be:
  8027. %rename("%(lowercase)s",sourcefmt="%(rxspencer:[GSL_(.*)][@1])s",%$isfunction) "";
  8028. which take out the prefix "GSL_" and returns all the
  8029. function names in lower cases, as following:
  8030. void GSL_Hello(); -> hello();
  8031. void GSL_Hi(); -> hi();
  8032. const int GSL_MAX; -> GSL_MAX; // no change, is not a function
  8033. We use the RxSpencer as an initial test bed to
  8034. implemention while we decide which library will be
  8035. finally added to swig.
  8036. You can obtain the RxSpencer library from
  8037. http://arglist.com/regex (Unix)
  8038. or
  8039. http://gnuwin32.sourceforge.net/packages.html (Windows)
  8040. Once installed, use "man rxspencer" to get more info
  8041. about the regexp format, or just google rxspencer.
  8042. Since now you can enable the rxsmatch rules (see above),
  8043. the simple or '|' support for the match rules
  8044. (01/12/2006: mmatus) is disabled. Still, if you have
  8045. problems with the rxspencer library, you can re-enable
  8046. the simple 'match or' support using
  8047. -DSWIG_USE_SIMPLE_MATCHOR.
  8048. 01/16/2006: mmatus
  8049. Change the %rename predicates to use the prefix '%$', as in:
  8050. %rename("%(utitle)s",%$isfunction,%$ismember) "";
  8051. to avoid clashes with other swig macros/directives.
  8052. 01/14/2006: cfisavage
  8053. [Ruby]
  8054. Added support for Ruby bang! methods via a new %bang feature.
  8055. Bang methods end in exclamation points and indicate that the
  8056. object being processed will be modified in-place as
  8057. opposed to being copied.
  8058. 01/12/2006: cfisavage
  8059. [Ruby]
  8060. Updated the Ruby module to automatically convert
  8061. method names to lower_case_with_underscores using the
  8062. new %rename functionality.
  8063. 01/12/2006: mmatus
  8064. - Add aliases for 'case' encoders used with %rename/%namewarn
  8065. %(uppercase)s hello_world -> HELLO_WORLD
  8066. %(lowercase)s HelloWorld -> helloworld
  8067. %(camelcase)s hello_world -> HelloWorld
  8068. %(undercase)s HelloWorld -> hello_world
  8069. 01/12/2006: mmatus
  8070. - Add the -dump_parse_module and -dump_parse_top options,
  8071. which are similar to -dump_module and -dump_top, but they
  8072. dump the node trees just after parsing, showing only the
  8073. attributes visible at the parsing stage, and not the added
  8074. later in typemap.cxx, allocate.cxx, lang.cxx or elsewhere.
  8075. Besides debugging porpuses, these options are very useful
  8076. if you plan to use %rename in an "advance way", since it
  8077. shows only and all the node's attributes you can use
  8078. inside the match rules.
  8079. 01/12/2006: mmatus
  8080. - Add predicates to %rename, so, you don't need to
  8081. remember, for example, how to match a member function.
  8082. Now it is easy, for example to use the 'utitle' encoder
  8083. in all the member methods, you type:
  8084. %rename("%(utitle)s",%isfunction,%ismember) "";
  8085. or to ignore all the enumitems in a given class:
  8086. %rename("$ignore", %isenumitem, %classname="MyClass") "";
  8087. Available predicates are (see swig.swg):
  8088. %isenum
  8089. %isenumitem
  8090. %isaccess
  8091. %isclass
  8092. %isextend
  8093. %isextend
  8094. %isconstructor
  8095. %isdestructor
  8096. %isnamespace
  8097. %istemplate
  8098. %isconstant
  8099. %isunion
  8100. %isfunction
  8101. %isvariable
  8102. %isimmutable
  8103. %isstatic
  8104. %isfriend
  8105. %istypedef
  8106. %isvirtual
  8107. %isexplicit
  8108. %isextern
  8109. %ismember
  8110. %isglobal
  8111. %innamespace
  8112. %ispublic
  8113. %isprotected
  8114. %isprivate
  8115. %classname
  8116. These predicates correspond to specific 'match'
  8117. declarations, which sometimes are not as evident as the
  8118. predicates names.
  8119. - Add the or '|' operation in %rename match, for
  8120. example to capitalize all the constants (%constant or
  8121. const cdecl):
  8122. %rename("%(upper)s",match="cdecl|constant",%isimmutable) "";
  8123. 01/12/2006: mgossage
  8124. - Partial fixed of errors under C89, bug #1356574
  8125. (converted C++ style comments to C style)
  8126. - Added patches from neomantra@users.sf.net #1379988 and #1388343
  8127. missing a 'return' statement for error conditions
  8128. also updated the %init block bug #1356586
  8129. 01/10/2006: mmatus
  8130. - Add the 'utitle' encoder, as an example of how to add
  8131. your own encoder. I added the encoder method in misc.c
  8132. but developers can add others, the same way, inside any
  8133. target language.
  8134. Well, 'utitle' is the reverse of 'ctitle', ie:
  8135. %rename("%(ctitle)s") camel_case; -> CamelCase;
  8136. %rename("%(utitle)s") CamelCase; -> camel_case;
  8137. 01/10/2006: cfisavage
  8138. [Ruby]
  8139. Updated Ruby Exception handling. Classes that are specified in throws clauses,
  8140. or are marked as %exceptionclass, are now inherited from rb_eRuntimeError.
  8141. This allows instances of these classes to be returned to Ruby as exceptions.
  8142. Thus if a C++ method throws an instance of MyException, the calling Ruby
  8143. method will get back a MyException object. To see an example,
  8144. look at ruby/examples/exception_class.
  8145. 01/10/2006: mmatus
  8146. - Add the %catches directive, which complements the %exception
  8147. directive in a more automatic way. For example, if you have
  8148. int foo() throw(E1);
  8149. swig generates the proper try/catch code to dispatch E1.
  8150. But if you have:
  8151. int barfoo(int i) {
  8152. if (i == 1) {
  8153. throw E1();
  8154. } else {
  8155. throw E2();
  8156. }
  8157. return 0;
  8158. }
  8159. ie, where there is no explicit exception specification in the decl, you
  8160. end up doing:
  8161. %exception barfoo {
  8162. try {
  8163. $action
  8164. } catch(E1) { ... }
  8165. } catch(E2) { ... }
  8166. }
  8167. which is very tedious. Well, the %catches directive defines
  8168. the list of exceptions to catch, and from swig:
  8169. %catches(E1,E2) barfoo(int i);
  8170. int barfoo(int i);
  8171. is equivalent to
  8172. int barfoo(int i) throw(E1,E2);
  8173. Note, however, that the %catches list doesn't have to
  8174. correspond to the C++ exception specification. For example, if you
  8175. have:
  8176. struct E {};
  8177. struct E1 : E {};
  8178. struct E2 : E {};
  8179. int barfoo(int i) throw(E1,E2);
  8180. you can define
  8181. %catches(E) barfoo(int i);
  8182. and swig will generate an action code equivalent to
  8183. try {
  8184. $action
  8185. } catch(E &_e) {
  8186. <raise _e>;
  8187. }
  8188. Of course, you still have to satisfy the C++ restrictions,
  8189. and the catches list must be compatible (not the same)
  8190. as the original list of types in the exception specification.
  8191. Also, you can now specify that you want to catch the
  8192. unknown exception '...', for example:
  8193. %catches(E1,E2,...) barfoo(int);
  8194. In any case, the %catches directive will emit the
  8195. code to convert into the target language error/exception
  8196. using the 'throws' typemap.
  8197. For the '...' case to work, you need to
  8198. write the proper typemap in your target language. In the
  8199. UTL, this looks like:
  8200. %typemap(throws) (...) {
  8201. SWIG_exception(SWIG_RuntimeError,"unknown exception");
  8202. }
  8203. 01/09/2006: mutandiz
  8204. [Allegrocl]
  8205. Fixes a number of SEGVs primarily in the handling of
  8206. various anonymous types. Found in a pass through the
  8207. swig test-suite. Still more to do here, but this is a
  8208. good checkpoint.
  8209. Adds -cwrap and -nocwrap as an allegrocl specific
  8210. command-line argument. Controls generating of a C
  8211. wrapper file when wrapping C code. By default only a
  8212. lisp file is created for C code wrapping.
  8213. Doc updates for the command-line arguments and fixes as
  8214. pointed out on swig-devel
  8215. 01/05/2006: wsfulton
  8216. [Java] Fix unsigned long long and const unsigned long long & typemaps
  8217. - Bug #1398394 with patch from Dries Decock
  8218. 01/06/2006: mmatus
  8219. Add 'named' warning codes, now in addition to:
  8220. %warnfilter(813);
  8221. you can use
  8222. %warnfilter(SWIGWARN_JAVA_MULTIPLE_INHERITANCE);
  8223. just use the same code name found in Source/Include/swigwarn.h
  8224. plus the 'SWIG' prefix.
  8225. If a developer adds a new warning code, the Lib/swigwarn.swg file
  8226. will be generated when running the top level make.
  8227. 01/05/2006: cfisavage
  8228. [Ruby]
  8229. Reimplemented object tracking for Ruby. The new implementation works
  8230. by expanding the swig_class structure for Ruby by adding a trackObjects
  8231. field. This field can be set/unset via %trackobjects as explained
  8232. in the Ruby documentation. The new implementation is more robust
  8233. and takes less code to implement.
  8234. 01/05/2006: wsfulton
  8235. Fix for %extend and static const integral types, eg:
  8236. class Foo {
  8237. public:
  8238. %extend {
  8239. static const int bar = 42;
  8240. }
  8241. };
  8242. 12/30/2005: mmatus
  8243. - Add info for old and new debug options:
  8244. -dump_top - Print information of the entire node tree, including system nodes
  8245. -dump_module - Print information of the module node tree, avoiding system nodes
  8246. -dump_classes - Print information about the classes found in the interface
  8247. -dump_typedef - Print information about the types and typedefs found in the interface
  8248. -dump_tags - Print information about the tags found in the interface
  8249. -debug_typemap - Print information for debugging typemaps
  8250. -debug_template - Print information for debugging templates
  8251. - Add the fakeversion. If you have a project that uses
  8252. configure/setup.py, or another automatic building system
  8253. and requires a specific swig version, let say 1.3.22
  8254. you can use:
  8255. SWIG_FEATURES="-fakeversion 1.3.22"
  8256. or
  8257. swig -fakeversion 1.3.22
  8258. and then swig -version will report 1.3.22 instead of the
  8259. current version.
  8260. Typical use would be
  8261. SWIG_FEATURES="-fakeversion 1.3.22" ./configure
  8262. 12/30/2005: mmatus
  8263. - Add option/format support to %rename and %namewarn.
  8264. Now %namewarn can force renaming, for example:
  8265. %namewarn("314: import is a keyword",rename="_%s") "import";
  8266. and rename can also support format forms:
  8267. %rename("swig_%s") import;
  8268. Now, since the format is processed via swig Printf, you
  8269. can use encoders as follows:
  8270. %rename("%(title)s") import; -> Import
  8271. %rename("%(upper)s") import; -> IMPORT
  8272. %rename("%(lower)s") Import; -> import
  8273. %rename("%(ctitle)s") camel_case; -> CamelCase
  8274. This will allow us to add more encoders, as the
  8275. expected one for regular expressions.
  8276. - Add the above 'ctitle' encoder, which does the camel case:
  8277. camel_case -> CamelCase
  8278. - Also, while we get the regexp support, add the 'command' encoder,
  8279. you can use it as follows
  8280. %rename("%(command:sed -e 's/\([a-z]\)/\U\\1/' <<< )s") import;
  8281. then swig will popen the command
  8282. "sed -e 's/\([a-z]\)/\U\\1/' <<< import"
  8283. see below for anonymous renames for better examples.
  8284. - The rename directive now also allows:
  8285. - simple match: only apply the rename if a type match
  8286. happen, for example
  8287. %rename(%(title)s,match="enumitem") hello;
  8288. enum Hello {
  8289. hi, hello -> hi, Hello
  8290. };
  8291. int hello() -> hello;
  8292. - extended match: only apply the rename if the 'extended attribute' match
  8293. occurred, for example:
  8294. // same as simple match
  8295. %rename(%(title)s,match$nodeType="enumitem") hello;
  8296. enum Hello {
  8297. hi, hello -> hi, Hello
  8298. };
  8299. Note that the symbol '$' is used to define the attribute name in
  8300. a 'recursive' way, for example:
  8301. // match only hello in 'enum Hello'
  8302. %rename(%(title)s,match$parentNode$type="enum Hello") hello;
  8303. enum Hello {
  8304. hi, hello -> hi, Hello // match
  8305. };
  8306. enum Hi {
  8307. hi, hello -> hi, hello // no match
  8308. };
  8309. here, for Hello::hi, the "parentNode" is "Hello", and its "type"
  8310. is "enum Hello".
  8311. - Anonymous renames: you can use 'anonymous' rename directives, for example:
  8312. // rename all the enum items in Hello
  8313. %rename(%(title)s,match$parentNode$type="enum Hello") "";
  8314. enum Hello {
  8315. hi, hello -> Hi, Hello // match both
  8316. };
  8317. enum Hi {
  8318. hi, hello -> hi, hello // no match
  8319. };
  8320. // rename all the enum items
  8321. %rename(%(title)s,match$nodeType="enumitem") "";
  8322. // rename all the items in given command (sloooow, but...)
  8323. %rename(%(command:<my external cmd>)s) "";
  8324. Anonymous renames with commands can be very powerful, since you
  8325. can 'outsource' all the renaming mechanism (or part of it) to an
  8326. external program:
  8327. // Uppercase all (and only) the names that start with 'i'
  8328. %rename("%(command:awk '/^i/{print toupper($1)}' <<<)s") "";
  8329. int imported() -> IMPORTED;
  8330. int hello() -> hello
  8331. Note that if the 'command' encoder returns an empty string, swig
  8332. understands that no rename is necessary.
  8333. Also note that %rename 'passes' the matched name. For example, in
  8334. this case
  8335. namespace ns1 {
  8336. int foo();
  8337. }
  8338. namespace ns2 {
  8339. int bar();
  8340. }
  8341. the external program only receives "foo" and "bar". If needed,
  8342. however, you can request the 'fullname'
  8343. %rename("%(command:awk 'awk '/ns1::/{l=split($1,a,"::"); print toupper(a[l])}'' <<<)s",fullname=1) "";
  8344. ns1::foo -> FOO
  8345. ns2::bar -> bar
  8346. - Mixing encoders and matching: of course, you can do mix commands
  8347. and match fields, for example:
  8348. %rename("%(<my encoder for fncs>)",match="cdecl") "";
  8349. %rename("%(<my encoder for enums>)",match="enumitem") "";
  8350. %rename("%(<my encoder for enums inside a class>)",match="enumitem",
  8351. match$parentNode$parentNode$nodeType="class") "";
  8352. Use "swig -dump_parse_module" to see the attribute names you can use to
  8353. match a specific case.
  8354. - 'sourcefmt' and 'targetfmt': sometimes you need to
  8355. process the 'source' name before comparing, for example
  8356. %namewarn("314: empty is a keyword",sourcefmt="%(lower)s") "empty";
  8357. then if you have
  8358. int Empty(); // "Empty" is the source
  8359. you will get the keyword warning since 'Empty' will be
  8360. lower cased, via the sourcefmt="%(lower)s" option,
  8361. before been compared to the 'target' "empty".
  8362. There is an additional 'targetfmt' option to process the
  8363. 'target' before comparing.
  8364. - complementing 'match': you can use 'notmatch', for example
  8365. %namewarn("314: empty is a keyword",sourcefmt="%(lower)s",notmatch="namespace") "empty";
  8366. here, the name warning will be applied to all the symbols except namespaces.
  8367. 12/30/2005: mmatus
  8368. - Add initial support for gcj and Java -> <target language> mechanism.
  8369. See examples in:
  8370. Examples/python/java
  8371. Examples/ruby/java
  8372. Examples/tcl/java
  8373. to see how to use gcj+swig to export java classes into
  8374. python/ruby/tcl.
  8375. The idea is to put all the common code for gcj inside
  8376. Lib/gcj
  8377. and localize specific types such as jstring, as can be found
  8378. in
  8379. Lib/python/jstring.i
  8380. Lib/ruby/jstring.i
  8381. Lib/tcl/jstring.i
  8382. Using the UTL, this is very easy, and the perl version for
  8383. jstring.i will be next.
  8384. 12/29/2005: mmatus
  8385. - Add the copyctor feature/directive/option to enable the automatic
  8386. generation of copy constructors. Use as in:
  8387. %copyctor A;
  8388. struct A {
  8389. };
  8390. then this will work
  8391. a1 = A();
  8392. a2 = A(a1);
  8393. Also, since it is a feature, if you just type
  8394. %copyctor;
  8395. that will enable the automatic generation for all the
  8396. classes. It is also equivalent to
  8397. swig -copyctor -c++ ...
  8398. Notes:
  8399. 1.- The feature only works in C++ mode.
  8400. 2.- The automatic creation of the copy constructor will
  8401. usually produce overloading. Hence, if the target
  8402. language doesn't support overloading, a special name
  8403. will be used (A_copy).
  8404. 3.- For the overloading reasons above, it is probably not
  8405. a good idea to use the flag when, for example, you are
  8406. using keywords in Python.
  8407. 4.- The copyctor automatic mechanism follows more or less
  8408. the same rules as the default constructor mechanism,
  8409. i.e., a copy constructor will not be added if the
  8410. class is abstract or if there is a pertinent non-public
  8411. copy ctor in the class or its hierarchy.
  8412. Hence, it might be necessary for you to complete the
  8413. class declaration with the proper non-public copy ctor
  8414. to avoid a wrong constructor addition.
  8415. - Fix features/rename for templates ctor/dtor and other
  8416. things around while adding the copyctor mechanism.
  8417. 12/27/2005: mmatus
  8418. - Add the 'match' option to typemaps. Assume you have:
  8419. %typemap(in) SWIGTYPE * (int res) {..}
  8420. %typemap(freearg) SWIGTYPE * { if (res$argnum) ...}
  8421. then if you do
  8422. %typemap(in) A * {...}
  8423. swig will 'overload the 'in' typemap, but the 'freearg'
  8424. typemap will be also applied, even when this is wrong. The old
  8425. solutions is to write:
  8426. %typemap(in) A * {...}
  8427. %typemap(freeag) A * ""
  8428. overload 'freearg' with an empty definition.
  8429. The problem is, however, there is no way to know you need
  8430. to do that until you start getting broken C++ code, or
  8431. worse, broken runtime code.
  8432. The same applies to the infamous 'typecheck' typemap,
  8433. which always confuses people, since the first thing you do
  8434. is to just write the 'in' typemap.
  8435. The 'match' option solves the problem, and if instead you write:
  8436. %typemap(in) SWIGTYPE * (int res) {..}
  8437. %typemap(freearg,match="in") SWIGTYPE * { if (res$argnum) ...}
  8438. %typemap(typecheck,match="in",precedence...) SWIGTYPE * {...}
  8439. it will tell swig to apply the 'freearg/typecheck'
  8440. typemaps only if they 'match' the type of the 'in'
  8441. typemap. The same can be done with other typemaps as:
  8442. %typemap(directorout) SWIGTYPE * {...}
  8443. %typemap(directorfree,match="directorout") SWIGTYPE * {...}
  8444. 12/27/2005: mmatus
  8445. - Add the 'naturalvar' option/mode/feature to treat member
  8446. variables in a more natural way, ie, similar to the global
  8447. variable behavior.
  8448. You can use it in a global way via the command line
  8449. swig -naturalvar ...
  8450. or the module mode option
  8451. %module(naturalvar=1)
  8452. both forms make swig treat all the member variables in the
  8453. same way it treats global variables.
  8454. Also, you can use it in a case by case approach for
  8455. specific member variables using the directive form:
  8456. %naturalvar Bar::s;
  8457. Then, in the following case for example:
  8458. std::string s;
  8459. struct Bar {
  8460. std::string s;
  8461. };
  8462. you can do:
  8463. b = Bar()
  8464. b.s ="hello"
  8465. cvar.s = "hello"
  8466. if (b.s != cvar.s):
  8467. raise RuntimeError
  8468. This is valid for all the languages, and the
  8469. implementation is based on forcing the use of the
  8470. const SWIGTYPE& (C++)/SWIGTYPE (C) typemaps for the
  8471. get/set methods instead of the SWIGTYPE * typemaps.
  8472. Hence, for 'naturalvar' to work, each target language
  8473. must implement 'typemap(in/out) const Type&' properly.
  8474. The 'naturalvar' option replaces or makes workarounds such as:
  8475. %apply const std::string & { std::string *}
  8476. unnecessary.
  8477. Note1: If your interface has other kinds of workarounds to
  8478. deal with the old 'unnatural' way to deal with member
  8479. variables (returning/expecting pointers), the
  8480. 'naturalvar' option could break them.
  8481. Note2: the option has no effect on unnamed types, such
  8482. as unnamed nested unions.
  8483. 12/27/2005: mmatus
  8484. - Add more 'expressive' result states for the typemap
  8485. libraries.
  8486. In the past, for scripting languages, you would do checking something like:
  8487. if (ConvertPtr(obj,&vptr,ty,flags) != -1) {
  8488. // success
  8489. } else {
  8490. // error
  8491. }
  8492. Now the result state can carry more information,
  8493. including:
  8494. - Error state: like the old -1/0, but with error codes from swigerrors.swg.
  8495. int res = ConvertPtr(obj,&vptr,ty,flags);
  8496. if (SWIG_IsOK(res)) {
  8497. // success code
  8498. } else {
  8499. SWIG_Error(res); // res carries the error code
  8500. }
  8501. - Cast rank: when returning a simple successful
  8502. conversion, you just return SWIG_OK, but if you need
  8503. to do a 'cast', you can add the casting rank, ie:
  8504. if (PyFloat_Check(obj)) {
  8505. value = PyFloat_AsDouble(obj);
  8506. return SWIG_OK;
  8507. } else if (PyInt_Check(obj)) {
  8508. value = (double) PyInt_AsLong(obj);
  8509. return SWIG_AddCast(SWIG_OK);
  8510. }
  8511. later, the casting rank is used to properly dispatch
  8512. the overloaded function, for example. This of course
  8513. requires your language to support and use the new
  8514. dispatch cast/rank mechanism (Now mainly supported in
  8515. perl and python, and easily expandable to ruby and tcl).
  8516. - [UTL] Add support for the new 'expressive' result states.
  8517. 12/27/2005: mmatus
  8518. - Add support for the C++ implicit conversion mechanism, which
  8519. required some modifications in parser.y (to recognize
  8520. 'explicit') and overload.cxx (to replace $implicitconv as
  8521. needed).
  8522. Still, real support in each target language requires each
  8523. target language to be modified. Python provides an example,
  8524. see below.
  8525. - Add support for native C++ implicit conversions, ie, if you
  8526. have
  8527. %implicitconv A;
  8528. struct A {
  8529. int ii;
  8530. A() {ii = 1;}
  8531. A(int) {ii = 2;}
  8532. A(double) {ii = 3;}
  8533. explicit A(char *s) {ii = 4;}
  8534. };
  8535. int get(const A& a) {return a.ii;}
  8536. you can call:
  8537. a = A()
  8538. ai = A(1)
  8539. ad = A(1.0)
  8540. as = A("hello")
  8541. # old forms
  8542. get(a) -> 1
  8543. get(ai) -> 2
  8544. get(ad) -> 3
  8545. get(as) -> 4
  8546. #implicit conversions
  8547. get(1) -> 2
  8548. get(1.0) -> 3
  8549. get("hello") -> Error, explicit constructor
  8550. Also, as in C++, now implicit conversions are supported in
  8551. variable assigments, and if you have:
  8552. A ga;
  8553. struct Bar {
  8554. A a;
  8555. };
  8556. you can do:
  8557. cvar.ga = A(1)
  8558. cvar.ga = 1
  8559. cvar.ga = 1.0
  8560. cvar.ga = A("hello")
  8561. cvar.ga = "hello" -> error, explicit constructor
  8562. b = Bar()
  8563. b.a = A("hello")
  8564. b.a = 1
  8565. b.a = 1.0
  8566. b.a = "hello" -> error, explicit constructor
  8567. Note that the last case, assigning a member var directly,
  8568. also requires the 'naturalvar' option.
  8569. This support now makes the old '%implicit' macro, which
  8570. was found in 'implicit.i' and it was fragile in many ways,
  8571. obsolete, and you should use the new '%implicitconv'
  8572. directive instead.
  8573. Note that we follow the C++ conventions, ie, in the
  8574. following the implicit conversion is allowed:
  8575. int get(A a) {return a.ii;}
  8576. int get(const A& a) {return a.ii;}
  8577. but not in these cases:
  8578. int get(A *a) {return a->ii;}
  8579. int get(A& a) {return a.ii;}
  8580. Also, it works for director methods that return a by value
  8581. result, ie, the following will work:
  8582. virtual A get_a() = 0;
  8583. def get_a(self):
  8584. return 1
  8585. but not in this case:
  8586. virtual const A& get_a() = 0;
  8587. virtual A& get_a() = 0;
  8588. virtual A* get_a() = 0;
  8589. Notes:
  8590. - the implicitconv mechanism is implemented by directly
  8591. calling/dispatching the python constructor, triggering a
  8592. call to the __init__method. Hence, if you expanded the
  8593. __init__ method, like in:
  8594. class A:
  8595. def __init__(self,args):
  8596. <swig code>
  8597. <my code here>
  8598. then 'my code' will also be executed.
  8599. - Since the %implicitconv directive is a SWIG feature, if you type:
  8600. %implicitconv;
  8601. that will enable implicit conversion for all the classes in
  8602. your module.
  8603. But if you are worried about performance, maybe that will be
  8604. too much, especially if you have overloaded methods, since
  8605. to resolve the dispatching problem, python will efectively
  8606. try to call all the implicit constructors as needed.
  8607. - For the same reason, it is highly recommended that you use
  8608. the new 'castmode' when mixing implicit conversion and
  8609. overloading.
  8610. - [python] The %implicit directive is declared obsolete, and
  8611. you should use %implicitconv instead. If you include
  8612. the implicit.i file, a warning will remind you of this.
  8613. Note: Since %implicit is fragile, just replacing it by
  8614. %implicitconv could lead to different behavior. Hence, we
  8615. don't automatically switch from to the other, and the user
  8616. must migrate to the new %implicitconv directive manually.
  8617. 12/26/2005: wsfulton
  8618. [C#]
  8619. Modify std::vector wrappers to use std::vector::value_type as this is
  8620. closer to the real STL declarations for some methods, eg for push_back().
  8621. Fixes some compilation errors for some compilers eg when the templated
  8622. type is a pointer.
  8623. [Java]
  8624. std::vector improvements - a few more methods are wrapped and specializations are
  8625. no longer required. The specialize_std_vector macro is no longer needed (a
  8626. warning is issued if an attempt is made to use it).
  8627. 12/26/2005: wsfulton
  8628. [Java, C#]
  8629. Add in pointer reference typemaps. This also enables one to easily wrap
  8630. std::vector<T> where T is a pointer.
  8631. 12/24/2005: efuzzyone
  8632. [CFFI] The cffi module for SWIG:
  8633. - Fully supports C, but provides limited supports for C++, in
  8634. particular C++ support for templates and overloading needs to
  8635. be worked upon.
  8636. 12/23/2005: mmatus
  8637. [python] Add the castmode that allows the python
  8638. type casting to occur.
  8639. For example, if you have 'int foo(int)', now
  8640. class Ai():
  8641. def __init__(self,x):
  8642. self.x = x
  8643. def __int__(self):
  8644. return self.x
  8645. foo(1) // Ok
  8646. foo(1.0) // Ok
  8647. foo(1.3) // Error
  8648. a = Ai(4)
  8649. foo(ai) // Ok
  8650. The castmode, which can be enabled either with the
  8651. '-castmode' option or the %module("castmode") option, uses
  8652. the new cast/rank dispatch mechanism. Hence, now if you
  8653. have 'int foo(int); int foo(double);', the following works
  8654. as expected:
  8655. foo(1) -> foo(int)
  8656. foo(1.0) -> foo(double)
  8657. ai = Ai(4)
  8658. foo(ai) -> foo(int)
  8659. Note1: the 'castmode' could disrupt some specialized
  8660. typemaps. In particular, the "implicit.i" library seems to
  8661. have problem with the castmode. But besides that one, the
  8662. entire test-suite compiles fine with and without the
  8663. castmode.
  8664. Note2: the cast mode can't be combined with the fast
  8665. dispatch mode, ie, the -fastdispatch option has no effect
  8666. when the cast mode is selected. The penalties, however,
  8667. are minimum since the cast dispatch code is already based
  8668. on the same fast dispatch mechanism.
  8669. See the file overload_dispatch_cast_runme.py file for
  8670. new cases and examples.
  8671. 12/22/2005: mmatus
  8672. Add the cast and rank mechanism to dispatch overloading
  8673. functions. The UTF supports it now, but for each language
  8674. it must be decided how to implement and/or when to use it.
  8675. [perl] Now perl uses the new cast and rank dispatch
  8676. mechanism, which solves all the past problems known
  8677. in perl, such as the old '+ 1' problem:
  8678. int foo(int);
  8679. $n = 1
  8680. $n = $n + 1
  8681. $r = foo(n)
  8682. also works:
  8683. foo(1);
  8684. foo("1");
  8685. foo(1.0);
  8686. foo("1.0");
  8687. but fails
  8688. foo("l");
  8689. and when overloading foo(int) and foo(double);
  8690. foo(1) -> foo(int)
  8691. foo(1.0) -> foo(double)
  8692. foo("1") -> foo(int)
  8693. foo("1.0") -> foo(double)
  8694. foo("l") -> error
  8695. foo($n) -> foo(int) for good perl versions
  8696. foo($n) -> foo(double) for old bad perl versions
  8697. when overloading foo(int), foo(char*) and foo(double):
  8698. foo(1) -> foo(int)
  8699. foo(1.0) -> foo(double)
  8700. foo("1") -> foo(char*)
  8701. foo("1.0") -> foo(char*)
  8702. foo("l") -> foo(char*)
  8703. Note: In perl the old dispatch mechanism was broken,
  8704. so, we don't provide an option to enable the old one
  8705. since, again, it was really really broken.
  8706. See 'overload_simple_runme.pl' for more cases and tests.
  8707. PS: all the old known issues are declared resolved, any
  8708. new "problem" that could be discovered is declared,
  8709. a priori, as "features" of the new dispatch mechanism
  8710. (until we find another solution at least).
  8711. *** POTENTIAL INCOMPATIBILITY ***
  8712. As with the introduction of the UTF, some things could
  8713. now start to work as expected, and people used to deal or
  8714. workaround previous bugs related to the dispatch
  8715. mechanism, could see now a difference in perl behavior.
  8716. 12/21/2005: mmatus
  8717. - The '-nodefault' flag (pragma and feature) now generates
  8718. a warning, and recommends to use the explicit
  8719. -nodefaultctor and -nodefaultdtor options.
  8720. The reason to split the 'nodefault' behavior is that, in
  8721. general, ignoring the default destructor generates memory
  8722. leaks in the target language. Hence, is too risky just to
  8723. disable both the default constructor and destructor
  8724. at the same time.
  8725. If you need to disable the default destructor, it is
  8726. also recommended you use the directive form:
  8727. %nodefaultdtor MyVerySpecialClass;
  8728. for specific classes, and always avoid using the global
  8729. -nodefault and -nodefaultdtor options.
  8730. 12/21/2005: wsfulton
  8731. [Java, C#]
  8732. Fix incorrect code generation when the intermediary classname is changed
  8733. in the module directive from its default. For example:
  8734. %module(jniclassname="myimclassnewname") "mymodule" // Java
  8735. %module(imclassname="myimclassnewname") "mymodule" // C#
  8736. Add in new special variable $imclassname. See docs.
  8737. 12/17/2005: mmatus
  8738. [Python]
  8739. - Add the -aliasobj0/-noaliasobj0 options to use with
  8740. -fastunpack and/or -O and old typemaps that use 'obj0'
  8741. directly.
  8742. So, if you compile your code using -O and get errors about
  8743. the undeclared 'obj0' variable, run again using
  8744. swig -O -aliasobj0 -python ....
  8745. For new typemaps, never use 'obj0' directly, if needed,
  8746. use the '$self' name that will be properly expanded to
  8747. 'obj0' (nofastunpack) or 'swig_obj[0]' (fastunpack).
  8748. If you have no idea what I am talking about, better, that
  8749. means you have no typemap with this problem.
  8750. 12/14/2005: mmatus
  8751. [Python]
  8752. - Add the -fastunpack/-nofastunpack options to enable/disable
  8753. the use of the internal UnpackTuple method, instead of
  8754. calling the one from the python C API.
  8755. The option -O now also implies -fastunpack.
  8756. 12/11/2005: mmatus
  8757. [Python]
  8758. - Add the -proxydel/-noproxydel options to enable/disable
  8759. the generation of proxy/shadow __del__ methods, even
  8760. when now they are redundant, since they are empty.
  8761. However, old interfaces could rely on calling them.
  8762. The default behavior is to generate the __del__ methods
  8763. as in 1.3.27 or older swig versions.
  8764. The option -O now also implies -noproxydel.
  8765. 12/10/2005: mmatus
  8766. [UTF]
  8767. - Fix unnecessary calls to SWIG_TypeQuery for 'char *'
  8768. and 'wchar_t *', problem found by Clay Culver while
  8769. profiling the PyOgre project.
  8770. [Python]
  8771. - Add the -dirvtable/-nodirvtable to enable/disable
  8772. a pseudo virtual table used for directors, avoiding
  8773. the need to resolve the python method at each call.
  8774. - Add the -safecstrings/-nosafecstrings options to
  8775. enable/disable the use of safe conversions from PyString
  8776. to char *. Python requires you to never change the internal
  8777. buffer directly, and hence 'safectrings' warranties that
  8778. but returning a copy of the internal python string buffer.
  8779. The default, as in previous releases, is to return a
  8780. pointer to the buffer (nosafecstrings), so, it is the user's
  8781. responsibility to avoid its modification.
  8782. - Add the -O option to enable all the optimization options
  8783. at once, initially equivalent to
  8784. -modern -fastdispatch -dirvtable -nosafecstrings -fvirtual
  8785. 12/08/2005: mmatus
  8786. - Add the -fastdispatch option (fastdispatch feature). This
  8787. enables the "fast dispatch" mechanism for overloaded
  8788. methods provided by Salvador Fandi~no Garc'ia (#930586).
  8789. The resulting code is smaller and faster since less type
  8790. checking is performed. However, the error messages you
  8791. get when the overloading is not resolved could be
  8792. different from what the traditional method returns.
  8793. With the old method you always get an error such as
  8794. "No matching function for overloaded ..."
  8795. with the new method you can also get errors such as
  8796. "Type error in argument 1 of type ..."
  8797. See bug report #930586 for more details.
  8798. So, this optimization must be explicitly enabled by users.
  8799. The new mechanism can be used as:
  8800. swig -fastdispatch
  8801. or using the feature form
  8802. %feature("fastdispatch") method;
  8803. or
  8804. %fastdispatch method;
  8805. 12/06/2005: mmatus
  8806. - Several memory and speed improvements, specially for
  8807. templates. Now swig is up to 20 faster than before for
  8808. large template interfaces, such as the std_containers.i
  8809. and template_matrix.i files in the python test-suite.
  8810. Memory footprint is also reduced in consideration of small
  8811. pcs/architectures.
  8812. - add commandline options -cpperraswarn and -nocpperraswarn" to force
  8813. the swig preprocessor to treat the #error directive as a #warning.
  8814. the pragmas
  8815. #pragma SWIG cpperraswarn=1
  8816. #pragma SWIG cpperraswarn=0
  8817. are equivalent to the command line options, respectively.
  8818. 12/06/2005: mmatus
  8819. [Python] The generated code is now more portable, especially
  8820. for Windows. Following
  8821. http://www.python.org/doc/faq/windows.html
  8822. Py_None is never accessed as a structure, plus other
  8823. tricks mentioned there.
  8824. 12/06/2005: mmatus
  8825. [Python] Added initial support for threads based in the
  8826. proposal by Joseph Winston.
  8827. The user interface is as follows:
  8828. 1.- the module thread support is enable via the "threads" module
  8829. option, i.e.
  8830. %module("threads"=1)
  8831. 2.- Equivalent to that, is the new '-threads' swig option
  8832. swig -threads -python ...
  8833. 3.- You can partially disable thread support for a given
  8834. method using:
  8835. %feature("nothread") method;
  8836. or
  8837. %nothread method;
  8838. also, you can disable sections of the thread support,
  8839. for example
  8840. %feature("nothreadblock") method;
  8841. or
  8842. %nothreadblock method;
  8843. %feature("nothreadallow") method;
  8844. or
  8845. %nothreadallow method;
  8846. the first disables the C++/python thread protection, and the
  8847. second disables the python/C++ thread protection.
  8848. 4.- The current thread support is based in the PyGIL
  8849. extension present in python version 2.3 or later, but
  8850. you can provide the thread code for older versions by
  8851. defining the macros in pythreads.swg.
  8852. If you get a working implementation for older versions,
  8853. please send us a patch.
  8854. For the curious about performance, here are some numbers
  8855. for the profiletest.i test, which is used to check the speed
  8856. of the wrapped code:
  8857. nothread 9.6s (no thread code)
  8858. nothreadblock 12.2s (only 'allow' code)
  8859. nothreadallow 13.6s (only 'block' code)
  8860. full thread 15.5s ('allow' + 'block' code)
  8861. i.e., full thread code decreases the wrapping performance by
  8862. around 60%. If that is important to your application, you
  8863. can tune each method using the different 'nothread',
  8864. 'nothreadblock' or 'nothreadallow' features as
  8865. needed. Note that for some methods deactivating the
  8866. 'thread block' or 'thread allow' code is not an option,
  8867. so, be careful.
  8868. 11/26/2005: wsfulton
  8869. SWIG library files use system angle brackets everywhere for %include, eg
  8870. %include "std_common.i"
  8871. becomes
  8872. %include <std_common.i>
  8873. 11/26/2005: wsfulton
  8874. [Java, C#]
  8875. Typesafe enums and proper enums have an extra constructor so that enum item values that
  8876. are initialised by another enum item value can be wrapped without having to use %javaconstvalue/
  8877. %csconstvalue for when using %javaconst(1)/%csconst(1). Suggestion by
  8878. Bob Marinier/Douglas Pearson.
  8879. For example:
  8880. typedef enum
  8881. {
  8882. xyz,
  8883. last = xyz
  8884. } repeat;
  8885. 11/21/2005: mmatus
  8886. [ruby + python]
  8887. Fixes for directors + pointers. This is an ugly problem without an easy
  8888. solution. Before we identified this case as problematic:
  8889. virtual const MyClass& my_method();
  8890. but it turns out that all the cases where a pointer, array or
  8891. reference is returned, are problematic, even for
  8892. primitive types (as int, double, char*, etc).
  8893. To try to fix the issue, a new typemap was added,
  8894. 'directorfree', which is used to 'free' the resources
  8895. allocated during the 'directorout' phase. At the same
  8896. time, a primitive garbage collector engine was added to
  8897. deal with orphaned addresses, when needed.
  8898. The situation is much better now, but still it is possible to have
  8899. memory exhaustation if recursion is used.
  8900. So, still you need to avoid returning pointers, arrays or
  8901. references when using director methods.
  8902. - Added stdint.i - typemaps for latest C99 integral types found in stdint.h.
  8903. 11/14/2005: wsfulton
  8904. More types added to windows.i, eg UINT8, WORD, BYTE etc.
  8905. Including windows.i will also enable SWIG to parse the __declspec Microsoft
  8906. extension, eg __declspec(dllimport). Also other Windows calling conventions
  8907. such as __stdcall.
  8908. 11/10/2005: wsfulton
  8909. New library file for Windows - windows.i. This file will contain useful type
  8910. information for users who include windows.h. Initial support is for the
  8911. non ISO integral types: __int8, __int16, __int32, __int64 and unsigned versions.
  8912. The unsigned versions previously could not be parsed by SWIG. SF #872013.
  8913. 11/09/2005: wsfulton
  8914. [Java, C#] Portability warning for files which will overwrite each other on case
  8915. insensitive file systems such as FAT32/NTFS. This will occur, for example, when two
  8916. class names are the same barring case. The warning is issued on all platforms and
  8917. can be suppressed with the usual warning suppression techniques. SF bug #1084507.
  8918. 11/09/2005: wsfulton
  8919. ./configure --with-python --with-ruby --with-perl5 etc enable these languages,
  8920. ie the --with-xxxx options, where no path is specified, work the same as if
  8921. the option was not specified at all. Based on patches #1335042 #1329048 #1329047.
  8922. 11/09/2005: dancy
  8923. [Allegrocl]
  8924. Add C++ support to the Allegrocl module. Further
  8925. enhances the C support as well. Some of the
  8926. features:
  8927. - MUCH better generation of foreign types based on
  8928. the C/C++ types for use in defining the FFI on
  8929. the lisp side. We don't pass everything as a (* :void)
  8930. any longer.
  8931. - Uses typemaps for better control of type conversions
  8932. and code generation in the generated lisp and c++ wrapper
  8933. code.
  8934. - CLOS wrapping of pointers returned from foreign space
  8935. makes it easier to differentiate pointers in user code.
  8936. The wrapping objects can be passed directly to FF calls.
  8937. - Defun wrapping of FF calls, allowing for more lispy
  8938. interface. Conversion, GCing, of lisp objects to
  8939. foreign objects can be done in the wrapping defun via
  8940. the use of typemaps.
  8941. - overload dispatching implemented on the lisp side
  8942. using generic functions.
  8943. - Templates and synonymous types supported.
  8944. 11/07/2005: mmatus
  8945. [Python] Adding proper support for multi-inheritance in
  8946. the python side, ie, if you have two C++ wrapped class, Foo
  8947. and Bar, now:
  8948. class MyPythonClass(Foo,Bar):
  8949. ....
  8950. will properly work, even with directors, and the
  8951. deallocation of Foo.this and Bar.this will follow
  8952. correctly. Before, a class could only have one 'this'
  8953. instance (unlike C++), only the last base class was
  8954. properly deleted, or detected with directors.
  8955. Now 'self.this' can be a list, which will contain the C++
  8956. instance pointers for all the base classes.
  8957. Also, swig.this is responsible for deallocating the C++
  8958. instance(s), and the __del__ method is not emitted unless
  8959. the user preppend/append some code to it.
  8960. - Swig can now detect memory leaks, ie, if you still
  8961. don't use proxy/shadow classes, and type something like
  8962. import _example
  8963. f = _example.new_Foo()
  8964. and forget to call _example.delete_Foo(f), then swig will
  8965. tell you that there is a memory leak.
  8966. Otherwise, if you always use the proxy classes, you probably
  8967. you will never ever see this warning unless there is
  8968. something wrong inside the swig wrapping code.
  8969. *** POTENTIAL INCOMPATIBILITY ***
  8970. If you overloaded the __del__ method, and call the base
  8971. one without a try block, as in
  8972. class MyClass(SwigClass):
  8973. def __del__(self):
  8974. <your code here>
  8975. SwigClass.__del__(self)
  8976. python could complain that the method SwigClass.__del__ is
  8977. undefined. Try to use instead:
  8978. def __del__(self):
  8979. <your code here>
  8980. try: SwigClass.__del__(self)
  8981. except: pass
  8982. or simply
  8983. def __del__(self):
  8984. <your code here>
  8985. 11/02/2005: mmatus
  8986. [Python] Adding more fun to STL/STD containers, now you
  8987. can do
  8988. %template(pyset) std::set<PyObject *>;
  8989. %template(pyvector) std::vector<PyObject *>;
  8990. %template() std::pair<PyObject *,PyObject *>;
  8991. %template(pyvector) std::map<PyObject *,PyObject *>;
  8992. ....
  8993. The same applies to std::list, std::deque, std::multiset, etc.
  8994. Then, at the python side you can do now:
  8995. # C++ std::vector as native python sequence
  8996. v = pyvector([1,"hello",(1,2)])
  8997. print v[1]
  8998. >> 'hello'
  8999. print v[2]
  9000. >> (1,2)
  9001. # C++ std::set as native python sequence
  9002. s = pyset()
  9003. s.insert((1,2))
  9004. s.insert(1)
  9005. s.insert("hello")
  9006. sum=()
  9007. for i in s:
  9008. sum +=(i,)
  9009. print sum
  9010. >>> (1, 'hello', (1, 2))
  9011. # C++ std::map as native python sequence
  9012. m = pymap()
  9013. m["foo"] = "hello"
  9014. m[1] = (1,2)
  9015. pm = {}
  9016. for k in m:
  9017. pm[k] = m[k]
  9018. print pm
  9019. >>> {1: (1, 2), 'foo': 'hello'}
  9020. ie, the STD/STL containers work as real native python
  9021. container, with arbitrary item types and so.
  9022. But since normal C++ containers do not properly ref/unref
  9023. their items, you should use the safer versions:
  9024. %template(pyset) std::set<swig::PyObject_ptr>;
  9025. %template(pyvector) std::vector<swig::PyObject_ptr>;
  9026. %template() std::pair<swig::PyObject_ptr, swig::PyObject_ptr>;
  9027. %template(pyvector) std::map<swig::PyObject_ptr,swig::PyObject_ptr>;
  9028. ....
  9029. where swig::PyObject_ptr is a PyObject * envelope class provided
  9030. to safely incref/decref the python object.
  9031. So, now you can use all the STL/STD containers as native
  9032. Python containers.
  9033. Note 1: std::map, std::set and the other 'ordered'
  9034. containers will properly use PyObject_Compare for sorting,
  9035. when needed.
  9036. Note 2: all the STL/STD containers have a limit size of
  9037. SIZE_MAX, ie, you can have manage containers larger than
  9038. INT_MAX, the python limit.
  9039. 11/02/2005: mmatus
  9040. [Python]
  9041. - add 'iterator()' method for all sequences and additionally
  9042. 'key_iterator()' for maps.
  9043. 'iterator()' will always return the native C++ iterator.
  9044. Additionally, in maps, 'key_iterator()' will return a python
  9045. iterator using only the map keys.
  9046. In general the sequence method __iter__ will call
  9047. 'iterator()', returning the native C++ iterator, but in
  9048. maps it will call 'key_iterator()', maintaining
  9049. backward compatibility.
  9050. Hence, for std::maps, you can play then with the native
  9051. C++ iterator, which value is a (key, value) pair, by
  9052. calling map.iterator(), as with map.begin(), map.end(), etc.
  9053. The difference is that map.iterator() returns a safe
  9054. 'closed' iterator, while map.begin() and map.end() are
  9055. 'open' iterators.
  9056. A 'closed' iterator knows the begin and the end of the
  9057. sequence, and it never can seg. fault. An 'open'
  9058. iterator, as in C++, can seg. fault at the C++ side.
  9059. # a closed iterator is safe in the following example.
  9060. # the next() method will throw a StopIteration
  9061. # exception as needed
  9062. i = seq.iterator()
  9063. try:
  9064. while True:
  9065. sum += i.next()
  9066. except: pass
  9067. # an open iterator always need to be checked,
  9068. # or it will crash at the C++ side
  9069. current = seq.begin()
  9070. end = seq.end()
  9071. while (current != end):
  9072. sum += current.next()
  9073. [Python]
  9074. - Finally, when we call
  9075. f = Foo()
  9076. the construction is 'one-way'. Before construction was done
  9077. something like
  9078. Foo() (python) -> _new_Foo() (C++)
  9079. new_Foo() (C++) -> FooPtr() (python)
  9080. FooPtr() (python) -> Foo() (python)
  9081. and returning a pointer was done like
  9082. NewPointerObj() (C++) -> FooPtr() (python)
  9083. FooPtr(python) -> Foo() (python)
  9084. ie, we when going back and forward between the C++ and
  9085. python side.
  9086. Now since there is no FooPtr the construction process is
  9087. Foo() (python) -> _new_Foo() (C++)
  9088. _new_Foo() (C++) -> NewPointerObj() (C++) (no shadow class)
  9089. and returning a pointer is done
  9090. NewPointerObj() (C++) (with shadow class) -> NewInstaceObj() (C++)
  9091. where NewInstanceObj creates a new instance without
  9092. calling __init__ and it doesn't go 'back' to python, is
  9093. 'pure' C API.
  9094. - With this change, and the other ones in the
  9095. PySwigObject type, which now carries the thisown and
  9096. swig_type_info pointer, the generated code should be as
  9097. fast as boost::Python and/or the other python wrappers
  9098. based in pure Python/C API calls.
  9099. As a reference, the profiletest_runme.py example, which
  9100. does a simple call function many times, such as this code:
  9101. import profiletest
  9102. a = profiletest.A()
  9103. b = profiletest.B()
  9104. for i in range(0,1000000)
  9105. a = b.fn(a)
  9106. where fn is defined as 'A* B::fn(A *a) {return a;}',
  9107. produces the following times
  9108. nomodern modern
  9109. swig-1.3.26 19.70s 5.98s
  9110. swig-CVS 0.99s 0.98s
  9111. Clearly, there is a large improvement for the python
  9112. 'nomodern' mode. Still, the 'modern' mode is around
  9113. 6 times faster than before. For the same test, but
  9114. using the non-shadow version of the module, we get
  9115. _profiletest (non-shadow)
  9116. swig-1.3.26 0.80s
  9117. swig-CVS 0.60s
  9118. Hence, now for practical purposes, the proxy overhead
  9119. is insignificant.
  9120. Note that the performance numbers we are showing is for
  9121. a simple module (two types) and a simple function (one
  9122. argument). For real situations, for modules with many
  9123. more types and/or functions with many more parameters,
  9124. you will see even better results.
  9125. 10/31/2005: mmatus
  9126. [Python]
  9127. - Finally, no more ClassPtr proxy classes. You will see
  9128. only a clean Class proxy class in the .py file.
  9129. - No more 'real' thisown attribute either, the PySwigObject now
  9130. carries the ownership info.
  9131. You can also do something like
  9132. print self.this.own()
  9133. >>> True
  9134. self.this.disown()
  9135. self.this.own(0)
  9136. print self.this.own()
  9137. >>> False
  9138. self.this.acquire()
  9139. self.this.own(1)
  9140. print self.this.own()
  9141. >>> True
  9142. Still the old way,
  9143. print self.thisown
  9144. >>> True
  9145. self.thisown = 0
  9146. print self.thisown
  9147. >>> False
  9148. self.thisown = 1
  9149. print self.thisown
  9150. >>> True
  9151. is supported, and python dispatches the proper method
  9152. calls as needed.
  9153. - Support for iterators in STL/STD containers, for example, if you have
  9154. %template<set_string> std::set<std::string>;
  9155. you can use the C++ iterators as:
  9156. s = set_string()
  9157. s.append("c")
  9158. s.append("a")
  9159. s.append("b")
  9160. b = s.begin()
  9161. e = s.end()
  9162. sum = ""
  9163. while (b != e):
  9164. sum += b.next()
  9165. print sum
  9166. >>> "abc"
  9167. advance the iterator as in C++
  9168. current = s.begin()
  9169. current += 1
  9170. print current.value()
  9171. >>> "b"
  9172. now using the reverse operators
  9173. b = s.rbegin()
  9174. e = s.rend()
  9175. sum = ""
  9176. while (b != e):
  9177. sum += b.next()
  9178. print sum
  9179. >>> "cba"
  9180. or the 'previous' method
  9181. b = s.begin()
  9182. e = s.end()
  9183. sum = ""
  9184. while (b != e):
  9185. sum += e.previous()
  9186. print sum
  9187. >>> "cba"
  9188. or just as in a python fashion
  9189. for i in s:
  9190. sum += i
  9191. Note 1: Iterators in C++ are very powerful, but
  9192. dangerous too. And in python you can shoot yourself in the foot
  9193. just like in C++, so, be careful.
  9194. Note 2: the iterators are 'light', ie, they do not
  9195. convert sequence elements until you request to do so, via
  9196. next(), value() or previous(). If you just increment/decrement one
  9197. no conversion is performed, for example:
  9198. b = s.begin()
  9199. b += 1
  9200. b.incr()
  9201. b.incr(2)
  9202. b.decr(2)
  9203. b.decr()
  9204. b -= 1
  9205. only the iterator is modified, and not value wrapper
  9206. is generated. Other typical C++ operations are also
  9207. available, such as:
  9208. print s.end() - s.begin()
  9209. >>> 3
  9210. f = s.begin() + 1
  9211. print f.value()
  9212. >>> "b"
  9213. l = s.end() - 1
  9214. print l.value()
  9215. >>> "c"
  9216. etc. Of course, the 'find', 'insert', 'erase', and
  9217. so on methods also supports iterators now, ie:
  9218. i = s.begin()
  9219. i += 1
  9220. s.erase(i)
  9221. for i in s:
  9222. sum += i
  9223. print sum
  9224. >>> "ac"
  9225. *** POTENTIAL INCOMPATIBILITY ***
  9226. There is no more 'thisown' attribute. If you use it, python
  9227. will translate the following code as follows:
  9228. if (self.thisown): ==> if (self.this.own()):
  9229. self.thisown = 1 ==> self.this.own(1)
  9230. self.thisown = 0 ==> self.this.own(0)
  9231. Still, maybe in some unusual cases the translation will not be
  9232. 100% correct, so if you have a problem, please report it
  9233. and/or use the new 'self.this.own()' accessor.
  9234. *** POTENTIAL INCOMPATIBILITY ***
  9235. There is no more ClassPtr classes in the python code. Hence,
  9236. if in the past you needed to resort to some kind of trickery
  9237. with them, or overcome their presence, it is no longer
  9238. required, but the extra code you added could now break
  9239. things.
  9240. If needed, you can use the option -classptr, i.e.,
  9241. swig -classptr -python ...
  9242. to generate the old ClassPtr classes.
  9243. 10/30/2005: mkoeppe
  9244. [Guile] Make declared and defined linkage of SWIG_init consistent.
  9245. Reported by Steven G. Johnson (SF patch 1315498).
  9246. 10/26/2005: mmatus
  9247. - Added the attribute.i file to the global library director.
  9248. Now it can be used from other languages that do not use
  9249. the unified typemap library as well.
  9250. So, if you have something like:
  9251. %include attribute.i
  9252. %attribute(A, int, a, get_a, set_a);
  9253. struct A
  9254. {
  9255. int get_a() const;
  9256. void set_a(int aa);
  9257. };
  9258. %attribute_ref(B, int, c);
  9259. struct B
  9260. {
  9261. int& c();
  9262. };
  9263. then in the target language the 'A.a' and 'B.c' attributes will
  9264. be visible, ie, you can access them as plain variables:
  9265. f = A()
  9266. f.a = 3
  9267. g = B()
  9268. g.c = 3
  9269. h = f.a + g.c
  9270. and the proper get/set methods will be dispatched. See
  9271. attribute.i for more info.
  9272. - More cleanups around and adding more test-cases. The
  9273. DISOWN typemap now is tested and working in all the
  9274. languages that use the unified typemap library, ie, tcl,
  9275. ruby, perl and python.
  9276. 10/25/2005: mmatus
  9277. - Perl, complete the DISOWN typemap.
  9278. - added the attribute.i file to the unified typemap
  9279. library (before was only usable from python).
  9280. - unify the names for the setter and getter methods in
  9281. perl,tcl,ruby and python, so, the attribute.i library
  9282. can work across them.
  9283. - see the li_attribute.i test-case or the library file
  9284. Lib/typemaps/attribute.swg
  9285. for more info about how to use it.
  9286. 10/24/2005: mmatus
  9287. - Perl now uses the unified typemap library.
  9288. - Changes in ruby to use the $track option in typemaps.
  9289. - Changes in the unified typemap library to follow the
  9290. convention that all macros that are not used in the
  9291. C/C++ side starts with %, such as
  9292. %delete
  9293. %new_array
  9294. etc.
  9295. - Documenting fragments, see fragments.swg.
  9296. - Cleaner way to use the unified typemap library, include
  9297. just <typemaps/swigtypes.swg>.
  9298. Check some of the supported languages: perl, tcl, ruby,
  9299. python.
  9300. Always start with the head file, such as
  9301. python/python.swg
  9302. tcl/tcl8.swg
  9303. ruby/ruby.swg
  9304. perl5/perl5.swg
  9305. and the principal file that invokes the unified library, such as
  9306. python/pytypemaps.swg
  9307. tcl/tcltypemaps.swg
  9308. ruby/rubytypemaps.swg
  9309. perl/perltypemaps.swg
  9310. The file that provide the specialization for each
  9311. language are the one that provides the basic types:
  9312. python/pyprimtypes.swg
  9313. ruby/rubyprimtypes.swg
  9314. tcl/tclprimtypes.swg
  9315. perl5/perlprimtypes.swg
  9316. and the string manipulation:
  9317. python/pystrings.swg
  9318. ruby/rubystrings.swg
  9319. tcl/tclstrings.swg
  9320. perl5/perlstrings.swg
  9321. The rest of the files, such as carray.i, are mostly one
  9322. line files that include the proper typemap library
  9323. version.
  9324. *** POTENTIAL INCOMPATIBILITY in Perl ***
  9325. Some missing/wrong typemaps could start working properly,
  9326. and change the old expected behavior in Perl.
  9327. 10/23/2005: wuzzeb
  9328. Chicken:
  9329. + pointers to member functions finally work properly
  9330. + add test of member function pointers to cpp_basic.i
  9331. 10/20/2005: dancy
  9332. [allegrocl] Added C++ support. Large update, many changes. See
  9333. newly added Allegro Common Lisp section in lisp.html
  9334. 10/20/2005: mmatus
  9335. Ruby, Tcl, Python:
  9336. - Uniform way to fail (label fail:), now finally
  9337. SWIG_exception works across the three languages and all
  9338. the typemaps.
  9339. - Add proper cleanup code to ruby
  9340. - More valgrind fixes
  9341. - Simplify the inline use, it seems a small interface of
  9342. 20,000 lines (plus many many templates) can break
  9343. gcc -O3 easily.
  9344. - Finalize the typemaps library. All the old *.i files
  9345. (carray.i, cpointer.i, exception.i) had been implemented
  9346. in the new typemaps library.
  9347. 10/19/2005: wuzzeb
  9348. Update the Runtime Typemap documentation in Typemaps.html
  9349. 10/18/2005: wuzzeb
  9350. Chicken:
  9351. - Correctly handle %ignored classes
  9352. - Correctly convert long, long long, unsigned long, etc
  9353. to chicken primitives. (Thanks to Felix Winkelmann)
  9354. - Using argout parameters when the return value was a
  9355. wrapped pointer caused a memory corruption. The chicken
  9356. garbage collector moved a pointer out from under us.
  9357. This is now fixed by running all the proxy creation
  9358. functions as continuations after the wrapper function
  9359. returns. As part of this, we no longer need the
  9360. chickenfastproxy flag on output typemaps.
  9361. - using -proxy and -nocollection together works now
  9362. Before, it was not exporting the destructor in the proxy
  9363. wrapper.
  9364. 10/18/2005: mmatus
  9365. Added the Unified Typemap Library (UTL). It unifies the typemaps for
  9366. python, ruby, tcl
  9367. and in the process, fixes several problems in each of the three
  9368. languages to work in a "canonical" way now established in
  9369. the typemap library
  9370. SWIG/Lib/typempas
  9371. The current status of the unification is that everything
  9372. compiles and runs inside the test-suite and examples
  9373. directories. And for the first time we have three
  9374. languages than pass the primitive_types.i case.
  9375. Also, we have a uniform way to treat the errors, for example
  9376. if you do something like
  9377. >>> from primitive_types import *
  9378. >>> print val_uchar(10)
  9379. 10
  9380. >>> print val_uchar(1000)
  9381. Traceback (most recent call last):
  9382. File "<stdin>", line 1, in ?
  9383. OverflowError: in argument 1 of type 'unsigned char'
  9384. you get the same exception in all the three languages.
  9385. And well, many more good things will come from this
  9386. unification, for example, proper support of the STL/STD classes
  9387. for all the languages, and hopefully, we can keep
  9388. adding other languages.
  9389. The hardest part, writing a common typemap library
  9390. that suites the three different languages, is done,
  9391. and adding another language should now be easy.
  9392. Still the global unification is not complete, the STL/STD
  9393. part is next, and probably as well as adding one or two more
  9394. languages.
  9395. If you are curious, look at the python, ruby and/or tcl
  9396. directories to see what is needed to support the new
  9397. common typemaps library. Still, the final way to
  9398. integrate a new language could change as we move to
  9399. integrate the STD/STL.
  9400. *** POTENTIAL INCOMPATIBILITY in Ruby/Tcl ***
  9401. Some missing/wrong typemaps could start working properly,
  9402. and change the old behavior, specially in ruby and tcl.
  9403. Version 1.3.27 (October 15, 2005)
  9404. =================================
  9405. 10/15/2005: wsfulton
  9406. [Java] Fix for typesafe enum wrapping so that it is possible to
  9407. overload a method with 2 different enum types.
  9408. 10/15/2005: wsfulton
  9409. Fix for %feature("immutable","0") attempting to generate setters
  9410. for constants.
  9411. Restored %immutable and %makedefault to clear the feature as it
  9412. behaved in SWIG-1.3.25 and earlier.
  9413. 10/14/2005: mmatus
  9414. Fix bug in anonymous typedef structures which was leading to
  9415. strange behaviour.
  9416. 10/13/2005: mmatus
  9417. Several minor changes:
  9418. - Improve the wchar_t type support
  9419. - Add a warning for when you define the 'in' typemap but
  9420. you don't define the 'typecheck' one. Very common mistake.
  9421. - Add proper default rule for function pointers, now you
  9422. can define a typemap such as:
  9423. %typemap(in) SWIGTYPE ((*)(ANY)) {...}
  9424. That will apply to all the pointer to functions. The
  9425. rule in C++ also apply to the function 'reference', ie,
  9426. in both cases
  9427. typedef int (*fptr)(int a);
  9428. typedef int (func)(int a);
  9429. This was needed since it seems to be 'illegal' in C++ to
  9430. do something like:
  9431. void *ptr = static_cast<void *>(fptr);
  9432. and probably, as for member functions, it is not
  9433. warrantied that the pointer sizes will match.
  9434. - Add the #error/#warning directives to swig's cpp.
  9435. - Add the noblock option for typemaps, which is used as
  9436. follows: supposed you a typemap, like this
  9437. %typemap(in,noblock=1) Hello {
  9438. ....
  9439. }
  9440. then the typemap will be inserted without the block
  9441. imposed by the brackets, similar to
  9442. %typemap(in) Hello "..."
  9443. So, why you don't just use the quote style?, because:
  9444. 1.- The quote style doesn't get preprocessed, for example
  9445. %typemap(in) Hello "$1= SWIG_macro($1);"
  9446. here, SWIG_macro doesn't get expanded
  9447. 2.- Inside a quote typemap, you have to use
  9448. quotes carefully
  9449. %typemap(in) Hello "$1 = \"hello\" "
  9450. 3.- You can't make emacs and/or other editors
  9451. to indent inside a string!.
  9452. So, why do you want to remove the block?, because an extra
  9453. block when not needed (no local variables in it):
  9454. 1.- makes the code harder to read
  9455. 2.- makes the code larger
  9456. 3.- or in short, for the same reason we have the quote style.
  9457. Version 1.3.26 (October 9, 2005)
  9458. ================================
  9459. 10/08/2005: wsfulton
  9460. [Php] Added 'throws' typemaps.
  9461. 10/08/2005: wsfulton
  9462. Fixes for languages that don't support multiple inheritance. The
  9463. first non-ignored class in the public base class list is used for inheritance.
  9464. by the proxy class. Previously, if the first class in the list was ignored, then
  9465. the proxy class wouldn't have any base classes.
  9466. 10/07/2005: mmatus
  9467. Update more features to follow new convention, including:
  9468. callback
  9469. ref/unref
  9470. except
  9471. All of them use not only the feature as a flag, but also
  9472. as code value. To deal with those features, we use now
  9473. GetFlagAttr, which is similar to GetFlag, but instead or
  9474. returning 1 or 0, it returns the attr value, if happens
  9475. to be different of "0" of course.
  9476. Now there are also more uniform directive names for the
  9477. ones based in features, for example, for the old
  9478. %newobject directive now we have tree directives defined:
  9479. #define %newobject %feature("new")
  9480. #define %nonewobject %feature("new","0")
  9481. #define %clearnewobject %feature("new","")
  9482. and so on for all the other feature directives.
  9483. *** POTENTIAL INCOMPATIBILITY ***
  9484. 09/30/2005: wsfulton
  9485. Subtle change to some features. Previously it was not possible to disable many
  9486. features once they had been enabled. This was for most features that behave as
  9487. flags. These features now work as follows:
  9488. %feature("name") // enables the feature
  9489. %feature("name", "1") // enables the feature
  9490. %feature("name", "0") // disables the feature
  9491. %feature("name", "") // clears the feature
  9492. In fact any non-empty value other than "0" will enable the feature (like C boolean logic).
  9493. Previously "1", "0" or any other non-empty value would enable the feature and it would
  9494. only be possible to disable the feature by clearing it (assuming there was no global enable).
  9495. The following features are affected:
  9496. allowexcept
  9497. compactdefaultargs
  9498. classic (Python)
  9499. cs:const (C#)
  9500. director
  9501. exceptionclass (Python)
  9502. ignore
  9503. immutable
  9504. java:const (Java)
  9505. java:downcast (Java)
  9506. kwargs
  9507. modern (Python)
  9508. new
  9509. noautodoc (Python)
  9510. nodefault
  9511. nodirector
  9512. noref
  9513. notabstract
  9514. nounref
  9515. novaluewrapper
  9516. python:maybecall (Python)
  9517. python:nondynamic (Python)
  9518. modula3:multiretval (Modula3)
  9519. predicate (Ruby)
  9520. trackobjects (Ruby)
  9521. valuewrapper
  9522. It is now possible, for example to ignore all methods/classes in a header file, except for a
  9523. few targetted methods, for example:
  9524. %feature("ignore"); // ignore all methods/classes
  9525. %feature("ignore","0") some_function(int, double); // do not ignore this function
  9526. %feature("ignore","0") SomeClass; // do not ignore this Class
  9527. %feature("ignore","0") SomeClass::method; // do not ignore this method
  9528. %include "bigheader.h"
  9529. Removed %pythondynamic - it never worked properly. Use %pythonnondynamic instead.
  9530. Removed %feature("nokwargs") - it wasn't fully implemented - use %feature("kwargs","0") instead.
  9531. *** POTENTIAL INCOMPATIBILITY ***
  9532. 09/25/2005: mkoeppe
  9533. [Guile] Add "throws" typemaps.
  9534. 09/24/2005: cfisavage
  9535. [Ruby] Adds new %trackobjects functionality that maps C++ objects to
  9536. Ruby objects. This functionality makes it much easier to implement
  9537. mark functions for the garbage collector. For more information
  9538. refer to the update documentation and examples.
  9539. 09/20/2005: wsfulton
  9540. [Perl] Patch 1116431 from Josh Cherry. Fixes non member functions inadvertently
  9541. being called instead of member functions.
  9542. 09/20/2005: wsfulton
  9543. [Lua] Patch from Mark Gossage to add support for Lua-5.1, std::string,
  9544. std::vector, std::exception and documentation.
  9545. 09/14/2005: mmatus
  9546. [Python] Add -nocppcast. Now the default behavior is to
  9547. always use the cppcast operators. Before that was the case
  9548. only when you used the -cppcast option.
  9549. If this seems to break your code... your welcome!, it
  9550. means it was broken before, and you never notice.
  9551. If you thing the error is due to one of the SWIG typemaps,
  9552. send us an example.
  9553. Use -nocppcast only with very old C++ compilers that
  9554. do not support the cppcast operations.
  9555. So, here applies:
  9556. This change doesn't break compatibility, it was broken before.
  9557. 09/13/2005: wsfulton
  9558. [Java] Fix for director methods when a class is passed by value as a
  9559. parameter.
  9560. 09/11/2005: mmatus
  9561. Adding the module option to the %import directive. Now you
  9562. can use it as
  9563. %import(module="BigModule") foo.i
  9564. where subfile could (or not) define the module name via
  9565. the %module directive. The module option take precedence
  9566. and it has the same effects than having the directive
  9567. %module BigModule
  9568. inside the imported file foo.i.
  9569. You can use the option in mainly two cases:
  9570. 1.- You used the -module option when you generated the
  9571. module to be imported, and hence the module name in
  9572. the imported %module directive is not really useful.
  9573. 2.- The module you want to import is very large, and it
  9574. has several .i/.h files. Then, if you just one to
  9575. import a class or so from the module, says 'foo', and
  9576. not the entire module via importing the main
  9577. BigModule.i file, then you just do:
  9578. %import(module="BigModule") foo.h
  9579. or
  9580. %import(module="BigModule") foo.i
  9581. where foo.i contains the 'foo' declaration and maybe a
  9582. couple of extra %include directives, as needed.
  9583. 09/11/2005: mmatus
  9584. Fix bug #1282637, about the -module option not having effect
  9585. in places where it was needed.
  9586. 09/11/2005: wsfulton
  9587. When wrapping variables, ensure that none of the typemaps used for the
  9588. set wrappers are used when generating the get wrappers. I doubt this was a
  9589. problem for any languages except for the recently introduced null attribute
  9590. in the out typemap (C# only).
  9591. 09/08/2005: wsfulton
  9592. More descriptive error messages when files fail to open.
  9593. 09/06/2005: mmatus
  9594. Allow a %define a macro inside another %define macro, for example
  9595. %define hello(name, Type)
  9596. %define name ## a(Type)
  9597. %typemap(in) Type "hello;"
  9598. %enddef
  9599. %enddef
  9600. To learn how to use this new features in your own typemaps library, see
  9601. python/cstring.i, python/cwstring.i and python/cwstrbase.i.
  9602. [Python] Normalize the cstring.i implementation to use fragments, and add
  9603. cwstring.i, which implements the same typemaps but for wchar_t strings.
  9604. [Python] Bug fixed: 1247477, 1245591, 1249878 and others.
  9605. 08/18/2005: wsfulton
  9606. [Ruby] Implement support for SWIGTYPE* DISOWN typemap (like in Python) for
  9607. better control of memory management, eg when adding an object created in Ruby
  9608. to a C++ container. Patch #1261692 from Charlie Savage.
  9609. 08/18/2005: wsfulton
  9610. [Tcl] 64 bit platform fixes for the varargs handling in SWIG_GetArgs. This is an
  9611. improved fix for bug #1011604 as suggested by Jeremy Lin.
  9612. 08/18/2005: wsfulton
  9613. [Tcl] Bug #1240469 - %newobject support for Tcl. Patch from Bob Marinier.
  9614. 08/16/2005: wsfulton
  9615. [Perl] Bug #1254494 - Fix for global namespace pollution by perl header files
  9616. (bool define) prevented STL headers from being used on some systems, eg
  9617. Windows with Visual Studio.
  9618. 08/16/2005: wsfulton
  9619. [Java] Bug #1240937 - Redefinition of __int64 typedef for Intel compilers.
  9620. 08/15/2005: wsfulton
  9621. [Xml] Bug #1251832 - C++ template may generate invalid XML file
  9622. 08/15/2005: wsfulton
  9623. [Lua] Support added for Lua. Patch #1242772 from Mark Gossage.
  9624. It supports most C/C++ features (functions, struct, classes, arrays, pointers,
  9625. exceptions), as well as lots of documentation and a few test cases & examples.
  9626. 08/14/2005: wsfulton
  9627. [Xml] Fix incorrect xml escaping in base class name when base class is a template.
  9628. 08/13/2005: efuzzyone
  9629. [CLISP] Added support for handling enums. Does not adds the return type declaration
  9630. to the function definition, if a function returns void.
  9631. 08/09/2005: mkoeppe
  9632. New language module, Common Lisp with UFFI, from Utz-Uwe Haus.
  9633. 08/09/2005: mkoeppe
  9634. Fix the Lisp s-expression output module; it no longer complains about "unknown targets".
  9635. 07/27/2005: wsfulton
  9636. Modifications to STL wrappers so that it is possible for a user's %exception directive
  9637. to be applied to the STL wrapper methods. Previously the following global %exception
  9638. directive would not be used on the wrapper methods:
  9639. %exception {
  9640. try {
  9641. $action
  9642. } catch (...) {
  9643. // handle uncaught exceptions
  9644. }
  9645. }
  9646. This has been implemented by replacing %exception directives for specific STL wrapper
  9647. methods with an exception specification declared on the wrapper methods. throws typemaps
  9648. are now supplied for handling the STL exception specification. These can also be easily
  9649. overridden, for example the std::out_of_range exception, which is used a lot in the STL
  9650. wrappers, can be customised easily:
  9651. %include "std_vector.i"
  9652. %typemap(throws) std::out_of_range {
  9653. // custom exception handler
  9654. }
  9655. %template(VectInt) std::vector<int>;
  9656. 07/22/2005: efuzzyone
  9657. [CLISP] The clisp module for SWIG:
  9658. - It can only handle C, clisp currently does not supports ffi bindings to C++.
  9659. - It has two options, (a) -extern-all this will generate wrappers for all functions
  9660. and variablestions, (b) -generate-typedef this will generate wrappers "def-c-type"
  9661. wrappers for typedefs
  9662. - Can handle pointers to functions, complex types such as n-dimensional arrays of
  9663. pointers of depth d
  9664. - Generates wrappers for constants as well as variables
  9665. - Correctly distinguishes between the declaration of variables in structures and functions
  9666. - Creates a defpackage "declaration" with the module name as the package name, the created
  9667. package exports both functions and variables
  9668. - tries to guess when should a pointer variable be declared as c-ptr or c-pointer
  9669. 07/22/2005: wsfulton
  9670. [C#] Changes to support C# structs returned by value. The changes required are:
  9671. - Using an optional 'null' attribute in the out typemap. If this attribute is specified,
  9672. then it is used for the $null special variable substitution.
  9673. - The ctype used in the C/C++ wrappers is no longer initialised to 0 on declaration.
  9674. Both of these changes fix the situations where an attempt was made to assign 0 to the
  9675. returned struct. Marshalling structs as value types still requires user defined typemaps.
  9676. See documentation for an example.
  9677. 07/22/2005: wsfulton
  9678. [C#, Java] Fix SWIG_exception usage to work with compilers that don't support empty macro
  9679. arguments. Unfortunately this fix will stop usage of SWIG_exception being used within typemaps
  9680. that use "" or %{ %} delimiters, but continues to work with typemaps using {} delimiters.
  9681. Please use the SWIG_CSharpSetPendingExceptionArgument or SWIG_JavaThrowException methods instead
  9682. as SWIG_exception is really intended as a platform independent macro for the SWIG library writers.
  9683. 07/16/2005: mkoeppe
  9684. [Allegro CL] Use specific foreign types rather than (* :void).
  9685. Use *swig-identifier-converter*.
  9686. 06/27/2005: wsfulton
  9687. Functions declared as 'extern' no longer have an additional function declaration added to the
  9688. wrapper files. There are some cases where SWIG does not get this right, eg bug #1205859 (extern
  9689. functions with default arguments declared in a namespace). Also SWIG cannot get non-standard
  9690. calling conventions correct, eg Windows calling conventions are usually handled like this:
  9691. %{
  9692. #define DLLIMPORT __declspec(dllimport)
  9693. #define STDCALL __stdcall
  9694. %}
  9695. #define DLLIMPORT
  9696. #define STDCALL
  9697. %inline %{
  9698. DLLIMPORT extern STDCALL void function(int);
  9699. %}
  9700. SWIG incorrectly generates:
  9701. extern void function(int);
  9702. To which there is no solution as SWIG doesn't handle non-standard calling conventions. The extra
  9703. 'extern' function that SWIG generates is superfluous unless a user has forgotten to add the function
  9704. declaration into the wrappers.
  9705. The -noextern commandline argument is now redundant and a new commandline argument -addextern can
  9706. be used to obtain the original behaviour. This shouldn't be necessary unless the header file
  9707. containing the function declaration was inadvertently not added to the wrappers. To fix this
  9708. add the function declaration into your wrappers, For example, replace:
  9709. extern void foo(int);
  9710. with:
  9711. %inline %{
  9712. extern void foo(int);
  9713. %}
  9714. *** POTENTIAL INCOMPATIBILITY ***
  9715. 06/22/2005: wsfulton
  9716. [C#, Java, Modula3, Ocaml]
  9717. The intermediary function names have been changed when wrapping variables to
  9718. match the other language modules so that %extend for a member variable works
  9719. uniformly across all language modules, eg:
  9720. %extend ExtendMe {
  9721. Var;
  9722. };
  9723. %{
  9724. void ExtendMe_Var_set(ExtendMe *, double) {...}
  9725. double ExtendMe_Var_get(ExtendMe *) {...}
  9726. %}
  9727. The methods implementing the get/set used to be:
  9728. %{
  9729. void set_ExtendMe_Var(ExtendMe *, double) {...}
  9730. double get_ExtendMe_Var(ExtendMe *) {...}
  9731. %}
  9732. This also changes the name of variable wrapper functions when using -noproxy.
  9733. The original names can be generated with the -oldvarnames commandline option.
  9734. *** POTENTIAL INCOMPATIBILITY ***
  9735. Version 1.3.25 (June 11, 2005)
  9736. ==============================
  9737. 06/11/2006: mkoeppe
  9738. [Guile] Fix handling of anonymous-enum variables.
  9739. 06/10/2005: mkoeppe
  9740. [Guile] Fix for function arguments that are passed by
  9741. copy-of-value. Fix for global "const char *" variables.
  9742. Fix testcases arrays_dimensionless, arrays_global.
  9743. 06/08/2005: wsfulton
  9744. Fix for when a base class defines a symbol as a member variable and a derived class defines
  9745. the same symbol as a member method.
  9746. 06/08/2005: wsfulton
  9747. [C#] More fixes for virtual/new/override modifiers - when a method has protected access
  9748. in base and public access in derived class.
  9749. 06/02/2005: wsfulton
  9750. Fix #1066363 - Follow convention of release tarball name matching directory name.
  9751. 06/02/2005: wsfulton
  9752. [C#, Java] Fix #1211353 - typesafe enums (and Java proper enums) wrappers when enum value
  9753. is negative.
  9754. 05/27/2005: wsfulton
  9755. Modernised and tidied up Windows macros --> SWIGEXPORT, SWIGSTDCALL. They can be overridden
  9756. by users via -D compiler directives if need be.
  9757. 05/26/2005: wsfulton
  9758. %csmethodmodifiers can be applied to variables as well as methods now.
  9759. In addition to the default 'public' modifier that SWIG generates, %csmethodmodifiers will also
  9760. replace the virtual/new/override modifiers that SWIG thinks is appropriate. This feature is
  9761. useful for some obscure cases where SWIG might get the modifiers incorrect, for example
  9762. with multiple inheritance and overriding a method in the base class.
  9763. *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
  9764. 05/25/2005: wsfulton
  9765. Added missing constructors to std::pair wrappers (std_pair.i) for all languages.
  9766. 05/25/2005: wsfulton
  9767. [C#] Added std::pair wrappers in std_pair.i
  9768. 05/25/2005: wsfulton
  9769. [C#] The C# 'new' and 'override' modifiers will be generated when a C++ class inherits methods
  9770. via a C++ 'using' declaration.
  9771. 05/25/2005: wsfulton
  9772. Fix for exception specifications previously being ignored in classes that inherited methods
  9773. from 'using' declarations, eg calls to Derived::bar below will convert C++ exceptions into
  9774. a target language exception/error, like it always has done for Base::Bar.
  9775. class Base {
  9776. virtual bar() throw (std::string);
  9777. };
  9778. class Derived : public Base {
  9779. using Base::bar;
  9780. };
  9781. 05/23/2005: wsfulton
  9782. Fixes for detecting virtual methods in %extend for the -fvirtual option and C# override and new
  9783. method modifiers.
  9784. 05/23/2005: wsfulton
  9785. [C#] The 'new' modifier is now generated on the proxy method when a method in a derived
  9786. class is not polymorphic and the same method exists in the derived class (ie it hides
  9787. the base class' non-virtual method).
  9788. 05/23/2005: wsfulton
  9789. [Java, C#] Fixes to detection of covariant return types - when the class hierarchy is more
  9790. than 2 classes deep.
  9791. 05/21/2005: wsfulton
  9792. [Java] std::wstring typemaps moved from std_string.i to std_wstring.i
  9793. 05/21/2005: wsfulton
  9794. Fix for crash in DohStrstr, bug #1190921
  9795. 05/21/2005: wsfulton
  9796. [TCL] Fix for methods with similar names when showing list of names on error - bug #1191828.
  9797. Patch from Jeroen Dobbelaere.
  9798. 05/21/2005: wsfulton
  9799. [TCL] long long overloading fix - bug #1191835, patch from Jeroen Dobbelaere.
  9800. 05/21/2005: wsfulton
  9801. Fix bug #1196755 to remove debug from swigtcl8.swg.
  9802. 05/19/2005: wsfulton
  9803. [C# and -fvirtual option] Fix for the override key not being generated in the derived class when a
  9804. virtual method's return type was a typedef in either the base or derived class. Also ensures the
  9805. method is eliminated when using the -fvirtual option. For example, Derived.method now has the C#
  9806. override keyword generated:
  9807. typedef int* IntegerPtr;
  9808. struct Base {
  9809. virtual IntegerPtr method();
  9810. };
  9811. struct Derived : Base {
  9812. int * method() const;
  9813. };
  9814. [C#] Fix for the override key being incorrectly generated for virtual methods when a base class
  9815. is ignored with %ignore.
  9816. 05/13/2005: wsfulton
  9817. [Java] Fixes to remove "dereferencing type-punned pointer will break strict-aliasing rules"
  9818. warnings in C wrappers when compiling C code with 'gcc -Wall -fstrict-aliasing'. Patch from
  9819. Michael Cahill. This modifies many of the casts slightly, for example
  9820. arg1 = *(DB_ENV **)&jarg1;
  9821. to
  9822. arg1 = *(DB_ENV **)(void *)&jarg1;
  9823. 05/12/2005: wsfulton
  9824. [C#] Support for C# attributes. C# attributes can be generated:
  9825. 1) On a C/C++ type basis by specifying an inattributes and/or outattributes typemap attribute
  9826. in the imtype or cstype typemaps (for C# return type or C# parameter type attributes).
  9827. 2) On a wrapped method or variable by specifying a csattributes feature (%feature).
  9828. 3) On a wrapped proxy class or enum by specifying a csattributes typemap.
  9829. Examples are in the C# documentation (CSharp.html).
  9830. 04/29/2005: wsfulton
  9831. New configure option to turn off the default maximum compiler warning as
  9832. they couldn't be removed even when overriding CFLAGS and CXXFLAGS with configure
  9833. (./configure CFLAGS= CXXFLAGS=). To turn the maximum warnings off, run:
  9834. ./configure --without-maximum-compile-warnings
  9835. 04/28/2005: wsfulton
  9836. Patch from Scott Michel which reworks the Java constructor and finalize/destructor typemaps,
  9837. for directors to reduce the number of overall Java typemaps. Added the director_take and
  9838. director_release typemaps to emulate other modules' __disown__ functionality.
  9839. *** POTENTIAL INCOMPATIBILITY FOR JAVA DIRECTORS ***
  9840. 04/28/2005: wsfulton
  9841. [C#] Fixed problems due to the over eager garbage collector. Occasionally the
  9842. garbage collector would collect a C# proxy class instance while it was being used
  9843. in unmanaged code if the object was passed as a parameter to a wrapped function.
  9844. Needless to say this caused havoc as the C# proxy class calls the C++ destructor
  9845. when it is collected. Proxy classes and type wrapper classes now use a HandleRef,
  9846. which holds an IntPtr, instead of a plain IntPtr to marshal the C++ pointer to unmanaged
  9847. code. There doesn't appear to be any performance degradation as a result of this
  9848. modification.
  9849. The changes are in the proxy and type wrapper classes. The swigCPtr is now of type HandleRef
  9850. instead of IntPtr and consequently the getCPtr method return type has also changed. The net
  9851. effect is that any custom written typemaps might have to be modified to suite. Affected users
  9852. should note that the implementation uses the new 'out' attribute in the imtype typemap as the
  9853. input type is now a HandleRef and the output type is still an IntPtr.
  9854. *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
  9855. 04/28/2005: wsfulton
  9856. [C#] Support for asymmetric type marshalling added. Sometimes the output type needs to be
  9857. different to the input type. Support for this comes in the form of a new optional 'out'
  9858. attribute for the ctype, imtype and cstype typemaps. If this typemap attribute is not
  9859. specified, then the type used for both input and output is the type specified in the
  9860. typemap, as has always previously been the case. If this typemap attribute is specified,
  9861. then the type specified in the attribute is used for output types and the type specified
  9862. in the typemap itself is used for the input type. An output type is a return value from
  9863. a wrapped method or wrapped constant and an input type is a parameter in a wrapped method.
  9864. An example shows that char * could be marshalled in different ways,
  9865. %typemap(imtype, out="IntPtr") char * "string"
  9866. char * function(char *);
  9867. The output type is thus IntPtr and the input type is string. The resulting intermediary C# code is:
  9868. public static extern IntPtr function(string jarg1);
  9869. 04/22/2005: mkoeppe (Matthias Koeppe)
  9870. [Guile] Fix generation of "define-method" for methods of
  9871. classes with a constructor. Reported by Luigi Ballabio.
  9872. 04/15/2005: wuzzeb (John Lenz)
  9873. [Chicken]
  9874. For wrapped functions that return multiple values (using argout),
  9875. SWIG CHICKEN now returns them as multiple values instead of as
  9876. a list. They can then be accessed using (call-with-values).
  9877. 04/14/2005: wuzzeb (John Lenz)
  9878. [Chicken]
  9879. + Added a whole bunch of new _runme scripts into the chicken test
  9880. suite. Also fix some bugs these new scripts turned up.
  9881. + Added optimization when returning a wrapped proxy class. Before,
  9882. a minor garbage collection was invoked every time a function returned.
  9883. + All the chicken Examples should now run correctly
  9884. 04/14/2005: wsfulton
  9885. [C#] More fixes for typemap matching when wrapping variables, in particular
  9886. std::string, so that std::string variables can be easily marshalled with
  9887. a C# string property using:
  9888. %include "std_string.i"
  9889. %apply const std::string & { std::string *variable_name };
  9890. std::string variable_name;
  9891. (Recall that all class variables are wrapped using pointers)
  9892. 04/05/2005: wuzzeb (John Lenz)
  9893. [Chicken]
  9894. + Added Examples/chicken/egg, an example on how to build a chicken
  9895. extension library in the form of an egg. Also updated the
  9896. documentation on the different linking options.
  9897. + chicken test-suite now has support to check SWIG with the -proxy
  9898. argument if there exists a _proxy_runme.ss file.
  9899. + More fixes for overloaded functions and -proxy
  9900. 03/31/2005: wsfulton
  9901. Turned on extra template features for all languages which were
  9902. previously only available to Python.
  9903. This enables typemaps defined within a templated class to be used as
  9904. expected. Requires %template on the templated class, %template() will
  9905. also pick up the typemaps. Example:
  9906. template <typename T> struct Foo {
  9907. ...
  9908. %typemap(in) Foo "in typemap for Foo<T> "
  9909. or
  9910. %typemap(in) Foo<T> "in typemap for Foo<T> "
  9911. };
  9912. %template(Foo_i) Foo<int>;
  9913. %template() Foo<double>;
  9914. will generate the proper 'in' typemaps wherever Foo<int> and Foo<double>
  9915. are used.
  9916. 03/30/2005: mkoeppe (Matthias Koeppe)
  9917. [MzScheme] Patch from Hans Oesterholt for supporting MzScheme 30x.
  9918. 03/29/2005: wuzzeb (John Lenz)
  9919. [Chicken]
  9920. + Reallow older versions of chicken (1.40 to 1.89) by passing -nocollection
  9921. argument to SWIG
  9922. + %import now works correctly with tinyclos. (declare (uses ...)) will be
  9923. exported correctly.
  9924. + TinyCLOS proxy classes now work correctly with overloaded functions
  9925. and constructors.
  9926. 03/29/2005: wsfulton
  9927. [Java] Patch from Scott Michel for directorout typemaps. Java directors
  9928. require the directorout typemaps like the other languages now. The new
  9929. typemaps provide fixes for methods where the return type is returned
  9930. by reference (this cannot automatically be made thread safe though).
  9931. 03/22/2005: wsfulton
  9932. Enum casting fixes. Visual C++ didn't like the C type casting SWIG produced
  9933. when wrapping C++ enum references, as reported by Admire Kandawasvika.
  9934. 03/21/2005: wsfulton
  9935. [Perl] SF #1124490. Fix Perl macro clashes when using Visual Studio's STL string,
  9936. so now projects can #include <string>.
  9937. 03/21/2005: wsfulton
  9938. Fixed %varargs which got broken with the recent default argument changes.
  9939. Also works for Java and C# for the first time now.
  9940. 03/17/2005: wuzzeb (John Lenz)
  9941. [Chicken]
  9942. + Fix a whole bunch of bugs in the chicken module. The entire
  9943. test suite now compiles, with the exception of the tests that require
  9944. std_vector.i, std_deque.i, and so on, which chicken does not have yet.
  9945. + Add support for %exception and %typemap(exceptions). Exceptions are
  9946. thrown with a call to (abort) and can be handled by (handle-exceptions)
  9947. 03/15/2005: wsfulton
  9948. [Java] Patch from Scott Michel for directors. Modifications to the typemaps
  9949. giving users fine control over memory ownership and lifetime of director classes.
  9950. Director classes no longer live forever by default as they are now collectable
  9951. by the GC.
  9952. 03/15/2005: wuzzeb (John Lenz)
  9953. [Chicken] Add support for adding finalizers garbage collected objects.
  9954. Functions that return new objects should be marked with %newobject and
  9955. input arguments which consume (or take ownership) of a pointer should
  9956. be marked with the DISOWN typemap.
  9957. Also add support for correctly checking the number of arguments passed
  9958. to a function, and raising an error if the wrong number are passed.
  9959. 03/14/2005: wuzzeb (John Lenz)
  9960. Add --without-alllang option to configure.in, which is the same as
  9961. passing all the --without-python --without-perl5 etc... that Matthias added.
  9962. 03/09/2005: wsfulton
  9963. [Php] Memory leak fix for functions returning classes/structs by value.
  9964. 03/08/2005: wsfulton
  9965. [Perl] Fix for Perl incorrectly taking memory ownership for return types that
  9966. are typedefs to a struct/class pointer. Reported by Josh Cherry.
  9967. 03/07/2005: wsfulton
  9968. [C#] Various exception changes for the std::vector wrappers. These now more
  9969. accurately mirror the same exceptions that System.Collections.ArrayList throw.
  9970. 03/07/2005: wsfulton
  9971. [C#] Fix undefined behaviour after any of the std::vector methods
  9972. throw an exception.
  9973. 03/07/2005: wsfulton
  9974. [C#] When null is passed for a C++ reference or value parameter, the
  9975. exception thrown has been corrected to an ArgumentNullException instead
  9976. of NullReferenceException as recommended in the .NET Framework documentation.
  9977. The default throws typemaps turn a C++ exception into an ApplicationException,
  9978. not a SystemException now.
  9979. 03/07/2005: wsfulton
  9980. [C#] Numerous changes in C# exception handling have been made over the past
  9981. few weeks. A summary follows:
  9982. The way in which C++ exceptions are mapped to C# exceptions is quite different.
  9983. The change is to fix C# exceptions so that the C++ exception stack is correctly
  9984. unwound as previously C++ exceptions were being thrown across the C PInvoke layer
  9985. into the managed world.
  9986. New typemap attributes (canthrow and excode) have been introduced to control the
  9987. mapping of C++ to C# exceptions. Essentially a callback into the unmanaged world
  9988. is made to set a pending exception. The exception to throw is stored in thread local
  9989. storage (so the approach is thread-safe). The typemaps are expected to return
  9990. from unmanaged code as soon as the pending exception is set. Any pending exceptions
  9991. are checked for and thrown once managed code starts executing. There should
  9992. be minimal impact on execution speed during normal behaviour. Full details will be
  9993. documented in CSharp.html.
  9994. The SWIG_CSharpThrowException() function has been removed and replaced with the
  9995. SWIG_CSharpSetPendingExceptionArgument() and SWIG_CSharpSetPendingException()
  9996. functions. The original name has been deliberately changed to break old code as
  9997. the old approach was somewhat flawed. Any user defined exceptions that follow the
  9998. same pattern as the old approach should also be fixed.
  9999. Numerous new .NET framework exceptions are now available for easy throwing from
  10000. unmanaged code. The complete list is:
  10001. ApplicationException, ArithmeticException, DivideByZeroException,
  10002. IndexOutOfRangeException, InvalidOperationException, IOException,
  10003. NullReferenceException, OutOfMemoryException, OverflowException,
  10004. SystemException, ArgumentException, ArgumentNullException and
  10005. ArgumentOutOfRangeException.
  10006. *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
  10007. 05/05/2005: mmatus
  10008. Fix several memory leaks around. Even when we survive knowning
  10009. swig is a memory leak factory, it was a little out of
  10010. control. To run std_containers.i in the python test-suite,
  10011. swig was using ~260MB, now it uses 'only' ~40MB, which is
  10012. the same ammount that g++ uses, so, is not that bad.
  10013. In the process, I found a couple of extra Deletes, which
  10014. in some cases could trigger seg. faults and/or
  10015. DOH/asserts.
  10016. [python] Better support for directors + exception. More
  10017. verbose errors and added an unexpected exception handler.
  10018. [python] Fix memory leak for the
  10019. std::vector<std::vector<int> >
  10020. case,reported by Bo Peng.
  10021. [python] Fix SwigPyObject compare problem reporte by
  10022. Cameron Patrick.
  10023. [python] Fix several warnings in the generated code
  10024. for gnu-gcc, Intel and VC7.1 compilers.
  10025. 02/25/2005: wuzzeb (John Lenz)
  10026. Update documentation to use CSS and <div> instead of <blockquote>
  10027. I used a script to convert the docs, and it set all the box classes
  10028. to be "code". There are actually 4 different classes,
  10029. "shell", "code", "targetlang", and "diagram". We need to go through
  10030. and convert the divs depending on what they contain.
  10031. 02/23/2005: mmatus
  10032. [Python] Added option -nortti to disable the use of native
  10033. C++ RTTI with directors (dynamic_cast<> is not used).
  10034. Add more code for directors to detect and report errors in
  10035. the python side.
  10036. Extend the use of SWIGINTERN whenever is possible.
  10037. Remove template warnings reported by VC7.1.
  10038. Remove warnings reported by gcc/g++. Finally you can
  10039. compile using
  10040. g++ -W -Wall -c mymodule_wrap.cxx
  10041. and no spurious errors will be generated in the wrapper
  10042. code.
  10043. 02/23/2005: wuzzeb (John Lenz)
  10044. Added -external-runtime argument. This argument is used to dump
  10045. out all the code needed for external access to the runtime system,
  10046. and it replaces including the files directly. This change adds
  10047. two new virtual functions to the Language class, which are used
  10048. to find the language specific runtime code. I also updated
  10049. all languages that use the runtime to implement these two functions.
  10050. 02/22/2005: mmatus
  10051. Fix %template + private error SF#1099976.
  10052. 02/21/2005: mmatus
  10053. Fix swigrun.swg warnings reported when using "gcc -W -Wall"
  10054. (static/inline not used in front of a function
  10055. declaration), and add SWIGUNUSED attribute to avoid
  10056. unused warnings elsewhere.
  10057. Fix unused variable warnings.
  10058. [Python] Use new SWIGUNUSED attribute to avoid warnings in
  10059. SWIGINTERN methods.
  10060. [Python] Fix PyOS_snprintf for python versions < 2.2 (SF #1104919).
  10061. [Python] Fix map/multimap to allow empty maps (reported by
  10062. Philippe Hetroy).
  10063. [Docs] Add some documentation to Python.html and
  10064. SWIGPlus.html, including for example the fact that
  10065. 'friends' are now supported.
  10066. 02/21/2005: wsfulton
  10067. [PHP] Patch from Olly Betts, so that wrappers compile with Zend thread safety enabled.
  10068. 02/17/2005: wsfulton
  10069. Memory leak fix in some of the scripting language modules when using default
  10070. arguments in constructors. The scripting language was not taking ownership of the
  10071. C++ object memory when any of the constructors that use default arguments was called.
  10072. 02/16/2005: wsfulton
  10073. SF #1115055: Failed make install. Patch from Rob Stone.
  10074. 02/16/2005: wsfulton
  10075. [Java] SF #1123416 from Paul Moore. Correct memory allocation for STRINGARRAY
  10076. typemaps in various.i.
  10077. 02/15/2005: wsfulton
  10078. Disabled typemap search changes for now (see entry 19/12/2004). It breaks
  10079. old typemaps, lengthens the execution time by about 25% and introduces
  10080. inconsistencies.
  10081. 02/15/2005: wsfulton
  10082. swig -help follows other software by printing to stdout instead of stderr now.
  10083. swig -version also displays to stdout instead of stderr now.
  10084. Behaviour reported by Torsten Landschoff.
  10085. 02/15/2005: wsfulton
  10086. [Ruby] Fix for the less commonly used ordering of %include and #include, so
  10087. that the generated code compiles. Bug reported by reported by Max Bowsher.
  10088. %include foo.h
  10089. %{
  10090. #include foo.h
  10091. %}
  10092. 02/15/2005: wsfulton
  10093. [C#, Java] SWIG_exception macro will now return from unmanaged code / native code
  10094. as soon as it is called. Fixes possible JVM crashes and other code unexpectedly
  10095. being executed. Note SWIG_exception is only occasionally used by SWIG library
  10096. writers, and is best avoided by SWIG users.
  10097. 02/15/2005: wsfulton
  10098. [C#, Java] Typemaps can now be targeted at global variable names
  10099. and static member variable names. Previously the typemaps for
  10100. the setters were ignored, for example:
  10101. %typemap(in) int globalint "..."
  10102. int globalint;
  10103. 02/13/2005: mkoeppe (Matthias Koeppe)
  10104. [Guile] Add %typecheck for SWIGTYPE, add %typecheck for ptrdiff_t, fix
  10105. typemaps for size_t.
  10106. [Pike] Merge patch from Torsten Landschoff for improved Pike configuration.
  10107. 02/12/2005: mkoeppe (Matthias Koeppe)
  10108. New configure switches --without-tcl, --without-python etc. allow to
  10109. disable the search for installed languages.
  10110. 01/31/2005: wuzzeb (John Lenz)
  10111. - Add DohSortList to DOH
  10112. - Improve the runtime type system:
  10113. + Speed. Type loading is now O(n log n) instead of O(N^2), which
  10114. for large modules is a huge improvement.
  10115. + A whole bunch of functions in swigrun.swg no longer need the
  10116. swig_type_list_handle passed to them. The only one left is
  10117. TypeQuery. This also makes runtime.swg a lot smaller.
  10118. + Split up swig_type_info structure into two structures
  10119. (swig_type_info and swig_cast_info)
  10120. + Store a pointer to a swig_type_info rather than just the type
  10121. name string in the linked list of casts. First off, this makes
  10122. the guile module a little faster, and second, the
  10123. SWIG_TypeClientData() function is faster too.
  10124. + Add the idea of a module into the type system. Before, all the
  10125. types were stored in one huge linked list. Now, another level is
  10126. added, and the type system stores a linked list of modules, each
  10127. of which stores an array of types associated with it.
  10128. + For more information of how the runtime type system now works,
  10129. please see Doc/Manual/typemaps.html and Doc/Devel/runtime.txt
  10130. - Update all language modules to use the new type system. The changes
  10131. to each language module are minor. All languages are now able to
  10132. use runtime.swg for external access to the type system. Before
  10133. only python and perl did.
  10134. - [guile, mzscheme, ocaml, and php4] These languages opened up the
  10135. init function inside the .cxx code, and any code in the .swg files
  10136. in the init section was inside this function. This was a problem
  10137. for swiginit.swg, which needs to be inserted before the SWIG_init
  10138. function is opened. Thus I changed these languages to be like
  10139. python or perl, where the init function is declared in the .swg
  10140. file.
  10141. - [Ruby] Instead of moving the init function to the .swg file, I
  10142. added a new section initbeforefunc, and then added
  10143. %insert(initbeforefunc) "swiginit.swg"
  10144. - [MzScheme] Fix enums and fix Examples/Makefile.in so that if
  10145. multiple -I arguments are specified in the INCLUDES variable, each
  10146. gets a ++ccf.
  10147. - [Guile GH] Update Guile GH to use the new type system. See
  10148. Doc/Manual/Guile.html for how smobs are now used.
  10149. 01/11/2005: wsfulton
  10150. [C#] New typemap called 'csconstruct'. The code in this typemaps was previously hard
  10151. coded and could not be customised by a user. This typemap contains the code that is
  10152. generated into a proxy class's constructor.
  10153. [Java] New typemap called 'javaconstruct'. The code in this typemaps was previously hard
  10154. coded and could not be customised by a user. This typemap contains the code that is
  10155. generated into a proxy class's constructor. Another typemap named 'javaconstruct_director'
  10156. is used instead when the proxy class is a director class.
  10157. [C#, Java] If a C++ class did not have a default constructor, a protected default constructor
  10158. was automatically generated by SWIG. This seems is unnecessary and has been removed
  10159. and thereby giving the user almost complete control over the generated code along with the
  10160. new typemaps above.
  10161. 19/12/2004: mmatus
  10162. [Disabled, see entry 02/15/2004]
  10163. - Fix typemap search, now the "out" typemap search is done as follows
  10164. int *Foo::foo(int bar) -> int *Foo::foo(int bar)
  10165. -> int *Foo::foo
  10166. -> int *foo(int bar)
  10167. -> int *foo
  10168. -> int *
  10169. then, now you can be more specific, and define
  10170. /* apply only for 'Foo::foo' method */
  10171. %typemap(out) int * Foo::foo(int *bar) ...;
  10172. /* apply for all 'foo' functions/methods */
  10173. %typemap(out) int * foo(int *bar) ...;
  10174. %inline {
  10175. struct Foo {
  10176. int *foo(int *bar);
  10177. };
  10178. }
  10179. 15/12/2004: mmatus
  10180. - More fixes for templates and template default args.
  10181. See template_default.i for scary cases that now are
  10182. supported, besides the already ugly STL/std cases.
  10183. - Cosmetics and more use of 'const' where it was implicit.
  10184. - Other fixes for OSS, which is now working again with 1.3.25.
  10185. Version 1.3.24 (December 14, 2004)
  10186. ==================================
  10187. 12/12/2004: wuzzeb (John Lenz)
  10188. [Chicken] Fix a bunch of bugs relating to -proxy support
  10189. + non-class variables now export properly using -proxy
  10190. + static member functions now export properly using -proxy
  10191. + member class variables now export properly using -proxy
  10192. + added a -nounit argument, which does not export the (declare (unit ...))
  10193. + correctly install swigclosprefix.scm
  10194. + constants (enums, defines) now correcly export when using -proxy
  10195. 12/11/2004: wsfulton
  10196. configure fix for when more than one version of jni_md.h is found
  10197. in the Java include directory (was generating lots of sed error
  10198. messages).
  10199. 12/08/2004: wsfulton
  10200. [Java] Fixes to arrays_java.i so that one can apply the array
  10201. typemaps to functions taking pointers as input, eg
  10202. %include "arrays_java.i"
  10203. %apply int[] {int*};
  10204. void foo(int *a);
  10205. 12/05/2004: wsfulton
  10206. [Java] Director mods contributed by Scott Michel. New typemaps
  10207. directordisconnect and directordisconnect_derived for the
  10208. swigDirectorDisconnect() method. Also fix to get the javapackage
  10209. typemap working again.
  10210. 12/05/2004: mmatus
  10211. - Finishing the fixes for templates + default template
  10212. args + specializations.
  10213. - [Python] Now we use the new templates + default template
  10214. args in the std/STL library. That means the internal
  10215. swig files are getting uglier since we now support the
  10216. original declarations:
  10217. template<class _Tp, class _Alloc = std::allocator< _Tp > >
  10218. class vector {
  10219. ....
  10220. };
  10221. template<class _Key, class _Tp, class _Compare = std::less<_Key >,
  10222. class _Alloc = std::allocator<std::pair<const _Key, _Tp > > >
  10223. class map {
  10224. ....
  10225. };
  10226. and the user can use the %template directive as
  10227. %template() std::vector<int>;
  10228. %template() std::vector<int, std::allocator<int> >;
  10229. %template() std::vector<int, MyAllocator<int> >;
  10230. Now we are closer to the cleaning/rewriting of the
  10231. python std/STL support, such that we recover support for
  10232. MSVC++ 6.0, and we can add support for other languages
  10233. too.
  10234. 12/02/2004: wsfulton
  10235. [Java] Fix for directors when wrapping methods using a member enum
  10236. and typesafe/proper enums enabled.
  10237. 12/01/2004: mmatus
  10238. - Fix typemaps to work with templates and default template
  10239. args, ie
  10240. template <class A, class B = int>
  10241. struct Foo {
  10242. };
  10243. %typemap(in) Foo<int> *{...}
  10244. %typemap(out) Foo<int,int> *{...}
  10245. Foo<int> * foo( Foo<int> *f1, Foo<int,int> *f2);
  10246. now 'f1', 'f2' and the return value resolve the provided
  10247. typemaps properly.
  10248. This is highly needed for proper STL support, see new
  10249. std_basic_string.i, std_sstream.i, etc.
  10250. - Added std_sstream.i, and fix std_basic_string.i to use
  10251. the new typemaps + template def. arg mechanism. Also,
  10252. added the needed std_alloc.i. Now, all the containers
  10253. can be modified to support std::allocator, like in:
  10254. template<class T, class A = std::allocator<T > >
  10255. class vector {
  10256. public:
  10257. ....
  10258. };
  10259. This change is only completed by now for basic_string.
  10260. - Fix for smart pointers + members + extensions:
  10261. %extend Foo {
  10262. int extension(int i, int j) { return i; }
  10263. int extension() { return 1; }
  10264. }
  10265. %inline %{
  10266. class Foo {
  10267. public:
  10268. int y;
  10269. static const int z;
  10270. };
  10271. class Bar {
  10272. Foo *f;
  10273. public:
  10274. Bar(Foo *f) : f(f) { }
  10275. Foo *operator->() {
  10276. return f;
  10277. }
  10278. };
  10279. now you can
  10280. f = Foo()
  10281. f.y = 3
  10282. a = f.z
  10283. f->extension()
  10284. b = Bar(f)
  10285. b.y = 3
  10286. a = b.z
  10287. b->extension()
  10288. - Other small errors fixes, mostly python.
  10289. 11/25/2004: wsfulton
  10290. [Java] Numerous director bug fixes so that the correct java types
  10291. and canonicalized types in the JNI code are emitted. Use of the
  10292. $javaclassname special variables in the director typemaps now
  10293. consistent with the non-director typemaps. The types used for
  10294. typemap lookups are also corrected in a few places. If you
  10295. previously had your own director typemaps, ensure they are using the
  10296. correct C++ type.
  10297. *** POTENTIAL INCOMPATIBILITY FOR JAVA DIRECTORS ***
  10298. 11/25/2004: wsfulton
  10299. const enum SWIGTYPE & typemaps added. These wrap const enum references
  10300. as if they were passed by value. Const enum references thus work the
  10301. same as const reference primitive types such as const double &,
  10302. const int & etc. Typemaps added for Java, C#, Ruby, Tcl, Perl and Pike.
  10303. 11/25/2004: wsfulton
  10304. [Java, C#] New special variable: $*javaclassname, similar to $javaclassname
  10305. and $&javaclassname. The new one removes a pointer from the C type before
  10306. obtaining the Java class name. One or more of $javaclassname,
  10307. $&javaclassname or $*javaclassname may now appear in a typemap. Likewise for
  10308. C# using csclassname instead of javaclassname.
  10309. 11/25/2004: wsfulton
  10310. The last vestiges of enums being handled as integers removed from the
  10311. internals. The wrapper methods use the enum type rather than an int
  10312. now. The net result is added type safety for enums when handled as
  10313. pointers, references etc. Previously in situations such as a method
  10314. taking a pointer to an enum, a pointer to an int or a pointer to an
  10315. enum of some other type could inadvertantly be passed to the method.
  10316. This is now fixed as the descriptor for an enum is no longer based on
  10317. an int, but the enum type instead. Anonymous enums are still handled
  10318. as integers.
  10319. The consequence for scripting language users in correct usage of enums
  10320. should not be noticeable. There is no change for any of the languages
  10321. where enums are passed by value - most of the scripting languages will
  10322. still accept an integer for an enum value and the strongly typed
  10323. languages still use either typesafe enums, integers or proper enums
  10324. depending on what the user configures. For Java and C# users a change
  10325. in the typewrapper class name has occurred (for enum pointers,
  10326. references etc). For example:
  10327. enum Numbers { one=1, two };
  10328. enum Numbers* number();
  10329. In Java and C# this must now be coded as
  10330. SWIGTYPE_p_Numbers n = modulename.number();
  10331. rather than
  10332. SWIGTYPE_p_int n = modulename.number();
  10333. *** POTENTIAL INCOMPATIBILITY ***
  10334. 11/21/2004: wsfulton/mmatus
  10335. Added missing deprecated warning for %name and remove remaining %name
  10336. usage in the SWIG libraries.
  10337. 11/21/04: mmatus
  10338. - [Python] Adding the PySwigObject to be used for carrying
  10339. the instance C/C++ pointers. This is used instead of
  10340. string and PyCObjects.
  10341. The new PySwigObject is even safer than PyCObject, and
  10342. more friendly than plain strings:
  10343. now you can do
  10344. print a.this
  10345. <Swig Object at _00691608_p_A>
  10346. print str(a.this)
  10347. _00691608_p_A
  10348. print long(a.this)
  10349. 135686400
  10350. print "%s 0x%x" % (a.this, a.this)
  10351. _00691608_p_A 0x8166900
  10352. the last one is very useful when debugging the C/C++
  10353. side, since is the pointer value you will usually get
  10354. from the debugger.
  10355. Also, if you have some old code that uses the string
  10356. representation "_00691608_p_A", you can use it now again
  10357. using 'str(ptr)', or by calling 'str = PyObject_Str(obj)'
  10358. in the C/C++ side.
  10359. This change is mainly for nostalgic swig users that miss
  10360. the string representation, but also allows to say again
  10361. if a.this == b.this:
  10362. return "a is b"
  10363. and well, since the change were really simple, maybe in
  10364. the future we will be able to do
  10365. next = a.this + 1
  10366. or add native python iteration over native C/C++ arrays,
  10367. ie, no need to create/copy new tuples when returning and
  10368. array or vector.
  10369. Also, a PySwigPacked object was adding to carry a member
  10370. method pointer, but this is probably a temporal solution
  10371. until a more general object for methods is added.
  10372. Be aware that to simplify maintaining and compatibility
  10373. with other tools, the old string and PyCObjects
  10374. representation could disappear very soon, and the
  10375. SWIG_COBJECTS_TYPES or SWIG_NO_OBJECT_TYPES macros will
  10376. have no effect at compilation time. Still, the three
  10377. mechanisms are present in the code just for testing,
  10378. debugging and comparison purposes.
  10379. 11/21/04: mmatus
  10380. - [Python] Adding back support for using the swig runtime code
  10381. inside the user code. We just allow the user to include
  10382. the minimal code needed to implement the runtime
  10383. mechanism statically, just as in done in the swig
  10384. modules.
  10385. To use the swig runtime code, for example with python,
  10386. the user needs include the following:
  10387. #include <Python.h> // or using your favorite language
  10388. #include <swigrun.swg>
  10389. #include <python/pyrun.swg> // or using your favorite language
  10390. #include <runtime.swg>
  10391. the files swigrun.swg, pyrun.swg and runtime.swg can
  10392. be checked out by using swig -co, or they can simply
  10393. be found by adding the swig lib directory to the
  10394. compiler include directory list, for example
  10395. SWIGLIB=`swig -swiglib`
  10396. c++ -I${SWIGLIB} ..
  10397. of better, using the CPPFLAGS, but that depends on your
  10398. environment.
  10399. This change can be ported to the other languages too,
  10400. you just need to isolate the needed runtime code in
  10401. a single file like 'pyrun.swg', and provide the
  10402. SWIG_Runtime_GetTypeList() method. Look at the
  10403. Lib/python/pyrun.swg file and the Examples/python/swigrun
  10404. example.
  10405. 11/15/04: mmatus
  10406. - Fix mixed_types.i + gcc-3.4, ie, arrays + references +
  10407. typedefs
  10408. - Fix multidim arrays + typedefs,ie
  10409. typedef char character[1];
  10410. typedef character word[64];
  10411. - Process protected/private bases in the same way before
  10412. we process protected/private members, ie, we check
  10413. for constructors, operator new, virtual members, etc.
  10414. - Fix Ruby/Java to work (or ignore) multi-inheritance +
  10415. directors. Allow other languages to define if it is
  10416. supported or not.
  10417. - Now you can run
  10418. SWIG_FEATURES="-directors -dirprot"
  10419. make check-ruby-test-suite
  10420. make check-python-test-suite
  10421. make check-java-test-suite
  10422. make check-ocaml-test-suite
  10423. and you will get only 'real' errors. ruby and python
  10424. compile with no errors, java shows some problems.
  10425. Version 1.3.23 (November 11, 2004)
  10426. ==================================
  10427. 11/05/2004: wsfulton
  10428. Patch #982753 from Fabrice Salvaire: Adds dependencies generation for
  10429. constructing makefiles. New command line options -MF -MD -MMD to work
  10430. with the current options -M and -MM. These options are named the same
  10431. and work the same as in gcc.
  10432. 11/05/2004: wsfulton
  10433. %ignore/%rename changes for methods with default arguments to mirror
  10434. %feature behaviour. See previous entry.
  10435. *** POTENTIAL INCOMPATIBILITY ***
  10436. 11/04/2004: wsfulton
  10437. %feature improvements for fine tuning when wrapping methods with
  10438. default arguments. Any %feature targeting a method with default arguments
  10439. will apply to all the extra overloaded methods that SWIG generates if the
  10440. default arguments are specified in the feature. If the default arguments are
  10441. not specified in the feature, then the feature will match that exact
  10442. wrapper method only and not the extra overloaded methods that SWIG generates.
  10443. For example:
  10444. %feature("except") hello(int i=0, double d=0.0);
  10445. void hello(int i=0, double d=0.0);
  10446. will apply the feature to all three wrapper methods, that is:
  10447. void hello(int i, double d);
  10448. void hello(int i);
  10449. void hello();
  10450. If the default arguments are not specified in the feature:
  10451. %feature("except") hello(int i, double d);
  10452. void hello(int i=0, double d=0.0);
  10453. then the feature will only apply to this wrapper method:
  10454. void hello(int i, double d);
  10455. and not these wrapper methods:
  10456. void hello(int i);
  10457. void hello();
  10458. This has been introduced to make %feature more powerful to ease the migration
  10459. to new default arguments wrapping approach.
  10460. *** POTENTIAL INCOMPATIBILITY ***
  10461. If you previously had a %feature and didn't specify the default arguments,
  10462. you will have to add them in now or you can obtain the original behaviour
  10463. by using %feature("compactdefaultargs").
  10464. 11/04/2004: wsfulton
  10465. [C#] Typemaps for std::vector added into std_vector.i. The proxy classes
  10466. generated are modelled on the .NET ArrayList class. This isn't quite
  10467. ready for general consumption yet, but will work with vectors of primitive
  10468. types and some classes.
  10469. 10/3/2004: wuzzeb (John Lenz)
  10470. [GUILE] The -scm interface is now the default. The old GH interface can
  10471. still be enabled by passing -gh to SWIG.
  10472. 10/2/2004: mmatus
  10473. - More fixes for namespace + class declarations.
  10474. As an extra bonus, we get %template support for static/members class
  10475. methods, ie, now you can say:
  10476. namespace space {
  10477. struct A
  10478. {
  10479. template <class Y>
  10480. static void fooT(Y y) { }
  10481. };
  10482. }
  10483. struct B
  10484. {
  10485. template <class Y>
  10486. void barT(Y y) {}
  10487. };
  10488. %template(foo) space::A::fooT<double>;
  10489. %template(foo) space::A::fooT<int>;
  10490. %template(foo) space::A::fooT<char>;
  10491. %template(bar) B::barT<double>;
  10492. %template(bar) B::barT<int>;
  10493. %template(bar) B::barT<char>;
  10494. and call
  10495. A.foo(1)
  10496. b = B()
  10497. b.bar(1)
  10498. note the methods are emitted inside the classes,
  10499. and hence, the %template name refers to the 'member'
  10500. method name, not a global namespace name.
  10501. 10/31/2004: mmatus
  10502. - Solve namespace + class declarations, as in
  10503. namespace foo {
  10504. struct Bar;
  10505. struct Foo {
  10506. };
  10507. }
  10508. struct foo::Bar : Foo {
  10509. };
  10510. see namespace_class.i for more examples.
  10511. - Fix %template directive to properly use namespaces,
  10512. including the case:
  10513. namespace one
  10514. {
  10515. template <typename T>
  10516. struct Ptr {};
  10517. }
  10518. namespace one
  10519. {
  10520. struct Obj1 {};
  10521. typedef Ptr<Obj1> Obj1_ptr;
  10522. %template(Obj1_ptr) Ptr<Obj1>;
  10523. }
  10524. namespace two
  10525. {
  10526. struct Obj2 {};
  10527. typedef one::Ptr<Obj2> Obj2_ptr;
  10528. %template(Obj2_ptr) one::Ptr<Obj2>;
  10529. }
  10530. this is done by using the namespace name 'one' to create
  10531. a namespace node to emit the template instantiation,
  10532. just as before, but the template parameters are resolved
  10533. and qualified in the current namespace ('one' or 'two').
  10534. This is same way that typedef works.
  10535. This resolve the smart_pointer_namespace2.i case, and at
  10536. the same time, several other ones where before swig was
  10537. generating the
  10538. "Can't instantiate template 'xx' inside namespace 'yy'"
  10539. error message. In fact, that error doesn't exist
  10540. anymore. You can only get an error if you use a bad
  10541. namespace name or so.
  10542. 10/30/2004: mmatus
  10543. - [ruby] Directors fixes:
  10544. - enums and std::strings are working now (several
  10545. reports in bug track system)
  10546. - added patch 1025861 for director + exceptions
  10547. *** Attention ***: ruby with directors + protected
  10548. members work with version 1.7+. Older versions seems to
  10549. have a broken signature for'rb_protect'.
  10550. If you need to use an old version, look at
  10551. http://excruby.sourceforge.net/docs/html/ruby__hacks_8hpp-source.html
  10552. for workarounds.
  10553. - [ruby] Fix memory allocation problem in typemap (bug 1037259)
  10554. - [tcl] Fix (enums|constants) + namespace option
  10555. (reported by jason.m.surprise@intel.com).
  10556. - [perl] Add patch 962168 for multiple inheretance
  10557. - Fix 'defined' as variable name.
  10558. 10/29/2004: wsfulton
  10559. Seg fault fix for global scope operator used for friend methods:
  10560. class B {
  10561. friend void ::globalscope();
  10562. ...
  10563. };
  10564. 10/28/2004:mmatus
  10565. - Added module and swig option "templatereduce" to force swig
  10566. to reduce any type needed with templates, ie, in these cases
  10567. %module("templatereduce") test
  10568. template <class T> struct A { };
  10569. typedef int Int;
  10570. %template(A_Int) A<Int> ==> %template(A_Int) A<int>
  10571. typedef B* Bp;
  10572. %template(A_Bp) A<Bp> ==> %template(A_Bp) A<B*>
  10573. swig reduces the types Int and Bp to their primitives
  10574. int and B*. This is closer to the usual compiler
  10575. resolution mechanism, and it is really needed sometimes
  10576. when you mix templates + typedefs + specializations.
  10577. Don't use it if you don't have any problem already,
  10578. since the type reduction can interfere with some
  10579. user typemaps, specially if you defined something like
  10580. typedef int Int;
  10581. %typemap(in) Int ...;
  10582. in this case, when you use the "templatereduce" option,
  10583. swig will ignore the user typemap, since the "typedef int Int"
  10584. will take precedence, and the usual "int" typemap will be
  10585. applied.
  10586. Note that the previous case is not common, and should be
  10587. avoided, ie, is not recommended to use a typedef and a
  10588. typemap at the same time, specially if you are going to
  10589. use templates + specializations.
  10590. - Directors:
  10591. virtual destructor is always emitted now, this doesn't
  10592. cause any harm, and could solve some nasty and
  10593. mysterious errors, like the one mentioned by Scott.
  10594. also the destructor is not in-lined, so, that can solve
  10595. some other mysterious errors when mixing directors +
  10596. imports + embedded applications + some specific compilers.
  10597. 10/27/2004: wsfulton
  10598. [C#] typemaps.i library file with INPUT, OUTPUT and INOUT typemaps added.
  10599. 10/27/2004: wsfulton
  10600. [Java] std::wstring typemap fixes in std_string.i from Russell Keith-Magee.
  10601. 10/25/2004: mmatus
  10602. - Using + namespace is working now (using_namespace.i).
  10603. - Derived + nested classes is working now
  10604. (deriver_nested.i), but of course, we are still waiting
  10605. for the nested class support.
  10606. - Directors:
  10607. - unnamed parameters support,
  10608. - protected constructor support (automatic and with
  10609. dirprot mode),
  10610. - detection of really needed protected declarations
  10611. (members and constructors) now is done automatically.
  10612. Even if you don't use the 'dirprot' mode, swig will
  10613. wrap what is minimally needed (and protected) for the
  10614. code to compile.
  10615. what is public, as usual, is always wrapped, and if
  10616. you use the 'dirport'
  10617. - Final fixes for the OSS to compile with SWIG 1.3.23 (my
  10618. very very ugly C++ + templates + everything mounters wrap).
  10619. 10/25/2004: wsfulton
  10620. [C#] New commandline option -dllimport. This enables one to specify
  10621. the name of the DLL for the DllImport attribute. Normally this name
  10622. comes from the module name, so now it is possible to override this:
  10623. swig -csharp -dllimport xyz example.i
  10624. will generate for all the wrapped PInvoke methods:
  10625. [DllImport("xyz", EntryPoint="...")]
  10626. public static extern ...
  10627. The wrappers from many different SWIG invocations can thus be compiled
  10628. into one DLL.
  10629. A new special variable $dllimport can also be used in typemaps, pragmas,
  10630. features etc. This will get translated into the value specified by -dllimport
  10631. if specified, otherwise the module name.
  10632. 10/22/2004: wsfulton
  10633. [Java] Patch #1049496 from Scott Michel fixes directors methods with
  10634. enums when wrapped with typesafe or proper Java enums.
  10635. 10/21/2004: wsfulton
  10636. Fixes for default arguments in director constructors (Python, Ruby, Ocaml).
  10637. 10/21/2004: mmatus
  10638. - [Python] Add the '-cpluscast' option to enable the 'new'
  10639. C++ casting operators, such as 'static_cast', inside the
  10640. typemaps. By default swig use the old C cast style, even
  10641. when parsing C++.
  10642. - [Python] Add the '-new_vwm' option to enable the new
  10643. SwigValueWrapper mode. Now this is mainly for testing
  10644. that the typemaps are really safe for any future
  10645. solution, but you can use it if you have a very strange
  10646. error with default cosntructors missing + %apply +
  10647. %typemap, and if everything else fails (see
  10648. valuwrapper_opaque.i for alternative and current
  10649. solutions). If you are a user that don't know what is
  10650. SwigValueWrapper, don't even try it.
  10651. - [Python] Add the '-noh' option to be used with directors
  10652. and when you prefer to disable the generation of the
  10653. director header file. If not used, swig will work as
  10654. usual generating both the wrap.cxx and wrap.h files. If
  10655. you use it, swig will only generate wrap.cxx.
  10656. 10/21/2004: wuzzeb (John Lenz)
  10657. - If you define SWIG_TYPE_TABLE when compiling a wrapper file,
  10658. the runtime types will be stored in the given type table name.
  10659. Using this, you can seperate different modules to share their
  10660. own type systems. -DSWIG_TYPE_TABLE=Mytable
  10661. - [Python] If you define SWIG_STATIC_RUNTIME then the type information
  10662. will be static to this wrapper. Nothing will be shared with any
  10663. other modules
  10664. - [Python] If you define SWIG_LINK_RUNTIME, then instead of using
  10665. the new way of sharing type information, the wrapper will expect
  10666. to be linked against the Lib/linkruntime.c file. Any modules compiled
  10667. with SWIG_LINK_RUNTIME and linked against linkruntime.c will all
  10668. share type information.
  10669. 10/20/2004: mmatus
  10670. - [Python] Initial fix for python/import example. Please
  10671. update the Makefile (autoconf, configure, etc, expert),
  10672. since now probably is only working with g++, icc and a
  10673. few other compilers that have the -shared option.
  10674. We need to create additional shared libraries for the
  10675. virtual destructors. Old and usually forgotten C++
  10676. requirement.
  10677. Same fix need to be used in perl, I think.
  10678. - [Python] Fix generation of header file for directors,
  10679. now directors.swg is also included, so, it can be really
  10680. used from C++, and it solves some problem with compiler
  10681. that require that, even with the simple swig inclusion.
  10682. - [Python] Reordering the methods and moving some bodies
  10683. outside the class declaration. This is needed due to
  10684. some gcc-2.96 internal compiler errors. It seems the
  10685. PYTHON class is getting too large to been declared and
  10686. defined at the same time.
  10687. - Add the -oh option to change the output header file name
  10688. if needed:
  10689. swig -c++ -python test.i -o test.CC -oh test.HH
  10690. this is mainly needed when using directors, and if the
  10691. current default header file name is not good for you,
  10692. which is generated as follow:
  10693. swig -c++ -python test.i => test_wrap.h
  10694. swig -c++ -python test.i -o test.CC => test.h
  10695. 10/20/2004: wsfulton
  10696. 1) Compact default arguments feature added. This feature allows one
  10697. to use the default argument code generation that was used in
  10698. SWIG-1.3.22 and earlier versions. It produces more compact wrappers
  10699. as only one wrapper method is generated for any method with default
  10700. arguments. So the advantage is it generates less code but has the
  10701. original limitations, like it it does not work with all default arguments
  10702. and default arguments cannot be taken advantage of in the strongly typed
  10703. languages (C# and Java). It is implemented via the usual %feature mechanism:
  10704. %feature("compactdefaultargs");
  10705. 2) Keyword arguments (kwargs) are working again for default arguments
  10706. in the languages that support it, ie, Python and Ruby. The new default
  10707. argument wrapping approach using overloaded methods cannot support kwargs
  10708. so the compact default argument feature is automatically turned on when
  10709. kwargs are specified, by %feature("kwargs").
  10710. 3) Compact default arguments are also automatically turned on when wrapping
  10711. C (not C++) code. This is to support the bizarre notion of default arguments
  10712. for C code.
  10713. 10/20/2004: wsfulton
  10714. Overloaded templated functions in namespaces also working now.
  10715. Templated functions with default arguments in namespaces too.
  10716. 10/19/2004: mmatus
  10717. - Allow to disable the new SwigValueWrapper mechanism,
  10718. if you add the following line in your language main.
  10719. /* Turn on safe value wrapper use mode */
  10720. Swig_value_wrapper_mode(1);
  10721. Now is only active in python. All the other languages
  10722. are using the old resolution, but they can also use the
  10723. "valuewrapper"/"novaluewrapper" features to fix some
  10724. of the old broken cases. Note, however, that not all
  10725. the broken cases can be solved in that way.
  10726. The new mechanism seems to be working fine in perl, ruby
  10727. and tcl, but failing in some typemaps in java.
  10728. Hence, is upto the language maintainer to test it, and
  10729. decide to enable it or not.
  10730. Look at the valuewrapper_opaque.i for examples.
  10731. - Fix more SwigValueWrapper cases when the new mechanism
  10732. is active. Now it also check for local typemap
  10733. variables, see valuewrapper_opaque.i for an example when
  10734. this is needed. But again, this extra checking will only
  10735. be activated when using the new value wrapper mode.
  10736. - [Python] Fix variable wrapping of classes with private
  10737. assign operators. It should be easy to fix in all the
  10738. other modules, instead of checking
  10739. if (!Getattr(n,"immutable")) ...
  10740. you need to verify
  10741. if (is_assignable(n)) ...
  10742. Look at the private_assign.i for an example.
  10743. 10/18/2004: mmatus
  10744. - %features "director"/"nodirector" now work as expected.
  10745. - General fixes in %feature to resolve function decl
  10746. properly,
  10747. %feature("hello") foo();
  10748. char foo() -> f() // was working
  10749. char *foo() -> f().p // it wasn't
  10750. - Template + specialization + default template args now is
  10751. working, (don't confuse with template + default arg
  10752. values, that was solved before), now this ugly case is
  10753. working:
  10754. template <class T, class A = Alloc<T> >
  10755. struct Vector
  10756. {
  10757. Vector(T a){}
  10758. };
  10759. template <>
  10760. struct Vector<double>
  10761. {
  10762. Vector(){}
  10763. int foo() { return 0; }
  10764. };
  10765. %template(V_c) Vector<char, Alloc<char> >;
  10766. %template(V_i) Vector<int>; // picks Vector<int,Alloc<int> >
  10767. %template(V_d) Vector<double>; // picks the specialization
  10768. this is needed for automatic STL support (later will
  10769. be).
  10770. - Fix the template + typedef errors in test-suite, which
  10771. probably will fix another group of strange template +
  10772. namespaces + typedefs errors.
  10773. - %warnfilter is working better now, parser.y tries to use
  10774. them when needed.
  10775. - **** New default type resolution method (stype.c) *****
  10776. It preserves the original mixed types, then it goes
  10777. 'backward' first deleting the qualifier, then the inner
  10778. types, for example:
  10779. typedef A *Aptr;
  10780. const Aptr&;
  10781. r.q(const).Aptr -> r.q(const).p.SWIGTYPE
  10782. r.q(const).p.SWIGTYPE -> r.p.SWIGTYPE
  10783. r.p.SWIGTYPE -> r.SWIGTYPE
  10784. r.SWIGTYPE -> SWIGTYPE
  10785. enum Hello {};
  10786. const Hello& hi;
  10787. r.q(const).Hello -> r.q(const).enum SWIGTYPE
  10788. r.q(const).enum SWIGTYPE -> r.enum SWIGTYPE
  10789. r.enum SWIGTYPE -> r.SWIGTYPE
  10790. r.SWIGTYPE -> SWIGTYPE
  10791. int a[2][4];
  10792. a(2).a(4).int -> a(ANY).a(ANY).SWIGTYPE
  10793. a(ANY).a(ANY).SWIGTYPE -> a(ANY).a().SWIGTYPE
  10794. a(ANY).a().SWIGTYPE -> a(ANY).p.SWIGTYPE
  10795. a(ANY).p.SWIGTYPE -> a(ANY).SWIGTYPE
  10796. a(ANY).SWIGTYPE -> a().SWIGTYPE
  10797. a().SWIGTYPE -> p.SWIGTYPE
  10798. p.SWIGTYPE -> SWIGTYPE
  10799. before it always stops after finding ref/pointer/enum/array/etc.
  10800. Now, then, you can define (use and apply) 'higher' typemaps such as:
  10801. %typemap(in) SWIGTYPE* const&
  10802. %typemap(out) char FIXSIZE[ANY]
  10803. %typemap(in) SWIGTYPE* const&
  10804. %typemap(in) const enum SWIGTYPE&
  10805. %typemap(in) SWIGTYPE[ANY][ANY]
  10806. %typemap(in) const char (&)[ANY]
  10807. It is possible with this change that previous typemaps
  10808. that were defined (but ignored), now will start to work.
  10809. Also, it is necessary check for the '%typemap(varin) SWIGTYPE[]',
  10810. before it was usually not defined (but char[] was),
  10811. and that can produce some inconsistencies.
  10812. *** POTENTIAL INCOMPATIBILITY ***
  10813. This change was needed for STL, since std::vector<enum Hello>
  10814. std::vector<A*>, etc, will always generate methods that
  10815. mix const references with the vector type.
  10816. Now that is working, all the std::container<T*>
  10817. specialization will not be needed anymore, well, in
  10818. theory.
  10819. In the practice, everythin is working as before until
  10820. the proper mixed types are defined and the libraries
  10821. simplified to use them.
  10822. - Change the behavior of extern "java"/"fortran"/"etc",
  10823. now swig produces a warning, and use extern "C" instead.
  10824. The warning can also be disable with the "-w 313" flag.
  10825. (WARN_PARSE_UNDEFINED_EXTERN).
  10826. - SwigValueWrapper is now more selective (lang.cxx).
  10827. [Perl/Tcl]
  10828. - Fix some typemaps (perl/tcl) to work properly with
  10829. SwigValueWrapper. This was not a problem with
  10830. SwigValueWrapper, but with the typemaps that now are
  10831. safe to use with %apply.
  10832. [Python]
  10833. - Fix %callback/%pythoncallback work now as before after
  10834. the def args changes. Also, %callback now is an alias
  10835. for %pythoncallback, so, they do the same.
  10836. [Python/Ruby]
  10837. - %callback is more usable and uniform:
  10838. %callback("%s_cb") foo(); // for both, python/ruby
  10839. %callback("%s_cb"); // for both, python/ruby
  10840. %callback(1) foo(); // only in python.
  10841. 10/17/2004: arty
  10842. [OCAML]
  10843. - Tweak to enum typing for soundness in the presence of multiple
  10844. modules.
  10845. - global functions are now unambiguous in multiple loaded modules.
  10846. - Fixed test case code to build multimodule test cases correctly.
  10847. - There is no way to share overload resolution across modules
  10848. because of soundness issues. If the user wants to call some
  10849. function foo from an arbitrary module bar, they will have to
  10850. use Bar._foo to call it correctly. Later I will fix the
  10851. camlp4 module to do something clever in this case.
  10852. - Promided performance overhaul of class mechanism.
  10853. - Removed symbol hack for ocaml-3.07 and below which is not needed
  10854. for ocaml-3.08 and above.
  10855. 10/16/2004: wuzzeb (John Lenz)
  10856. [CHICKEN]
  10857. - Completly change how chicken.cxx handles CLOS and generic code.
  10858. chicken no longer exports -clos.scm and -generic.scm. The clos
  10859. code is exported directly into the module.scm file if -proxy is passed.
  10860. - The code now always exports a unit. Running the test-suite is now
  10861. majorly broken, and needs to be fixed.
  10862. - CLOS now generates virtual slots for member variables similar to how
  10863. GOOPS support works in the guile module.
  10864. - chicken no longer prefixes symbols by the module name, and no longer
  10865. forces all names to lower case. It now has -useclassprefix and -closprefix
  10866. similar to how guile handles GOOPS names.
  10867. 10/16/2004: wsfulton
  10868. Templated functions with default arguments working with new default argument
  10869. wrapping approach. The new approach no longer fails with the following default
  10870. argument pattern (previously failed with some primitive types, like
  10871. unsigned primitive types):
  10872. template<typename T> int foo(const T& u = T());
  10873. %template(foo) foo<unsigned int>;
  10874. This relies on the templated function overloading support just added, so all
  10875. the combinations of overloading by template parameters and normal parameters
  10876. as well as overloading with default parameters works.
  10877. 10/16/2004: wsfulton
  10878. Added support for the large range of templated function overloading that C++
  10879. supports.
  10880. - Overloaded templated functions, eg
  10881. template<typename T> int overload(T t);
  10882. template<typename T> int overload(T t, const T &r);
  10883. - Fixes where the templated type is not used in the parameter list, eg
  10884. template<typename T> void xyz();
  10885. template<> void xyz<double>();
  10886. - Fixes for overloading of plain functions by a templated function:
  10887. void abc(double d);
  10888. template<typename T> void abc(T t);
  10889. - Overloading by templated parameters fixed:
  10890. template<typename T> void foo(T t) {}
  10891. template<typename T, typename U> void foo(T t, U u) {}
  10892. %template(foo) foo<double, double>;
  10893. - All combinations of the above also working including specializations, eg:
  10894. void abc(double d);
  10895. template<typename T> void abc(T t);
  10896. template<> void abc<double>(double t);
  10897. template<> void abc(int t);
  10898. 10/16/2004: wuzzeb (John Lenz)
  10899. - Remove the ability to share type information by using c linking.
  10900. All type sharing happens through a global variable in the target language.
  10901. + Remove SWIG_NOIMPORT, SWIG_RUNTIME, and related defines.
  10902. + Deprecate -runtime, -noruntime command line options
  10903. + Update test-suite common.mk to correctly build multicpptest
  10904. + Remove reference to precommon.swg
  10905. + Update the guile_gh interface to share data by a global var instead
  10906. of c linkage.
  10907. - Remove Advanced.html, since everything in it is now obsolete
  10908. 10/09/2004: mmatus
  10909. - Split the python std/STL C++ library files, now
  10910. all the language independent definitions are under
  10911. the directory
  10912. Lib/std
  10913. and hence, can be used from other languages.
  10914. - Add more documentation to the Python STL, and
  10915. clean unnecessary code.
  10916. - Add initial C99 complex support, and some fixes
  10917. for long double.
  10918. 10/08/2004: mmatus
  10919. - Fix the SwigValueWrapper for opaque types, now it is
  10920. applied for opaque templates and classes, for which we
  10921. don't know if there is or not a default constructor, ie
  10922. struct A {
  10923. A(int);
  10924. };
  10925. Still, if you know that you class has a default
  10926. constructor, and for some very very particular reason
  10927. you want to avoid the SwigValueWrapper, and you don't
  10928. want or can't expose the class to swig, now you can
  10929. say
  10930. %feature("novaluewrapper") A;
  10931. class A;
  10932. or the other way around, if the class has a default
  10933. constructor, but you want to use the value wrapper, you
  10934. can say
  10935. %feature("valuewrapper") A;
  10936. struct A {
  10937. A();
  10938. ....
  10939. };
  10940. - Fix for char > 128, ie
  10941. const char tilde_a = '\341';
  10942. - Add patch 1041858 for $lextype, which carries the
  10943. literal type of a symbol. See lextype.i in the
  10944. test-suite for more details.
  10945. 10/07/2004: wsfulton
  10946. {Ruby, Java] Fix director + 'empty' throws
  10947. struct A {
  10948. A() throw();
  10949. virtual ~A() throw();
  10950. int foo() throw();
  10951. };
  10952. 10/06/2004: wuzzeb (John Lenz)
  10953. [TCL]
  10954. - Fix bug reported by William A. Hoffman propagating clientdata
  10955. between modules. Added clientdata_prop.multicpptest to check for
  10956. this bug. The fix involved the following changes:
  10957. + SwigType_clientdata_collect does not need to check
  10958. types in r_resolved because we only want to propagate clientdata
  10959. to typedefed classes, and r_mangled already takes care of typedefs.
  10960. + SWIG_TypeRegister now copies the clientdata field correctly
  10961. + Move SWIG_Guile_PropagateClientData function from guile module
  10962. into common.swg, because we need to call it from both guile and tcl.
  10963. + Add base_names to swig_class to delay the lookup of bases. SWIG
  10964. now exports the base names and only when the base swig_class is
  10965. needed is SWIG_TypeQuery(name)->clientdata looked up.
  10966. - conversion_ns_template testsuite test was failing because
  10967. the name of the wrapped constructor function was not calculated
  10968. correctly for structs. Fixed.
  10969. 10/06/2004: wsfulton
  10970. Fixes for default arguments used in directors - in virtual
  10971. methods and director constructors.
  10972. 10/06/2004: mmatus
  10973. Fix the __cplusplus macro, and bug 1041170.
  10974. Now it is working as supposed, ie, you can safely use
  10975. #ifdef __cplusplus
  10976. ...
  10977. all over swig, including inside %defines and %{ %} bodies.
  10978. *** POTENTIAL INCOMPATIBILITY ***
  10979. The old trick of using
  10980. #if __cplusplus
  10981. doesn't work any more. So, if you have your own typemaps
  10982. using that syntax, you will need to migrate them to use
  10983. "#ifdef __cplusplus".
  10984. 10/05/2004: wuzzeb (John Lenz)
  10985. - Reorganize how runtime type information is stored and shared
  10986. between modules. For chicken and mzscheme, I removed
  10987. the ability to use runtime libraries, while perl, tcl, python, and
  10988. ruby default to using the new method but can go back to the old
  10989. method by declaring SWIG_ALLOW_RUNTIME.
  10990. - line 582 in mzscheme.cxx was generating a segfault on
  10991. imports.multicpptest, so I fixed it.
  10992. 10/05/2004: wsfulton
  10993. Fixes for %extend and overloaded static methods with default
  10994. arguments.
  10995. 10/05/2004: mmatus
  10996. - [python] Fix director + method with 'empty' throw, ie
  10997. struct A {
  10998. virtual int foo() throw();
  10999. };
  11000. other languages should also easy to fix, look for
  11001. Getattr(n,"throw") in python.cxx.
  11002. - Fix director + destructor with 'empty' throw
  11003. struct A {
  11004. virtual ~A() throw();
  11005. };
  11006. - Now SWIG_FEATURES parse all and the same options you
  11007. can pass to swig in the command line.
  11008. - New command line flag: -features <list>, as in
  11009. swig -features autodoc=3,director
  11010. ie, any global feature can be initialized from the
  11011. command line. This is mainly for testing, but users
  11012. can also take advantage of it.
  11013. 10/04/2004: mmatus
  11014. - Properly qualify type in syntax as 'long(2)' or 'Foo()',
  11015. this solve old problem with default args, and probably
  11016. other problems around. However, the default arg problem
  11017. was also already solved by William (see below).
  11018. - Fix feature_set and feature_get methods. Before
  11019. they look from particular to general and keep the first
  11020. feature found. This didn't work well with templates.
  11021. Now the methods look from general to particular, and
  11022. override any found feature.
  11023. - Previously a feature could not be applied to constructors
  11024. or destructors that weren't explicitly declared in the class.
  11025. This is now fixed, for example:
  11026. %feature("featurename") Foo() "..."
  11027. %feature("featurename") ~Foo() "..."
  11028. class Foo {
  11029. // implicit Foo() and ~Foo()
  11030. };
  11031. - Fix missing features for default const/dest, by really
  11032. 'creating' the methods and applying the features.
  11033. - Fix return_const_value.i case by adding SwigValueWrapper<const T>
  11034. specialization.
  11035. - Fix %extend + overload, including overloading actual
  11036. class methods.
  11037. - Adding more cases in related files in the test-suite.
  11038. 10/04/2004: wsfulton
  11039. Changes to the way default arguments are wrapped. Previously a single
  11040. method was generated for each method that had default arguments. If
  11041. a method had 5 arguments, say, of which 1 had a default argument
  11042. then the call to the wrapped method would pass 5 arguments. The default
  11043. value was copied into the wrapper method and used if the scripting
  11044. language passed just 4 arguments. However, this was flawed as the
  11045. default argument sometimes does not have global access, for example
  11046. SWIG would generate code that couldn't compile when wrapping:
  11047. class Tricky {
  11048. public:
  11049. void foo(int val = privatevalue);
  11050. void bar(int val = Tricky::getDefault());
  11051. private:
  11052. static int getDefault();
  11053. enum { privatevalue = 200 };
  11054. };
  11055. Also bugs in resolving symbols generated code that wouldn't compile, for example
  11056. (probably fixable though):
  11057. namespace Space {
  11058. class Klass {
  11059. };
  11060. Klass constructorcall(const Klass& k = Klass());
  11061. }
  11062. The approach also does not work for statically typed languages (C# and Java)
  11063. as these languages do not allow methods to have variable number of arguments.
  11064. Although C# has a mechanism to pass a variable number of arguments they
  11065. must be of the same type and are more like varargs.
  11066. The new approach solves the above problems and wraps methods with default
  11067. arguments as if the method was overloaded. So SWIG will now treat
  11068. void foo(int val=0);
  11069. as if it had parsed:
  11070. void foo(int);
  11071. void foo();
  11072. The code generated is then exactly the same as if SWIG had parsed the two
  11073. overloaded methods. The scripting languages count the arguments passed and call
  11074. the appropriate method, just like overloaded methods. C# and Java are now able
  11075. to properly wrap methods with default arguments by generating extra methods,
  11076. again as if the method was overloaded, so for:
  11077. void bar(string s="hello", double d=10.0, int i=0);
  11078. the following proxy methods are generated:
  11079. void bar(string s, double d, int i);
  11080. void bar(string s, double d);
  11081. void bar(string s);
  11082. void bar();
  11083. The new approach comes with a couple of minor knock on effects.
  11084. 1) SWIG support for default arguments for C (not C++) code no longer works.
  11085. Previously you could have this interface:
  11086. %{
  11087. void foo(int val);
  11088. %}
  11089. void foo(int val=0);
  11090. and call the wrapped method from a scripting language and pass no arguments
  11091. whereupon the default of 0 was used. You can get the same behaviour for C
  11092. code by using the "default" typemap:
  11093. %typemap(default) int val "$1 = 0;"
  11094. %{
  11095. void foo(int val);
  11096. %}
  11097. void foo(int val);
  11098. or you could of course compile your code as C++ if you want C++ features :) :
  11099. %{
  11100. void foo(int val=0);
  11101. %}
  11102. void foo(int val=0);
  11103. A couple of SWIG's libraries used this C extension and these have been modified
  11104. to use the "default" typemap. The "default" typemap is thus unchanged (and still
  11105. is not and is not fully supported by C# and Java, and is likely to remain so).
  11106. 2) All features (%feature, %rename, %ignore etc) no longer work as if the method
  11107. with default arguments is just one method. For example, previously
  11108. %ignore foo(int);
  11109. would have ignored the method completely. Now it will only ignore foo(int) but
  11110. not the extra foo() method. Instead use:
  11111. %ignore foo;
  11112. to ignore them all. or
  11113. %ignore foo(int);
  11114. %ignore foo();
  11115. This of course allows one to fine tune the wrapping, for example one could use:
  11116. %rename(fooint) foo(int);
  11117. %rename(foodefaults) foo();
  11118. void foo(int val=0);
  11119. and call them from any language like so:
  11120. fooint(200)
  11121. foodefaults()
  11122. or for example ignore the extra overloaded method, so the defaults cannot be used:
  11123. %ignore foo();
  11124. void foo(int val=0);
  11125. *** POTENTIAL INCOMPATIBILITY ***
  11126. 10/2/2004: mmatus
  11127. [Python]
  11128. - More cleaning up and uniformation on the Python Lib
  11129. - Added Robin's docstring patch, plus some fixes, plus
  11130. some extensions, see autodoc.i example in the test-suite,
  11131. and try using %feature("autodoc","extended").
  11132. This patch is not a complete solution for the
  11133. documentation problem, just enough to inform python about
  11134. the parameter list.
  11135. The expected swig documentation support is far far away yet.
  11136. 10/1/2004: mmatus
  11137. - Fix the %callback feature (only used in ruby and python examples,
  11138. by now, but it should be generic), now member callbacks
  11139. are working again
  11140. - Fix wrapping of functions pointers like
  11141. std::ostream& std::endl(std::ostream&);
  11142. ie, the ones that return references or enums.
  11143. [Python] Add the %pythoncallback directive, which is
  11144. an improved version of %callback, ie,
  11145. %pythoncallback(1) foo;
  11146. %pythoncallback(1) A::bar;
  11147. %pythoncallback(1) A::barm;
  11148. int foo(int a) {
  11149. return a;
  11150. }
  11151. struct A
  11152. {
  11153. static int bar(int a);
  11154. int barm(int a);
  11155. };
  11156. int foobar(int a, int (*pf)(int a));
  11157. in python you can use
  11158. foo(2)
  11159. foobar(2,foo)
  11160. A.bar(2)
  11161. foobar(2,A.bar)
  11162. ie, no additional pointer elements are created, and
  11163. the original 'foo' and 'A.bar' can be used as parameters.
  11164. In the case of member function however, still you need
  11165. to use the special variable Class::<fnc_name>_cb_ptr, ie:
  11166. foobarm(3, a, A.barm_cb_ptr)
  11167. we will try to fix this situation also, but later.
  11168. [Python] Add more elements from the STL library, now
  11169. you can use
  11170. import std
  11171. std.cout << "hello " << 123 << std.endl
  11172. [Python] Fix in/out return mechanism, now swig will behave
  11173. as 1.3.21 but using a python list when needed. The problem
  11174. is that the types std::pair,std::vector,etc, use tuples,
  11175. and they interfer with the previous inout tuple type.
  11176. By using lists we solve the conflicts, swig acts as before,
  11177. but returns a list when more than one parameter are using
  11178. the OUT typemap. See the new inout.i example in the
  11179. test-suite.
  11180. *** POTENTIAL INCOMPATIBILITY FOR PYTHON MODULE ***
  11181. [Python] Much better error messages for bad arguments, now
  11182. you always get the argument number where the error occurred.
  11183. 09/27/2004: wsfulton
  11184. Patch from Bill Clarke -
  11185. 1) Warning emitted when -importall and -includeall is used together,
  11186. with -includeall taking precedence.
  11187. 2) Ensure SWIGIMPORTED is always defined when a file is being
  11188. imported with %import. Note that this is not the same as SWIGIMPORT,
  11189. which gets defined in all generated wrapper files.
  11190. 09/26/2004: mmatus
  11191. - add %feature("exceptionclass") to identify a class used
  11192. as exception. Before swig identified and marked a class
  11193. using the "cplus:exceptionclass" attribute. However, the
  11194. class needed to appear on an throw() statement. Now
  11195. swig keeps trying to identify the exception classes, as
  11196. before, but it also allows the user to mark a class by
  11197. using the %feature explicitly. (mostly relevant for
  11198. python and chicken)
  11199. [Python]
  11200. - fix -modern option + exceptions, which mix old class
  11201. style with the new one. So, we always need to emit
  11202. the "nonmodern" python code.
  11203. - add the "python:nondynamic" feature and its handler
  11204. now if you have
  11205. %pythonnondynamic A;
  11206. struct A {
  11207. int a;
  11208. int b;
  11209. };
  11210. then, in the python side
  11211. aa = A()
  11212. aa.a = 1 # ok
  11213. aa.b = 2 # ok
  11214. aa.c = 3 # error, the class can not be extended dynamically.
  11215. Since this is a feature, you can use
  11216. %pythonnondynamic;
  11217. or
  11218. %pythondynamic; [ Note: %pythondynamic since deprecated ]
  11219. to force all the wrapped classes to be "nondynamic" ones.
  11220. The default, as in regular python, is that all the wrapped
  11221. classes are dynamics. So, careful with your spelling.
  11222. 09/14/2004: mmatus
  11223. - Support the -I- option.
  11224. - Differentiate between %include <file> and %include "file".
  11225. This fix several corner cases.
  11226. [Python] Several patches:
  11227. - Normalize the Lib file names:
  11228. *.swg internal files,
  11229. *.i user files.
  11230. - Fix Char[ANY] typemaps, so they also delete any extra '\0' chars,
  11231. now they behave as before (1.3.21). Still, you can use
  11232. the SWIG_PRESERVE_CARRAY_SIZE macro if you need to
  11233. preserve the original size (see pystrbase.swg).
  11234. - Add the Char FIXSIZE[ANY] typemaps, to preserve the
  11235. original C array sizes (see above). Though, you can't
  11236. use them yet since %apply and arrays are not working
  11237. together.
  11238. - Add pyfragments.swg, now the user can add fragments
  11239. to override the default ones.
  11240. 09/10/2004: wsfulton
  11241. Patch from Bill Clarke which fixes spurious preprocessor bug which
  11242. shows on Solaris and gcc, eg:
  11243. Warning(202): Could not evaluate '!defined(SWIGJAVA) &&
  11244. !(defined(SWIGCSHARP)'
  11245. Also fixes a bug where '#if "a" == "b" == 1' wouldn't have worked
  11246. 09/10/2004: wsfulton
  11247. Restored multiple build directories for the test-suite. Patch from
  11248. Bill Clarke.
  11249. 09/06/2004: wsfulton
  11250. Added the missing runtime.dsp Visual Studio project files for the
  11251. import examples to work.
  11252. Version 1.3.22 (September 4, 2004)
  11253. ==================================
  11254. 09/03/2004: wsfulton
  11255. The swig.m4 macro for use with the Autoconf/Automake/Libtool has
  11256. been removed and is no longer installed. Please use the new and better
  11257. maintained version derived from swig.m4 in the Autoconf macro archive.
  11258. See http://www.gnu.org/software/ac-archive/htmldoc/ac_pkg_swig.html and
  11259. http://www.gnu.org/software/ac-archive/htmldoc/ac_python_devel.html.
  11260. 09/01/2004: wsfulton
  11261. [Perl] Applied patch #1019669 from Christoph Flamm. Adds support
  11262. for %feature("shadow") in the same way as it works in Python. This
  11263. enables one to override the generated shadow/proxy methods, including
  11264. constructors and destructors. For example:
  11265. /* Let's make the constructor of the class Square more verbose */
  11266. %feature("shadow") Square(double w)
  11267. %{
  11268. sub new {
  11269. my $pkg = shift;
  11270. my $self = examplec::new_Square(@_);
  11271. print STDERR "Constructed an @{[ref($self)]}\n";
  11272. bless $self, $pkg if defined($self);
  11273. }
  11274. %}
  11275. class Square {
  11276. public:
  11277. Square(double w);
  11278. ...
  11279. };
  11280. 08/31/2004: mmatus
  11281. [Python] Incompatibility reported by Bill Clarke (llib@computer.org):
  11282. If you are using Sun Studio 8 (and possibly earlier
  11283. versions) to compile the output produced by swig
  11284. 1.3.22rc1, and you are using C++ and STL templates then
  11285. you need to use either "-runtime" or "-noruntime". If you
  11286. use neither of these options then you will probably get
  11287. compiler errors when trying to compile the wrapper file;
  11288. the error message will be like this: The name
  11289. SWIG_Python_ConvertPtr[...] is unusable in static
  11290. swigpy::traits_asptr[...] If you get this error message,
  11291. you need to regenerate your wrapper file using 'swig
  11292. -runtime' or 'swig -noruntime'.
  11293. You shouldn't get this problem with Sun Studio 9.
  11294. *** POTENTIAL INCOMPATIBILITY FOR PYTHON MODULE ***
  11295. 08/26/2004: wsfulton
  11296. [Perl] Applied #932333 from Ikegami Tsutomu. Fixes long long *OUTPUT
  11297. and unsigned long long *OUTPUT typemaps in typemaps.i.
  11298. 08/26/2004: wsfulton
  11299. Applied patch #857344 from Art Yerkes. Workaround for autoconf bug when
  11300. running 'make install'.
  11301. 08/26/2004: wsfulton
  11302. [Perl] Part of patch #982753 applied. This implements a %perlcode directive.
  11303. It allows one to add Perl code to the generated .pm file. Works the same
  11304. as %pythoncode.
  11305. 08/26/2004: wsfulton
  11306. [Java] Fix for directors when wrapping virtual methods with exception
  11307. specifications that were not simple types. Previously code was generated that
  11308. didn't compile, for example when the exception specification was a pointer.
  11309. 08/25/2004: wsfulton
  11310. [C#] Typemap fix for methods that return char *. The CLR would incorrectly
  11311. delete the memory pointed to by char *. Also applied the same correction to
  11312. the char array typemaps.
  11313. 08/24/2004: wsfulton
  11314. Fixes for -fmicrosoft error/warning message display:
  11315. - End of file (EOF) warning messages not displaying in correct format
  11316. - Some messages containing a file path were displaying a double backslash
  11317. instead of a single backslash
  11318. 08/23/2004: wsfulton
  11319. Applied patch #1011604 submitted by Charles Schwieters. Fix for 64 bit tcl
  11320. interpreters.
  11321. 08/23/2004: wsfulton
  11322. Fix for bug #875583 - enum forward declarations previously gave a syntax error.
  11323. 08/23/2004: mkoeppe
  11324. [Allegro CL] Use typemaps "ffitype" and "lisptype" to determine the FFI type
  11325. specifiers from the C type. This makes it possible, for instance, to control
  11326. whether a C "char" argument takes a Lisp character or a Lisp integer value.
  11327. The default (taking Lisp characters) is done by these built-in typemaps:
  11328. %typemap(ffitype) char ":char"
  11329. %typemap(lisptype) char "character"
  11330. If char means an integer instead, use these typemaps:
  11331. %typemap(ffitype) char ":char"
  11332. %typemap(lisptype) char "integer"
  11333. 08/22/2004: wsfulton
  11334. As discussed in bug #772453, the SWIG library directory is now installed
  11335. into a different default directory. The library used to be installed to
  11336. /usr/local/lib/swig1.3. It is now in the more usual architecture independent
  11337. directory and I have additionally used a version specific subdirectory as
  11338. the library will rarely work with older versions of SWIG. This release
  11339. will thus use /usr/local/share/swig/1.3.22 by default, which can be
  11340. tailored as before using './configure --swiglibdir'.
  11341. 08/17/2004: mkoeppe
  11342. [MzScheme] Add support to create native MzScheme structures from C structures.
  11343. To convert a C structure to an MzScheme structure, use the new runtime macro
  11344. SWIG_NewStructFromPtr in a typemap. Patch from Dmitriy Zavin.
  11345. 08/12/2004: wsfulton
  11346. Patch #837715 from Ben Reser to correctly detect Python lib directory
  11347. on 64 bit systems.
  11348. 08/12/2004: wsfulton
  11349. [C# and Java] Prevent memory leaks in the case of early return
  11350. from wrapper methods using const std::string & parameters. Modified
  11351. Mark Traudt patch #951565.
  11352. 08/12/2004: wsfulton
  11353. Bug #943783 with patch fixes php char * out typemap NULL values.
  11354. 08/03/2004: Ahmon Dancy <dancy@dancy>
  11355. [allegrocl] Additional case mode fixes. Also, make sure
  11356. foreign types are exported.
  11357. 07/24/2004: mkoeppe
  11358. [Guile] In -scm mode, SWIG modules now exchange their pointer type
  11359. information via the Guile interpreter. It is no longer necessary to build a
  11360. runtime library or to use -noruntime and -runtime etc.
  11361. The module (Swig swigrun) which was introduced in the change of 05/17/2004 is
  11362. no longer automatically built. If you need it, run SWIG on the interface file
  11363. swigrun.i.
  11364. 07/23/2004: wsfulton
  11365. [C#] Bug #917601 Mapping C++ bool fix from Mark Traudt
  11366. 07/23/2004: wsfulton
  11367. RPM fixes for latest CVS version including removal of runtime
  11368. library.
  11369. 07/23/2004: wsfulton
  11370. Patch #908955 from Robert H De Vries.
  11371. RPM file generation fix for Fedore Core 1 and Redhat AS2.1.
  11372. 07/12/2004: wsfulton
  11373. Patch #864689 from Robin Dunn:
  11374. This patch corrects two problems in the XML output of SWIG:
  11375. 1. There were often extra '/>\n' in the output.
  11376. 2. value attributes were output with '\n' in them but
  11377. since that is not technically legal most (all?) XML
  11378. parsers will strip them out. Replacing the '\n' with
  11379. the '&#10;' entity reference solves this as that is
  11380. legal and XML parsers will convert it to a '\n' when
  11381. reading the values back in.
  11382. This patch also adds a new global command line option
  11383. that will allow the parse tree to be written out in XML
  11384. *after* some other language module has been run, in
  11385. order to be able to get extra info that the language
  11386. module puts in the tree. In this way the XML is a
  11387. post-processed version of the tree rather than a
  11388. pre-processed version.
  11389. Command line option is -dump_xml or -xmlout <file>
  11390. 07/12/2004: wsfulton
  11391. [Java] Patch from Scott Michel to fix typesafe enums and proper enums
  11392. with directors.
  11393. 07/12/2004: wsfulton
  11394. HTML documentation (makechap.py) file generator missing end of line
  11395. patch #908951 from Robert de Vries.
  11396. 07/08/2004: wsfulton
  11397. The deprecated runtime library build has been removed. This also removes
  11398. the dependency on Libtool. Libtool is no longer required to build SWIG.
  11399. The associated -ldflags SWIG commandline option has also been removed.
  11400. The examples and test-suite testcases that used the runtime library have
  11401. been updated to use the replacement approach to using SWIG across
  11402. multiple modules, that is they use the -noruntime and -runtime commandline
  11403. options, see Modules.html. Effectively they build their own runtime
  11404. libraries using -runtime. The examples are import and import_template.
  11405. The test cases are in the imports and template_typedef_import directories.
  11406. Anyone who wants the original runtime libraries can either run the test-suite
  11407. or build the examples and use the appropriate shared object/DLL that is
  11408. generated with the -runtime commandline option. For example libimports_runtime.so
  11409. (Python calls it lib_imports_runtime.so) is generated after running the
  11410. 'make imports.multicpptest' testcase in the Examples/test-suite/<lang>
  11411. directory. Or use libruntime.so / runtime.dll after building the import
  11412. examples in Examples/<lang>/import.
  11413. 07/07/2004: mkoeppe
  11414. [Allegro CL] Convert character and string literals in constants to
  11415. CL syntax. Fix FF:DEF-FOREIGN-CALL for mixed-case C functions.
  11416. 06/27/2004: wsfulton
  11417. [Java] New feature for Java exceptions with format %javaexception(exceptionclasses).
  11418. This feature is a slight enhancement to %exception and the only difference is the
  11419. addition of the exception classes which are generated into a throws clause.
  11420. The 'exceptionclasses' is a comma separated list of classes which will be
  11421. added to the associated proxy method's throws clause. The 'exceptionclasses'
  11422. are specified like the exception classes in the 'throws' attribute in the
  11423. typemaps. This feature should be used for correctly handling checked exceptions
  11424. thrown from JNI code. For example:
  11425. %javaexception("java.lang.Exception") throwException %{
  11426. ... convert a std::logic_error into a java.lang.Exception using JNI code ...
  11427. %}
  11428. #include <stdexcept>
  11429. void throwException() {
  11430. throw std::logic_error("Logic error!");
  11431. }
  11432. will generate a method with a throws clause in the module class:
  11433. public static void throwException() throws java.lang.Exception { ... }
  11434. 06/27/2004: wsfulton
  11435. [C#] New %csconstvalue(value) feature directive for use with constants and
  11436. enums. This works the same way as %javaconstvalue. For C#, this directive
  11437. is the only way that one can fix wrapping of C/C++ enums with proper C#
  11438. enums if the enum item's initialiser cannot compile as C# code. This is
  11439. because Java enums can use a call into C code to initialise the enum item,
  11440. whereas in C#, the enum value must be a compile time constant. That is,
  11441. using %csconst(0) cannot be used in C# to initialise the C# enum item via
  11442. a PINVOKE call.
  11443. 06/27/2004: wsfulton
  11444. [Java] New %javaconstvalue(value) feature directive for use with constants and
  11445. enums. Sometimes the use of %javaconst(1) will produce code that won't compile
  11446. under Java. If a compile time constant is required, %javaconst(0) is not an
  11447. option. The %javaconstvalue directive achieves this goal and the value specified
  11448. is generated as Java code to initialise the constant. For example:
  11449. %javaconst(1);
  11450. %javaconstvalue(1000) BIG;
  11451. %javaconstvalue("new java.math.BigInteger(\"2000\")") LARGE;
  11452. %javaconstvalue(10) bar;
  11453. %{
  11454. const int bar = 10;
  11455. %}
  11456. %inline %{
  11457. #define BIG 1000LL
  11458. #define LARGE 2000ULL
  11459. enum Foo { BAR = ::bar };
  11460. %}
  11461. Generates:
  11462. public interface exampleConstants {
  11463. public final static long BIG = 1000;
  11464. public final static java.math.BigInteger LARGE = new java.math.BigInteger("2000");
  11465. }
  11466. public final class Foo {
  11467. public final static Foo BAR = new Foo("BAR", 10);
  11468. ...
  11469. }
  11470. Previously, none of BIG, LARGE or BAR would have produced compilable code
  11471. when using %javaconst(1).
  11472. 06/27/2004: wsfulton
  11473. %feature enhancements. Features can now take an unlimited number of attributes
  11474. in addition to the feature name and feature value. The attributes are optional
  11475. and are much the same as the typemap attributes. For example, the following
  11476. specifies two optional attributes, attrib1 and attrib2:
  11477. %feature(featurename, attrib1="attribval1", attrib2="attribval2") name "val";
  11478. %feature(featurename, val, attrib1="attribval1", attrib2="attribval2") name;
  11479. 06/27/2004: wsfulton
  11480. %feature improvements for the syntax that takes the feature value within the
  11481. %feature() brackets. The value specified is no longer restricted to being just
  11482. a string. It can be a string or a number. For example, this is now acceptable
  11483. syntax:
  11484. %feature("featurename",20.0);
  11485. whereas previously it would have to have been:
  11486. %feature("featurename","20.0");
  11487. Useful for features that are implemented as a macro, for example:
  11488. #define %somefeature(value) %feature("somefeature",value)
  11489. These will now work accepting either a string or a number:
  11490. %somefeature("Fred");
  11491. %somefeature(4);
  11492. 06/06/2004: wuzzeb (John Lenz)
  11493. [Chicken, Guile]
  11494. - Created the Examples/test-suite/schemerunme directory, which holds all the
  11495. runme scripts for guile and chicken (and possibly mzscheme...). The guile
  11496. and chicken _runme files then (load "../schemerunme/foo.scm").
  11497. - In chicken module, fix a few bugs invlolving dynamic casts.
  11498. 06/03/2004: wsfulton
  11499. Patch to fix wrapping of templated methods. ISO compliant compilers, like
  11500. Comeau and GCC-3.4.0, don't like the template specifier that SWIG was generating
  11501. when calling the method. This fix may break some non standard compliant compilers,
  11502. for example, Sun workshop compilers prior to version 6.2.p2. Patch submitted
  11503. by Bill Clarke.
  11504. 06/03/2004: wsfulton
  11505. [Java, C#] Undocumented special variable $imclassname removed.
  11506. New special variable $module is replaced by the module name, as specified
  11507. by %module or -module commandline option. $imclassname can be created from $module.
  11508. 06/03/2004: wsfulton
  11509. [C#] Same as for Java below. The new typemaps are named differently, namely,
  11510. csbody and csbody_derived. The deprecated typemaps are csgetcptr and
  11511. csptrconstructormodifiers.
  11512. *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
  11513. 06/03/2004: wsfulton
  11514. [Java] Typemap changes for the Java proxy / typewrapper and enum classes. A new
  11515. typemap called javabody contains the essential support code for generation into the body
  11516. of these classes. There is also a new javabody_derived typemap which is used instead for
  11517. wrapped classes that have a wrapped base class. The code is basically, the getCPtr()
  11518. method and swigCPtr and swigCMemOwn member variables. These used to be hard coded
  11519. with no way to modify the code. The introduction of this typemap makes it possible for
  11520. the user to tailor nearly every aspect of the code generation.
  11521. The exception now is the code for director classes.
  11522. The javagetcptr and javaptrconstructormodifiers typemaps are deprecated and are
  11523. no longer used as the code that these generated can be put in the more flexible
  11524. javabody and javabody_derived typemaps.
  11525. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  11526. The following macros contributed by Scott Michel may help you upgrade if you have used
  11527. the javagetcptr typemap:
  11528. /* Utility macro for manipulating the Java body code method attributes */
  11529. %define SWIGJAVA_ATTRIBS(TYPENAME, CTOR_ATTRIB, GETCPTR_ATTRIB)
  11530. %typemap(javabody) TYPENAME %{
  11531. private long swigCPtr;
  11532. protected boolean swigCMemOwn;
  11533. CTOR_ATTRIB $javaclassname(long cPtr, boolean cMemoryOwn) {
  11534. swigCMemOwn = cMemoryOwn;
  11535. swigCPtr = cPtr;
  11536. }
  11537. GETCPTR_ATTRIB static long getCPtr($javaclassname obj) {
  11538. return (obj == null) ? 0 : obj.swigCPtr;
  11539. }
  11540. %}
  11541. %typemap(javabody_derived) TYPENAME %{
  11542. private long swigCPtr;
  11543. CTOR_ATTRIB $javaclassname(long cPtr, boolean cMemoryOwn) {
  11544. super($moduleJNI.SWIG$javaclassnameUpcast(cPtr), cMemoryOwn);
  11545. swigCPtr = cPtr;
  11546. }
  11547. GETCPTR_ATTRIB static long getCPtr($javaclassname obj) {
  11548. return (obj == null) ? 0 : obj.swigCPtr;
  11549. }
  11550. %}
  11551. %enddef
  11552. /* The default is protected getCPtr, protected constructor */
  11553. SWIGJAVA_ATTRIBS(SWIGTYPE, protected, protected)
  11554. /* Public getCPtr method, protected constructor */
  11555. %define PUBLIC_GETCPTR(TYPENAME)
  11556. SWIGJAVA_ATTRIBS(TYPENAME, protected, public)
  11557. %enddef
  11558. /* Public getCPtr method, public constructor */
  11559. %define PUBLIC_BODYMETHODS(TYPENAME)
  11560. SWIGJAVA_ATTRIBS(TYPENAME, public, public)
  11561. %enddef
  11562. 06/03/2004: wsfulton
  11563. [Java, C#] The contents of the class modifier typemaps and pragmas have changed.
  11564. They must now include the class type. Previously 'class' was hard coded.
  11565. This change enables flexibility into what type of class is generated,
  11566. for example the proxy class could be an interface instead of a class.
  11567. For Java this affects the javaclassmodifiers typemap and the jniclassclassmodifiers
  11568. and moduleclassmodifiers pragmas.
  11569. For C# this affects the csclassmodifiers typemap and the imclassclassmodifiers
  11570. and moduleclassmodifiers pragmas.
  11571. Unless you have overridden the default versions of these typemaps or pragmas, you
  11572. shouldn't be affected. However, if you have, upgrading is easy, for example
  11573. class Foo {};
  11574. %typemap(javaclassmodifiers) Foo "public final"
  11575. must now be:
  11576. class Foo {};
  11577. %typemap(javaclassmodifiers) Foo "public final class"
  11578. *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
  11579. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  11580. 05/31/2004: wsfulton
  11581. Fix for C++ exception specifications that are references. Problem reported by
  11582. Oren Miller. Also improves the generated exception declarations in the
  11583. catch handler for pointers - a pointer is used instead of a reference to
  11584. a pointer. Added default throws typemaps for SWIGTYPE &, SWIGTYPE * and
  11585. SWIGTYPE[ANY] (Java and C#).
  11586. 05/31/2004: wsfulton
  11587. [Java, C#] Some minor typesafe enum improvements, including storing the name of
  11588. the enum item. The toSring() / ToString() methods are overridden to return this name.
  11589. 05/30/2004: wuzzeb (John Lenz)
  11590. [Chicken]
  11591. - Update how examples and the test suite are built.
  11592. - Symbol names are no longer converted to lower case
  11593. - Added union_runme.ss, which was copied and modified from the guile module
  11594. 05/26/2004: lballabio (Luigi Ballabio)
  11595. Committed on behalf of Marcelo (who still has problems with
  11596. the SourceForge CVS.)
  11597. Added Python typemaps for FILE* with (Python-only) test.
  11598. 5/24/2004: dancy
  11599. * Allegro CL module: Now using some macros (defined in
  11600. Lib/allegrocl/allegrocl.swg), swig-defconstant and swig-defun, for
  11601. defining constants and foreign functions. This makes the
  11602. generated file a bit neater.
  11603. Now strips a layer of parenthesis from constants.
  11604. Uses (* :void) instead of :foreign-address now.
  11605. 05/20/2004: wsfulton
  11606. Unnamed enum global variables are now supported in addition
  11607. to the recently added support for unnamed enum member variables.
  11608. For example:
  11609. struct Foo {
  11610. enum { enum1, enum2 } MemberInstance;
  11611. };
  11612. enum { enum3, enum4 } GlobalInstance;
  11613. The int typemaps are used for wrapping the get/set accessor methods.
  11614. If the sizeof an enum is not the same size as an int then setting the
  11615. variable will silently do nothing as the casts cannot be easily and portably
  11616. generated. If you need to solve this highly obscure situation, write
  11617. the assignment using the %exception feature.
  11618. 05/20/2004: wsfulton
  11619. [C#] C# enum wrapping mods. Similar to the Java module, enums can be wrapped using
  11620. one of 3 approaches:
  11621. 1) Proper C# enums - use %include "enums.swg"
  11622. 2) Typesafe enums - use %include "enumtypesafe.swg"
  11623. 3) Simple constant integers (original approach) - use %include "enumsimple.swg"
  11624. See each of these files for further details. Each of these files use typemaps
  11625. and a new feature to control the generated code. The feature is:
  11626. %csenum(wrapapproach);
  11627. where wrapapproach should be one of: "proper", "typesafe", "typeunsafe" or "simple".
  11628. [No implementation deemed necessary for type unsafe enums].
  11629. The default approach is proper C# enums. Anonymous enums are always wrapped by
  11630. constant integers.
  11631. *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
  11632. 05/20/2004: wsfulton
  11633. [Java] Java enum support added. There are now 4 ways in which enums can be wrapped:
  11634. 1) Proper Java enums - use %include "enums.swg"
  11635. 2) Typesafe enums - use %include "enumtypesafe.swg"
  11636. 3) Type unsafe enums (constant integers) - use %include "enumtypeunsafe.swg"
  11637. 4) Simple constant integers (original approach) - use %include "enumsimple.swg"
  11638. See each of these files for further details. Each of these files use typemaps
  11639. and a new feature to control the generated code. The feature is:
  11640. %javaenum(wrapapproach);
  11641. where wrapapproach should be one of: "proper", "typesafe", "typeunsafe" or "simple".
  11642. The default typemaps will handle enums that may or may not have specified initial
  11643. values, for example ten is specified:
  11644. enum Numbers { zero, ten(10) };
  11645. However, the amount of generated Java code can be cut down, by modifying these typemaps
  11646. if none of the enums have initial values (proper Java enums and typesafe enums approach).
  11647. The default approach is typesafe enums. Anonymous enums are always wrapped by
  11648. constant integers.
  11649. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  11650. 05/11/2004: wsfulton
  11651. [Java, C#] Fix bug using %rename on enum items and when using
  11652. %javaconst(1) / %csconst(1)
  11653. For example, the following used to generate code that wouldn't compile:
  11654. %rename(Obj) Object;
  11655. enum Grammar { Subject, Object };
  11656. 04/28/2004: wsfulton
  11657. [Java, C#] Minor fixes when using combinations of the
  11658. javainterfaces, javabase, csinterfaces and csbase typemaps.
  11659. 05/18/2004: wsfulton
  11660. [Java] JVM link failure on some systems fixed when using std_vector.i.
  11661. Also adds default vector constructor for use from Java.
  11662. 05/17/2004: mkoeppe (Matthias Koeppe)
  11663. [Guile] New runtime functions SWIG_PointerAddress,
  11664. SWIG_PointerType, SWIG_IsPointerOfType, SWIG_IsPointer.
  11665. [Guile] In -scm mode, wrap several SWIG runtime functions
  11666. and export them into the module (Swig swigrun). The
  11667. runtime module is now built with "module" linkage.
  11668. [Guile] GOOPS proxy objects now also print the pointer
  11669. address of the C object.
  11670. 05/14/2004: lyle
  11671. Added Kou's patch for the Ruby %import directive so that modules
  11672. with "nested" names are handled properly. Consider an interface
  11673. file foo.i that has this %module declaration at its top:
  11674. %module "misc::text::foo"
  11675. Now consider another interface file spam.i that imports foo.i:
  11676. %import foo.i
  11677. Before this patch, this would result in the following code being
  11678. generated for spam_wrap.c:
  11679. rb_require("misc::text::foo");
  11680. With this patch, however, you'll get the correct path name
  11681. for the call to rb_require(), e.g.
  11682. rb_require("misc/text/foo");
  11683. See SourceForge Bug #928299.
  11684. 05/12/2004: wsfulton
  11685. Patch for emitting directors when %feature("director") specified
  11686. for a class with no virtual methods, but does have a virtual destructor.
  11687. Submitted by Kevin Smith.
  11688. 05/06/2004: mkoeppe (Matthias Koeppe)
  11689. New SWIG runtime function SWIG_TypePrettyName, which
  11690. returns an unmangled type name for a swig_type_info
  11691. object.
  11692. [Guile]: Use it for printing pointer objects.
  11693. 05/03/2004: dancy (Ahmon Dancy)
  11694. * Lib/allegrocl/allegrocl.swg: Updated comments about identifer
  11695. conversion.
  11696. * Sources/Modules/allegrocl.cxx: Register /dev/null for "header"
  11697. target. Also, disregard "const" qualifiers during type
  11698. conversion.
  11699. 05/02/2004: wuzzeb (John Lenz)
  11700. [Chicken] Fix bug 782468.
  11701. To fix this bug, the runtime code has been rewritten, and
  11702. pointers are now represented as a C_SWIG_POINTER_TYPE.
  11703. Chicken version > 1.40 is now required!
  11704. * Typemap incompatibility: typemaps no longer use chicken_words.
  11705. If a typemap needs some space, it should just call C_alloc
  11706. * argout typemaps no longer use the /* if ONE */ construct to
  11707. build an output list. A SWIG_APPEND_VALUE macro, exactly like
  11708. guile and mzscheme is now used.
  11709. 04/25/2004: mkoeppe (Matthias Koeppe)
  11710. [Guile] In the generated GOOPS code, don't create methods
  11711. that would not specialize any arguments; simply re-export
  11712. the primitive functions. (This is a performance
  11713. optimization which reduces load time and execution time.)
  11714. [Guile] In -gh mode, fix the "too many initializers" error
  11715. which was caused by an incompatible swig_type_info layout.
  11716. [Guile] The typemap for FILE * in ports.i now also accepts
  11717. a regular FILE * pointer object. Also a bug with Scheme
  11718. file ports that are open for input and output has been
  11719. fixed.
  11720. 04/25/2004: wsfulton
  11721. Change entry 03/21/2004 revoked. The change introduced another
  11722. inconsistency (reference typemaps beings used instead of
  11723. pointer typemaps for member variables as well as static
  11724. member variables and global variables for some languages,
  11725. but only for C++ and not C). This would break user's current
  11726. typemaps and introduce further inconsistencies. Alternative
  11727. solution required and being discussed.
  11728. 04/10/2004: mmatus (Marcelo Matus)
  11729. Added the -directors flag. This enables the director
  11730. mode for the interface and all the classes that
  11731. don't set the "feature:nodirector" explicitly.
  11732. You can use this in your module if you want to use the
  11733. director feature in all your classes, but it is most
  11734. intended for testing purposes, like:
  11735. make check-python-test-suite SWIG="../../../swig -directors"
  11736. make check-ruby-test-suite SWIG="../../../swig -directors"
  11737. make check-java-test-suite SWIG="../../../../swig -directors"
  11738. These commands will run the entire test-suite using
  11739. directors, and not only the specific 'directors_*'
  11740. cases. This should be done from time to time.
  11741. 04/10/2004: mmatus (Marcelo Matus)
  11742. [python] Added support for std::wstring and wchar_t,
  11743. for compiler and python versions that support them.
  11744. When needed, use
  11745. %inlcude std_string.i // 'char' strings
  11746. %inlcude std_wstring.i // 'wchar_t' strings
  11747. 04/10/2004: mmatus (Marcelo Matus)
  11748. [python] Fix the default behaviour (seg. fault) when an
  11749. inplace operator (+=,-=,...) was wrapped, as reported by
  11750. Lucriz (lucriz@sitilandia.it), when the most common
  11751. form was used:
  11752. A& A::operator+=(int i) { ...; return *this; }
  11753. ^^^^ ^^^^^^
  11754. ie, an object is returned and its contains the same 'this'
  11755. value than the input object, which is deleted after the
  11756. operation "a += b", leaving the result with no real
  11757. object, but a seg. fault.
  11758. To fix it, we needed to introduce a new feature and use an
  11759. old one:
  11760. %feature("self:disown") A::operator+=;
  11761. %feature("new") A::operator+=;
  11762. here, "self:disown" disable the ownership of the 'self'
  11763. or input object, and the "new" feature transfers the
  11764. ownership to the result object.
  11765. The feature/solution could also be used in other languages
  11766. that use gc and implement the inplace operators, or other
  11767. operators, in a similar way.
  11768. *** POTENTIAL INCOMPATIBILITY FOR Python MODULE ***
  11769. If you already are using the inplace operators in python,
  11770. and you implemented some kind of workaround to the problem
  11771. fixed here, it is possible you could end with 'free'
  11772. objects that never get deleted. If that is the case, and
  11773. you want to disable the current fix, use:
  11774. %feature("self:disown","") A::operator+=;
  11775. %feature("new","") A::operator+=;
  11776. 04/07/2004: cheetah (William Fulton)
  11777. [C#] C++ enums are no longer wrapped by integers, they are now wrapped by
  11778. C# enums. For Example, given C++:
  11779. enum AnEnum { foo, bar };
  11780. typedef AnEnum AnEnumeration;
  11781. void something(AnEnum e, AnEnumeration f);
  11782. The following is generated:
  11783. public enum AnEnum {
  11784. foo,
  11785. bar
  11786. }
  11787. public static void something(AnEnum e, AnEnum f) {...}
  11788. Note that a global enum like AnEnum above is generated into its own
  11789. file called AnEnum.cs. Enums defined within a C++ class are defined
  11790. within the C# proxy class. Some of the typemaps for modifying C# proxy
  11791. classes also work for enums. For example global enums can use
  11792. %typemap(csimports) to add in extra using statements.
  11793. Global enums and class enums can use
  11794. %typemap(csclassmodifiers) to make the enum private, public etc.
  11795. %typemap(csbase) to change the underlying enum type (enum base)
  11796. If we add this for the above example:
  11797. %typemap(csclassmodifiers) AnEnum "protected"
  11798. %typemap(csbase) AnEnum "long"
  11799. the following is generated:
  11800. protected enum AnEnum : long {
  11801. foo,
  11802. bar
  11803. }
  11804. *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
  11805. 04/07/2004: cheetah (William Fulton)
  11806. Seg fault fix for empty enums, like
  11807. enum Foo {};
  11808. 03/21/2004: mmatus
  11809. [Note: this change revoked on 04/25/2004]
  11810. [Python] Makes the following 'var' cases more uniform:
  11811. std::string ga;
  11812. struct A {
  11813. static std::string sa;
  11814. std::string ma;
  11815. };
  11816. now the three variables (ga, sa, ma) can be assigned as:
  11817. cvar.ga = "hello";
  11818. A.sa = "hello";
  11819. a.ma = "hello";
  11820. ie, now 'ma' will also use a std::string typemap 'in' if
  11821. defined, before it was only accepting a 'p_std_string'
  11822. pointer. Note, however, that 'ma' will not use the
  11823. 'varin/varout' typemaps (that probably could be more
  11824. natural), but it will pick up the 'in' typemap for const
  11825. std::string& (which is easier).
  11826. The changes in cwrap.c and lang.cxx will probably fix the
  11827. behaviour in other languages that do not overload the
  11828. membervarHandler method "too much".
  11829. 03/21/2004: mmatus
  11830. [Python] Disabling the default instantiations like:
  11831. %template() std::pair<int,int>;
  11832. for all the primitive types and STL containers/classes.
  11833. They are expensive, specially for pair and map, and the
  11834. previous behaviour also requires the user to perform
  11835. manual instantiations. Still, if the speed difference is
  11836. not important, it can be re-enabled by defining the macro
  11837. SWIG_STD_DEFAULT_INSTANTIATION (see std_common.i).
  11838. Also, normalizing the INPUT/OUTPUT/INOUT typemaps. Now
  11839. they use the same conversors than the rest of the
  11840. typemaps, and you can use them for std::pair, std::string
  11841. and all the other STL types, like in:
  11842. void p_inoutd(std::pair<double, double> *INOUT);
  11843. Added the attribute.i and implicit.i files with macros to
  11844. transform functions pairs like 'set_x'/'get_x'
  11845. (or 'T& x()'/'const T& x() const') into an attribute,
  11846. and allowing the use of implicit constructors in typemaps
  11847. (see the files for more details).
  11848. 03/21/2004: mkoeppe
  11849. [Guile] Fix the documentation strings of functions with
  11850. anonymous arguments.
  11851. 03/18/2004: mmatus
  11852. [Python] More general std_string.i interface.
  11853. Now you can wrap it using
  11854. %template(string) std::basic_string<char>;
  11855. and use the std::string as a base class:
  11856. struct A : std::string {
  11857. };
  11858. But more important, swig will recognize
  11859. both std::basic_string<char> and std::string as
  11860. the same type.
  11861. 03/16/2004: mmatus
  11862. Previously added, but not mentioned before:
  11863. - friend declaration support, swig now emits a global
  11864. function in the same class scope.
  11865. - ref/unref features: to mix ref counting C++ classes
  11866. and native script ref counting mechanisms (like in python).
  11867. Use it like:
  11868. %feature("ref") RCObj "$this->ref();"
  11869. %feature("unref") RCObj "$this->unref();"
  11870. And the class RCObj, and all the derived ones, will
  11871. perform the right ref/unref calls when a new pointer
  11872. is returned to the target language, or when the target
  11873. language attempts to delete the object.
  11874. See the refcount.i file in the test-suite for more
  11875. details.
  11876. 03/16/2004: mmatus
  11877. [Python] Using the new %fragment support, major rewrote
  11878. of the python swig library, including:
  11879. - Almost automatic template/typemap instantiation for
  11880. the STL components. For example, now you can write:
  11881. %template(vector_i) std::vector<int>;
  11882. and a specialized vector_i class is emitted with all
  11883. the needed typemaps. No need to use the old
  11884. 'specialize_vector' macros.
  11885. Note you can also define
  11886. %template(matrix_i) std::vector<std::vector<int> >;
  11887. %template(vector_pii) std::vector<std::pair<int,int> >;
  11888. - The empty template instantiation
  11889. %template() std::vector<int>;
  11890. defines the vector typemaps, but no proxy class. For all the
  11891. fundamental types, the empty template instantiation are
  11892. defined, so, you can say
  11893. %include std_vector
  11894. int func(const std::vector<int>& a);
  11895. where the proper typemap is applied to 'a', but no
  11896. std::vector<int> proxy is generated.
  11897. - All the STL containers present a more uniform behavior and
  11898. more complete interface declaration. The following are
  11899. now supported:
  11900. std::vector<T>
  11901. std::list<T>
  11902. std::deque<T>
  11903. std::set<T>
  11904. std::multiset<T>
  11905. std::map<T>
  11906. std::multimap<T>
  11907. not a container, but also supported:
  11908. std::pair<T,U>
  11909. also, more typemaps are defined for all of them,
  11910. including varin, varout, typecheck, etc.
  11911. - Initial attempt to implement the STL containers
  11912. considering allocators, ie:
  11913. std::vector<T,A>
  11914. it is partially working, but it is just a workaround
  11915. while swig improves its template type support.
  11916. Please test with your particular setup. It seems to be
  11917. working with g++ 3.2.2, g++ 2.96, Intel icc and SGI CC
  11918. compilers, plus python 1.5.2, 2.0 and 2.3, but since
  11919. we are using templates, there is a chance you can find
  11920. some problems when using with an old C++ compiler.
  11921. 03/16/2004: mmatus
  11922. - Allowing the empty %template directive, such as
  11923. %template() std::vector<int>;
  11924. to process the class "typedef"s and "typemap"s. Before
  11925. only the internal "typedef"s were processed.
  11926. This makes possible to emit the default in/out
  11927. typemaps without the need of wrapping an specialized
  11928. vector instance.
  11929. - Adding the preprocessor extension #@ which mangles the
  11930. following macro argument, like in:
  11931. #define macro(X) #@X
  11932. macro(int) -> int
  11933. macro(std::string) -> std_s_s_string
  11934. - Fragments can now be "type specialized", as the typemaps. The
  11935. syntax is as follows
  11936. %fragment("name","header")
  11937. { /* a type independent fragment (old syntax) */ }
  11938. %fragment("name" {Type}, "header")
  11939. { /* the fragment is type dependent */}
  11940. Now fragments can also be used inside templates:
  11941. template <class T>
  11942. struct A {
  11943. %fragment("incode"{A<T>},"header") {
  11944. /* 'incode' specialized fragment */
  11945. }
  11946. %typemap(in,fragment="incode"{A<T>}) {
  11947. /*
  11948. here we use the 'type specialized'
  11949. fragment "incode"{A<T>}
  11950. */
  11951. }
  11952. };
  11953. 03/11/2004: cheetah (William Fulton)
  11954. [Java] Director bug which meant that some virtual functions overridden in
  11955. Java were not being called on some operating systems. Bug reported and fixed
  11956. by Robert de Vries and Scott Michel.
  11957. 03/02/2004: mkoeppe (Matthias Koeppe)
  11958. [Guile] In -scm mode, don't forget to check the type of string arguments.
  11959. 02/24/2004: cheetah (William Fulton)
  11960. [C#] New commandline option -namespace <name>. This allows one to specify
  11961. a C# namespace into which all C# classes are generated.
  11962. 02/23/2004: mkoeppe (Matthias Koeppe)
  11963. [MzScheme] Use FUNC_NAME rather than a bogus typemap variable for signalling
  11964. errors. Call scheme_wrong_type with a zero-based argument number.
  11965. Reported by Ondrej Pacovsky, SF #902621.
  11966. [Guile] Define FUNC_NAME also in the dispatch wrapper for overloaded
  11967. functions. Patch by John Lenz, SF #896255.
  11968. 02/22/2004: mkoeppe (Matthias Koeppe)
  11969. [Guile] In -scm mode, don't try to invoke a null destructor function.
  11970. 02/20/2004: cheetah (William Fulton)
  11971. Fixes so that the SWIG source will compile using the Digital Mars Compiler
  11972. (formerly Symantic compiler) on Windows. Submitted by Scott Michel.
  11973. 02/13/2004: mkoeppe (Matthias Koeppe)
  11974. [MzScheme] New command-line argument -noinit. Use it for building
  11975. the runtime library, where we don't want to define the functions
  11976. scheme_initialize etc. Reported by Tim Brown, SF #891754.
  11977. [MzScheme] Don't produce invalid C code when invoked with the
  11978. -declaremodule option. Reported by Tim Brown, SF #891108.
  11979. [Guile] Build the runtime library with passive linkage, to rename
  11980. the SWIG_init function uniquely.
  11981. 02/12/2004: cheetah (William Fulton)
  11982. [Java, C#] Patch submitted by Bill Hoffman which prevents SWIG from crashing
  11983. when a file for the typewrapper class cannot be opened.
  11984. 02/11/2004: cheetah (William Fulton)
  11985. [Java, C#] Overloading changes:
  11986. - Methods which are overloaded in const only no longer generate Java
  11987. code that won't compile - the first method parsed is used and a
  11988. warning is displayed. Note that this behaviour is slightly different
  11989. to the scripting languages which always uses the non-const method.
  11990. - Warning messages 509 and 512 replaced by new warning number 516, which
  11991. is more relevant to these statically typed languages as the overloaded
  11992. methods aren't 'shadowed', they are ignored.
  11993. 01/23/2004: mkoeppe (Matthias Koeppe)
  11994. [Guile] Replace the "known_classes" hash table by a node
  11995. attribute. Methods of classes in C++ namespaces now get
  11996. the proper specializer in the GOOPS declaration.
  11997. Reported by rm@mh-freiburg.de.
  11998. 01/23/2004: mkoeppe (Matthias Koeppe)
  11999. [Guile] Uniquify the argument names in GOOPS shadow method
  12000. declarations. Reported by rm@mh-freiburg.de.
  12001. 01/21/2004: sunshine (Eric Sunshine)
  12002. Revived the NextStep port of SWIG.
  12003. Fixed fatal problem in DohStrstr() caused by difference in strstr()
  12004. implementation which made %apply become entirely dysfunctional. On
  12005. NextStep, strstr("foo","") evaluates to NULL; whereas, on modern
  12006. platforms, it evaluates to "foo". %apply relies extensively upon
  12007. strstr("foo","") evaluating to non-NULL, therefore it failed
  12008. catastrophically when faced with NextStep's strstr().
  12009. Added `bool' check to configure.in since NextStep's C++ compiler
  12010. does not supply this type. swig.h now fakes up `bool' if needed.
  12011. Worked around NextStep C++ compiler bug in which C++ code is
  12012. disallowed inside extern "C" functions. This problem affected all
  12013. language modules, since they publish hook functions of the form:
  12014. extern "C" Language *swig_foo(void) { return new FOO(); }
  12015. Fixed by creating a C++ wrapper:
  12016. static Language *new_swig_foo() { return new FOO(); }
  12017. extern "C" Language *swig_foo(void) { return new_swig_foo(); }
  12018. Ensured that Swig_copy_string() is used in place of strdup() since
  12019. NextStep does not supply strdup().
  12020. Fixed detection of Ruby library name and location in configure.in.
  12021. Problem 1: Assumed that library always resided in Ruby's "archdir",
  12022. which was correct for Ruby 1.6.x, but which is incorrect for Ruby
  12023. 1.8.x, in which case the library normally resides in Ruby's
  12024. "libdir". Problem 2: Assumed that the library could always be
  12025. linked via "-l"+RUBY_INSTALL_NAME (where RUBY_INSTALL_NAME
  12026. typically is "ruby"), however this failed for platforms, such as
  12027. NextStep, which do not support shared libraries. In this case, the
  12028. static library name in 1.8.x is libruby-static.a, thus
  12029. -lruby-static is required. The new logic works correctly for
  12030. static and shared libraries for 1.6.x and 1.8.x.
  12031. Fixed detection of Perl CFLAGS in configure.in for NextStep.
  12032. Detection code extracted CFLAGS from Perl's %Config hash but
  12033. neglected to add a newline to the value before passing it through
  12034. `sed'. NextStep's ancient `sed' discards input which is not
  12035. terminated with a newline, thus Perl CFLAGS always evaluated to the
  12036. empty string.
  12037. 01/16/2004: cheetah (William Fulton)
  12038. Tidy up in the exception handling code that is generated when
  12039. C++ exception specifications are wrapped with the throws typemap.
  12040. This redundant code is no longer generated:
  12041. catch(...) {
  12042. throw;
  12043. }
  12044. 01/12/2004: wsfulton on behalf of mmatus (marcelo matus)
  12045. if a method uses %exception and the method requires the use
  12046. of the throws typemap, the code in a throws typemap will be
  12047. generated inside the try body. For example:
  12048. %exception method {
  12049. try {
  12050. // method action
  12051. $action
  12052. } catch (int i) {
  12053. // method int catch handler
  12054. } catch (...) {
  12055. // method generic catch handler
  12056. }
  12057. }
  12058. %typemap(throws) Except %{
  12059. // throws typemap Except catch handler
  12060. %}
  12061. %inline %{
  12062. class Except {};
  12063. void method(int i) throw (Except);
  12064. Will generate:
  12065. {
  12066. try {
  12067. // method action
  12068. try {
  12069. method(arg1);
  12070. }
  12071. catch(Except &_e) {
  12072. // throws typemap Except catch handler
  12073. }
  12074. } catch (int i) {
  12075. // method int catch handler
  12076. } catch (...) {
  12077. // method generic catch handler
  12078. }
  12079. }
  12080. As can be seen, the inner try catch block is for the throws typemaps.
  12081. Previously, this was reversed so that the inner try catch block
  12082. was the %exception code. In the example above, it would have been
  12083. impossible to catch Except as the catch all (...) would catch the
  12084. exception instead.
  12085. Version 1.3.21 (January 11, 2004)
  12086. =================================
  12087. 01/10/2004: cheetah (William Fulton)
  12088. The output format for both warnings and errors can be selected for
  12089. integration with your favourite IDE/editor. Editors and IDEs can usually
  12090. parse error messages and if in the appropriate format will easily take you
  12091. directly to the source of the error. The standard format is used by
  12092. default except on Windows where the Microsoft format is used by default.
  12093. These can be overridden using command line options, for example:
  12094. $ swig -python -Fstandard example.i
  12095. example.i:4: Syntax error in input.
  12096. $ swig -python -Fmicrosoft example.i
  12097. example.i(4): Syntax error in input.
  12098. 01/09/2004: beazley
  12099. Fixed [ 871909 ] simple namespace problem.
  12100. This was a problem using anonymous structures in a namespace.
  12101. For example:
  12102. namespace ns {
  12103. typedef struct {
  12104. int n;
  12105. } S;
  12106. };
  12107. Reported by Josh Cherry.
  12108. 01/09/2004: beazley
  12109. Fixed some broken Perl examples.
  12110. 12/28/2003: cheetah (William Fulton)
  12111. [Java and C#] Fixes for wrapping covariant (polymorphic) return types.
  12112. For example:
  12113. struct Base {
  12114. virtual ~Base();
  12115. virtual Base* copy() const = 0;
  12116. };
  12117. struct Derived : Base {
  12118. virtual Derived* copy() const;
  12119. };
  12120. The Derived::copy proxy method returns Base not Derived. A warning is issued
  12121. about this. Previously the pointer used by the proxy class was incorrectly
  12122. treated as a Base* instead of a Derived*.
  12123. 12/18/2003: cheetah (William Fulton)
  12124. Fix so that Windows paths are displayed correctly when reporting errors.
  12125. An error previously would have been shown something like:
  12126. .?xample.i:14: Syntax error in input.
  12127. instead of:
  12128. .\example.i:14: Syntax error in input.
  12129. Version 1.3.20 (December 17, 2003)
  12130. ==================================
  12131. 12/17/2003: beazley
  12132. Last minute modifications. Perl5 module now generates shadow classes
  12133. by default like all of the other modules. PHP4 wrappers no longer
  12134. include "config.h".
  12135. 12/14/2003: beazley
  12136. Weakened warning message related to constructor names so that an
  12137. unusual nested-class wrapping technique would work again (apparently
  12138. it worked in some older SWIG releases). For example:
  12139. class Scope {
  12140. class ClassA;
  12141. class ClassB;
  12142. };
  12143. class Scope::ClassA {
  12144. ...
  12145. };
  12146. class Scope::ClassB {
  12147. ...
  12148. }
  12149. Note: There is still some odd interaction with the SWIG symbol
  12150. table/type system that will need to be looked at in a future release.
  12151. Reported by Gustavo Niemeyer.
  12152. 12/11/2003: cheetah (William Fulton)
  12153. [Java] Protected class methods are wrapped as protected Java methods
  12154. when using the dirprot director feature. This can be changed using
  12155. %javamethodmodifiers to something else should the need arise, for
  12156. example, private or package access.
  12157. 12/11/2003: cheetah (William Fulton)
  12158. [Java, C#]
  12159. %javamethodmodifiers (Java) and %csmethodmodifiers (C#) operate slightly
  12160. differently. Previously this feature had to be present to set the method
  12161. modifiers. Now it is only used if it exists for the method being wrapped.
  12162. The default is "public" as previous however, when wrapping protected
  12163. director methods it is "protected". This change will not affect existing
  12164. use of the %javamethodmodifiers or %csmethodmodifiers.
  12165. 12/11/2003: mmatus (Marcelo Matus)
  12166. This fix some recurring reports about keywords not been
  12167. properly identified and warned, and it solves the problem
  12168. of how to add a test file to the test-suite such that it
  12169. doesn't use any keyword of all the supported languages
  12170. (and doing it without compiling the test for all the
  12171. supported languages, thing that is not always possible,
  12172. and without requiring you to know all the supported
  12173. language keywords, thing that is always impossible).
  12174. So these are the changes globally speaking:
  12175. - Uniform the definition of the keyword warnings through
  12176. the supported languages: all the languages has now a
  12177. separate file that defines the keywords or bad names:
  12178. python/pythonkw.swg
  12179. chicken/chickenkw.swg
  12180. ....
  12181. - Added keyword list for most of the languages that didn't
  12182. have one (using the new separated file).
  12183. - Added the "All keywords" warning support: -Wallkw option.
  12184. This option allows you to include all the known keywords
  12185. for all the supported languages, and can be used as:
  12186. swig -Wallkw ....
  12187. This will help to the process of adding a test-suite
  12188. file that can be compiled in all the swig supported
  12189. languages, and it will be also helpful for users who
  12190. want to create multi-language libraries.
  12191. And these are the detailed changes (mostly file addition):
  12192. - For the languages that already have some sort of keyword
  12193. warning list, move it to an external languagekw.swg
  12194. file, ie:
  12195. move keywords from python.swg -> pythonkw.swg
  12196. move keywords from chicken.swg -> chickenkw.swg
  12197. move keywords from tcl8.swg -> tclkw.swg
  12198. and re-include languagekw.swg from language.swg.
  12199. - For the language that didn't have a keyword list, and
  12200. for the ones that I could find a list, add the
  12201. languagekw.swg file, ie:
  12202. csharp/csharpkw.swg
  12203. java/javakw.swg
  12204. php4/phpkw.swg
  12205. pike/pikekw.swg
  12206. ruby/rubykw.swg
  12207. also add a line in language.swg to include
  12208. languagekw.swg, but now it is commented!!!, like in
  12209. java.swg:
  12210. /* java keywords */
  12211. /* please test and activate */
  12212. //%include "javakw.swg"
  12213. ie, there will be no change in how swig runs normally
  12214. until the language maintainer test and uncomment that
  12215. line.
  12216. So, please check each languagekw.swg file (I left the
  12217. link to the keyword list source for checking), and after
  12218. testing, uncomment the %include line.
  12219. - Added the file allkw.swg, which includes all the
  12220. languagekw.swg files.
  12221. For the languages that has no languagekw.swg file right
  12222. now, and if they need one, add the file into the
  12223. language directory, and add the corresponding include
  12224. line into the allkw.swg file.
  12225. - Added the -Wallkw that includes the allkw.swg file.
  12226. Note that the old -lallkw.swg option couldn't be used
  12227. since it include the file after it would be needed.
  12228. Hopefully, the -Wallkw option will be added to the default
  12229. rules in the related test-suite Makefiles, so, when
  12230. creating a new test, or adding a new swig library file
  12231. (like _std_deque.i), swig will warn you if you are using a
  12232. bad name, considering all the language where it needs to
  12233. run.
  12234. Right now you can test it by using:
  12235. make check-python-test-suite SWIG="swig -Wallkw"
  12236. or using your favorite target language, it doesn't matter.
  12237. And yes, there are several examples that are using
  12238. reserved keywords, specially from csharp.
  12239. *** Remember ****: the new keyword warning lists are not
  12240. included by default in any of language that before didn't
  12241. have one. To enable the keyword warnings as the default
  12242. behavior, the inclusion of the languagekw.swg file has to
  12243. be uncommented at each language.swg file.
  12244. So, all the language maintainers, please check the
  12245. keywords list.
  12246. Also, you can add buit-in names, and not only keywords, like
  12247. 'True/False' in python. Remember that you can be more
  12248. specific and refer only to member names, like *::configure
  12249. or *::cget (see an example in the tcl8/tcl8kw.swg file),
  12250. or only global names, like ::range (see an example in the
  12251. python/pythonkw.swg file.
  12252. Just to be consistent, use the following codes:
  12253. - Use code 314 for keyword and/or fatal bad names.
  12254. - Use code 321 for buit-in and/or not fatal bad names.
  12255. so, they can't be disabled/enabled independently (see
  12256. python/pyhtonkw.swg for examples).
  12257. **** And don't add any new test file without checking it
  12258. with the -Wallkw option!! (that includes me) *****.
  12259. 12/11/2003: cheetah (William Fulton)
  12260. SF bug #854634
  12261. Added support for accepting the Unix directory separator '/' on
  12262. Windows and the Mac in addition to the native one ( '\' on
  12263. Windows). This can be used in %import, %include and commandline
  12264. options taking a path, for example -I. On Cygwin, both the Windows
  12265. and Unix directory separator can now be used (was '/' only).
  12266. 12/10/2003: mmatus (Marcelo Matus)
  12267. [python] Implementing the runtime "reprotected" director
  12268. members, if you have:
  12269. %feature("director") B;
  12270. class Bar {
  12271. public:
  12272. virtual ~Bar();
  12273. virtual int hello() { return do_hello();)
  12274. protected:
  12275. virtual int do_hi() {return 0;}
  12276. virtual int do_hello() {return 0;}
  12277. };
  12278. then, at the python side
  12279. import my_module
  12280. class Foo(my_module.Bar):
  12281. def do_hello(self):
  12282. return 1
  12283. pass
  12284. b = Bar() # Pure C++ Director class
  12285. f = Foo() # C++ Director + python methods
  12286. b.hello() # Ok, and it calls C++ Bar::do_hello()
  12287. f.hello() # Ok, and it calls Python Foo::do_hello()
  12288. b.do_hi() # RuntimeError, do_hi() is protected!!
  12289. f.do_hi() # RuntimeError, do_hi() is protected!!
  12290. b.do_hello() # RuntimeError, do_hello() is protected!!
  12291. f.do_hello() # Ok, since it its redefined in python.
  12292. Here Bar.do_hello is always protected, but Foo.do_hello
  12293. is "public", because it is redefined in python. Before,
  12294. all the 'do_hello' methods were public.
  12295. This seems to be a good compromise between C++ and python
  12296. philosophies, ie, all the director protected methods keep
  12297. protected at the user side (C++ way) until they are
  12298. redefined (python way, were all defined methods are always
  12299. public). And this is not only a good compromise, it also
  12300. seems to be the only way to do it :).
  12301. Now ruby has native director protected members, and python
  12302. pure runtime support. I guess these are the two possible
  12303. extreme cases. And hopefully, they could be used as
  12304. templates to modify the other languages that support
  12305. directors, so they can "reprotect" the protected director
  12306. members at the target language side.
  12307. This finished the director protected support for the
  12308. python language. Ocalm will need to add the
  12309. "reprotection" later.
  12310. 12/10/2003: mmatus (Marcelo Matus)
  12311. The following case (reported by Lyle Johnson) was fixed:
  12312. %rename(x) Foo::y();
  12313. class Foo {
  12314. public:
  12315. void y();
  12316. protected:
  12317. int x;
  12318. };
  12319. swig warned that the symbol 'x' was already defined, and
  12320. the renaming fails. 'x' was not emitted, since it is
  12321. protected, but it was kept in the symbol table with too
  12322. much information.
  12323. Now swig works for all the cases (plain, director and
  12324. dirprot) again. This was fixed by allowing the parser.y to
  12325. decide much closer what to do with 'x'. Before all the
  12326. discarding or generation was resolved at the lang.cxx
  12327. stage. Also the changes in parser.y to implement the
  12328. director protected mode are now much more encapsulated, and
  12329. they get disabled if the mode is not enabled. Before the
  12330. deactivation was done at the generation stage (lang.cxx).
  12331. By the other hand, if the director mode is enabled, and
  12332. %rename is done, reusing a protected member name, there is
  12333. a pathological case:
  12334. %rename(x) Foo::y();
  12335. class Foo : public A {
  12336. public:
  12337. void y();
  12338. protected:
  12339. int x; /* works */
  12340. static int x; /* works */
  12341. static void x(); /* works */
  12342. typedef void x(); /* works */
  12343. virtual void x(); /* always fails, as it should, since
  12344. Foo::x() will be emitted in the
  12345. director */
  12346. void x(); /* always fails, but sometimes it shouldn't,
  12347. since the Foo::x() will not be emitted if
  12348. it is not virtual */
  12349. };
  12350. The last case is not always right because at the parser.py
  12351. stage it is not possible to decide if the protected member
  12352. Foo::x() could or not conflict with the renamed Foo::y(),
  12353. since Foo::x() could be virtual by inheritance.
  12354. I guess this just an intrinsic limitation, and no much can
  12355. be done about it without resorting into larger changes to
  12356. postpone, under certain conditions, the multiply symbol
  12357. detection (lang.cxx stage).
  12358. So, by now, it is just considered a well known "feature" in
  12359. the director protected mode. The good news is that it seems
  12360. to be a rare case, and it can be avoided by the user by
  12361. hiding 'x' before renaming 'y':
  12362. %rename(_x) Foo::x();
  12363. %rename(x) Foo::y();
  12364. 12/08/2003: mmatus (Marcelo Matus)
  12365. The virtual method detections now properly
  12366. treats the following cases:
  12367. namespace foo { typedef int Int; }
  12368. struct A {};
  12369. typedef A B;
  12370. struct Foo {
  12371. virtual ~Foo() {}
  12372. virtual Foo* cloner() = 0;
  12373. virtual int get_value() = 0;
  12374. virtual A* get_class() = 0;
  12375. virtual void just_do_it() = 0;
  12376. };
  12377. struct Bar : Foo
  12378. {
  12379. Bar* cloner();
  12380. foo::Int get_value();
  12381. B* get_class();
  12382. void just_do_it();
  12383. };
  12384. All the Foo and Bar methods are virtual. A new attribute
  12385. "virtual:type" record the base polymorphic type. In the
  12386. previous cases we have:
  12387. type : Bar virtual:type : Foo
  12388. type : foo::Int virtual:type : int
  12389. type : B virtual:type : A
  12390. type : void virtual:type : void
  12391. This attribute is useful in languages (java+directors)
  12392. that could have problems redefining Bar* Bar::cloner().
  12393. If you never had code like the above, you will see no
  12394. effects. But if you have some code like that, you
  12395. will see some effects since some methods that
  12396. before were not properly treated as virtual,
  12397. will start to act like that. This could enlarge
  12398. your director classes.
  12399. 12/08/2003: mmatus (Marcelo Matus)
  12400. The director protected member support (dirprot)
  12401. is disabled by default.
  12402. It can be enable by using '-dirprot' or by adding
  12403. the option to the module declaration, like:
  12404. %module(directors="1",dirprot="1") my_module
  12405. This module option was added to properly compile the
  12406. director_protected.i and director_nested.i examples.
  12407. The feature has been tested with python[2.2,2.3]
  12408. and ruby[1.6.7], both at compilation and runtime, and
  12409. java[j2sdk1.4.1_01], but only at compilation (my java
  12410. installation doesn't run any of the director examples,
  12411. olds nor news).
  12412. Please test for ocaml and java.
  12413. The errors reported by William and Scott were fixed,
  12414. except for a warning about SWIG_JavaThrowExecption()
  12415. multiply defined. I can't reproduce this error with my
  12416. examples. We will wait for Scott to send us a minimal
  12417. case.
  12418. 12/07/2003: mmatus (Marcelo Matus)
  12419. The director protected member support has been
  12420. completly moved out from python.cxx, and now
  12421. resides in the common lang.cxx, emit.cxx and
  12422. allocate.cxx files.
  12423. This means it should work for all the other languages
  12424. that currently support directors, ie, python, java, ocalm
  12425. and ruby.
  12426. The change has been tested with python (compilation+runtime)
  12427. and java (just compilation).
  12428. Please add runtime tests for the missing languages
  12429. and test it.
  12430. The '-nodirprot' option was moved to the principal main,
  12431. and can be used from all the languages.
  12432. 12/07/2003: cheetah (William Fulton)
  12433. [Java] Fixed and improved error checking of STRING_OUT typemaps in
  12434. various.i.
  12435. 12/04/2003: mmatus (Marcelo Matus)
  12436. - Now the virtual members with no explicit declarator
  12437. are properly identified:
  12438. struct A {
  12439. virtual int f() = 0;
  12440. };
  12441. struct B : A {
  12442. int f();
  12443. };
  12444. Here, B::f() is virtual, and the director and the
  12445. virtual elimination mechanism now recognize that.
  12446. - [C#] This fix also fixes the problem where 'override' was not being
  12447. used on any overridden virtual method, so for struct B above,
  12448. this C# code is generated:
  12449. public class B : A {
  12450. ...
  12451. public override int f() {
  12452. ...
  12453. }
  12454. ...
  12455. }
  12456. - Initial support for protected virtual methods. They are now
  12457. properly emitted when using with director (python only by
  12458. now).
  12459. %feature("director") A;
  12460. struct A {
  12461. protected:
  12462. virtual int f1() = 0;
  12463. };
  12464. %feature("director") B;
  12465. struct B : A{
  12466. protected:
  12467. int f1();
  12468. virtual f2();
  12469. };
  12470. This can be dissabled by using the '-nodirprot' option.
  12471. - The feature 'nodirector' is working now at the top level,
  12472. so, it must work for all the languages:
  12473. %feature("director") A;
  12474. %feature("nodirector") A::f2;
  12475. struct A {
  12476. virtual int f1();
  12477. virtual int f2();
  12478. };
  12479. in this case, only 'f1' is exported to the director class.
  12480. - Added director support for const TYPE& arguments (python).
  12481. 12/02/2003: cheetah (William Fulton)
  12482. [Java] Fix for INOUT and OUTPUT typemaps in typemaps.i for when the JNI type
  12483. is bigger than the C type. For example, unsigned long (32bits on most systems)
  12484. is mapped to jlong (64bits). Returned value was incorrect. Bug reported by
  12485. Brian Hawley.
  12486. 12/02/2003: cheetah (William Fulton)
  12487. [C# and Java] Better fix for entry dated 05/11/2003. Fixes the following
  12488. typemaps:
  12489. Java: javabase, javainterfaces, javaimports, javaclassmodifiers,
  12490. javaptrconstructormodifiers, javafinalize, javagetcptr & javacode.
  12491. C#: csbase, csinterfaces, csimports, csclassmodifiers,
  12492. csptrconstructormodifiers, csfinalize, csgetcptr & cscode.
  12493. It also fixes bug in using arrays of C structs with arrays_java.i
  12494. as reported Scott Michel.
  12495. 12/02/2003: beazley
  12496. [Perl] Fixed [ 852119 ] recursive inheritance in output .pm, perl5.
  12497. Reported by William Dowling.
  12498. 12/02/2003: beazley
  12499. [Tcl] Fixed [ 755382 ] calling func(const vector<T>& p) evaluates p[0] in interp.
  12500. The Tcl type checker was improperly handling the interpreter result when
  12501. type violations were supposed to be ignored.
  12502. Reported by Flaviu Popp-Nowak.
  12503. 11/30/2003: cheetah (William Fulton)
  12504. Fixed [ 545058 ] configure's --with-tclincl has no effect
  12505. 11/30/2003: cheetah (William Fulton)
  12506. [Java] Fixed [ 766409 ] missing symbol SWIG_JavaThrowException during module load
  12507. SWIG's internal functions are all static as there is no need for different SWIG
  12508. generated modules to share any code at runtime.
  12509. 11/30/2003: beazley
  12510. [Tcl] Added support for C++ pointers to members.
  12511. 11/28/2003: cheetah (William Fulton)
  12512. Fixed [ 848335 ] Directors: #include wrapper .h file - was incorrectly
  12513. adding a directory to the generated #include "foo_wrap.h" statement
  12514. in some situations.
  12515. 11/28/2003: cheetah (William Fulton)
  12516. [Java] Fixed [ 849064 ] JAVA : Access modifier for derived class wrong.
  12517. The delete() method is always public now. It used to be protected whenever a
  12518. destructor was non public. An UnsupportedOperationException runtime
  12519. exception is thrown instead of making delete() protected now.
  12520. 11/28/2003: beazley
  12521. [Perl5] Added support for C++ pointers to members.
  12522. 11/28/2003: beazley
  12523. Fixed [ 850151 ] PYVERSION with python2.3 in configure of SWIG 1.3.19 (Maybe).
  12524. 11/28/2003: beazley
  12525. Fixed [ 850666 ] #include extra line added.
  12526. This should fix some problems with getting correct line numbers on
  12527. error messages.
  12528. 11/26/2003: beazley
  12529. Fixed another one of Marcelo's evil template bugs (infinite
  12530. recursion). [ 849504 ] template and typedef -> inf. recursion.
  12531. 11/26/2003: beazley
  12532. Fixed parsing problem with declarations like this:
  12533. int *x = &somearray[0];
  12534. 11/25/2003: beazley
  12535. Fixed [ 756552 ] missing default argument class scope with "|".
  12536. This is really only a band-aid fix for use of class-enums in
  12537. expressions. For example:
  12538. class A {
  12539. public:
  12540. enum Flag { flag1 = 0x1, flag2 = 0x2 };
  12541. void foo(int x = flag1 | flag2);
  12542. };
  12543. Note: there are still some (more subtle) cases that are broken,
  12544. but hard to fix due to an issue with template expansion. Will
  12545. address later.
  12546. Reported by Dmitry Mironov.
  12547. 11/25/2003: beazley
  12548. Incorporated [ 840878 ] support for %inline { ... } (PATCH).
  12549. This adds support for the following:
  12550. %inline {
  12551. ... some code ...
  12552. }
  12553. The difference between this and %inline %{ ... %} is that the
  12554. enclosed text is processed by the SWIG preprocessor. This
  12555. allows special macros and other processing to be used in
  12556. conjunction with %inline.
  12557. Contributed by Salvador Fandino Garcia.
  12558. 11/25/2003: beazley
  12559. Fixed [ 836903 ] C++ inconsistency (with void arguments).
  12560. SWIG was having difficulty with f() vs f(void) in C++ programs.
  12561. For instance:
  12562. class A {
  12563. public:
  12564. virtual void f(void) = 0;
  12565. };
  12566. class B {
  12567. public:
  12568. virtual void f(); // Not matched to f(void) correctly
  12569. };
  12570. The parser now normalizes all declarations of the form f(void)
  12571. in C++ classes to f(). This should fix a variety of subtle
  12572. problems with inheritance, optimizations, overloading, etc.
  12573. Problem reported by Partho Bhowmick.
  12574. 11/25/2003: beazley
  12575. [Perl5] Incorporated [ 841074 ] better croaking (PATCH). This fixes some problems
  12576. with strings and provides some new error functions.
  12577. Contributed by Salvador Fandino Garcia.
  12578. 11/25/2003: beazley
  12579. Fixed [ 791835 ] Default argument with cast: txt = (char *)"txt" syntax Error.
  12580. The parser should now accept things like this:
  12581. void foo(char *s = (char *) "Hello");
  12582. Problem reported by Claudius Schnorr.
  12583. 11/24/2003: beazley
  12584. [Tcl] Fixed problem with cross module linking. Previously modules referred
  12585. to base classes through a global variable. Now, the module looks up base
  12586. classes through the type system itself---avoiding the need to link to a global
  12587. like before. Caveat: modules with base classes must be loaded before
  12588. modules with derived classes.
  12589. 11/24/2003: mkoeppe (Matthias Koeppe)
  12590. [Guile] In -scm mode, use () to represent null pointers,
  12591. as it is done in -gh mode.
  12592. 11/23/2003: mkoeppe (Matthias Koeppe)
  12593. Add a generated script "preinst-swig", which can be used
  12594. to invoke SWIG before it has been installed. It arranges
  12595. that the runtime libraries from the source directory are
  12596. used.
  12597. 11/23/2003: mkoeppe (Matthias Koeppe)
  12598. [Guile] In -gh mode, don't forget to call SWIG_Guile_Init.
  12599. Add a SWIG_contract_assert macro.
  12600. 11/23/2003: mkoeppe (Matthias Koeppe)
  12601. [MzScheme] Update the configure check for the dynext object to work
  12602. with MzScheme 205.
  12603. 11/20/2003: mmatus
  12604. Fixed the include/import error reported by Kerim Borchaev,
  12605. where two files with names like
  12606. 'dir1/hello.i'
  12607. 'dir2/hello.i'
  12608. can not be include at the same time. Swig was including
  12609. just the first one, assuming the second one was not a
  12610. different one, since it was checking/keeping just the
  12611. basename 'hello.i'.
  12612. 11/19/2003: beazley
  12613. Changes to the SWIG runtime library support.
  12614. - The -c command line option has been renamed to -noruntime
  12615. - New command line option: -runtime. When supplied, this
  12616. inserts the symbol SWIG_GLOBAL into the wrapper code. This,
  12617. in turn, makes all of the runtime support functions globally
  12618. visible.
  12619. - New library file: swigrun.i. Used to create modules
  12620. for runtime library (if needed).
  12621. 11/18/2003: cheetah (William Fulton)
  12622. 'make srcrpm' rpmbuild fix - patch from Joe Cooper
  12623. 11/18/2003: mkoeppe (Matthias Koeppe)
  12624. [Guile] Change meaning of configure option --with-guile to
  12625. the name of the Guile executable. The new option --with-guile-prefix
  12626. can be used to specify the tree where Guile is
  12627. installed. (However, usually it suffices to use the
  12628. single option --with-guile-config.)
  12629. When running the run tests test-suite, make sure to use the
  12630. version of Guile that SWIG was configured for.
  12631. 11/17/2003: mkoeppe (Matthias Koeppe)
  12632. [Guile] Improvements to object-ownership management in
  12633. "-scm" mode. (They do not apply to the default "-gh" mode.)
  12634. * Renamed the smob type that indicates that the object can
  12635. be garbage collected from "collected swig" to "collectable
  12636. swig", which is more precise.
  12637. * Export the destructor functions again. It is now
  12638. allowed to explicitly call destructors, even for
  12639. garbage-collected pointer objects. A pointer object
  12640. that has been passed to a destructor is marked in a
  12641. special way using a new smob type, "destroyed swig".
  12642. (This helps avoid nasty memory bugs, where references to
  12643. dead C objects are still held in Scheme. Moreover, the
  12644. garbage collector will not try to free a destroyed
  12645. object once more.)
  12646. * Destructor-like functions can also mark their arguments
  12647. as destroyed by applying the typemap SWIGTYPE *DESTROYED.
  12648. (It calls the function SWIG_Guile_MarkPointerDestroyed.)
  12649. * Functions that "consume" their objects (or that "own"
  12650. them after the call) can mark their arguments as
  12651. not garbage collectable. This can be done by applying
  12652. the typemap SWIGTYPE *CONSUMED. (It calls the function
  12653. SWIG_Guile_MarkPointerNoncollectable.)
  12654. * The macro TYPEMAP_POINTER_INPUT_OUTPUT from library
  12655. pointer-in-out.i creates additional typemaps
  12656. PTRTYPE *INPUT_CONSUMED, PTRTYPE *INPUT_DESTROYED.
  12657. They mark the passed pointer object likewise.
  12658. The typemap PTRTYPE *OUTPUT creates a garbage-collectable
  12659. pointer object, like %newobject does for a returned
  12660. pointer. Use the new typemap PTRTYPE *OUTPUT_NONCOLLECTABLE
  12661. to create a pointer object that will not be garbage collected.
  12662. 11/17/2003: mkoeppe (Matthias Koeppe)
  12663. [Guile] Handle $input in "freearg" typemaps.
  12664. Never qualify GOOPS slot names with the class name.
  12665. Handle optional arguments properly in the GOOPS methods.
  12666. 11/16/2003: cheetah (William Fulton)
  12667. Fixes for installation to work with the upcoming Automake-1.8.
  12668. mkinstalldirs was being used by a non-Automake makefile.
  12669. mkinstalldirs is being phased out and so was not being
  12670. created by Automake. install-sh used instead.
  12671. 11/16/2003: cheetah (William Fulton)
  12672. [Java] Numerous director improvements, tweaks and bug fixes since
  12673. the initial implementation have been contributed by Scott Michel.
  12674. 11/12/2003: beazley
  12675. [Python] When %feature("shadow") is used to add code to shadow
  12676. classes, the special variable $action expands to the name of the
  12677. underlying wrapper function that would have been called normally.
  12678. 11/12/2003: beazley
  12679. [Python] When generating proxy class code, SWIG emits a few
  12680. default methods for __repr__() and other Python special
  12681. methods. Some of these methods are emitted after all of the
  12682. contents of a class. However, this makes it hard to override
  12683. the methods using %pythoncode and some other directives that
  12684. allow code to be inserted into a class. These special methods
  12685. are now emitted into the code *before* all of the other methods.
  12686. Suggested by Eric Jones.
  12687. 11/11/2003: beazley
  12688. Preprocessor enhancement. For include statements like this:
  12689. %include "foo/bar.i"
  12690. the directory "foo" is now added to the search path while
  12691. processing the contents of bar.i. Thus, if bar.i includes other
  12692. files in the same directory, they will be found. Previously,
  12693. you would have to add additional directories using -I to make this
  12694. work correctly. Note: the C preprocessor seems to behave in
  12695. an identical manner on many (most? all?) systems.
  12696. Suggested by Kerim Borchaev.
  12697. 11/11/2003: beazley
  12698. Configuration changes to make SWIG work on Mac OS X 10.3.x (Panther).
  12699. Tested with Python, Tcl, Perl, and Ruby---all of which seem to work.
  12700. 11/08/2003: cheetah (William Fulton)
  12701. [Java] Fixed the typemaps in various.i which were mostly broken.
  12702. char **STRING_IN and char **STRING_RET typemaps replaced with
  12703. STRING_ARRAY. float *FLOAT_ARRAY_RETURN typemap removed.
  12704. 11/08/2003: beazley
  12705. [Tcl] Tcl module now emits a safe module initialization function by
  12706. default. It can be removed by running 'swig -nosafe'.
  12707. 11/04/2003: mkoeppe (Matthias Koeppe)
  12708. [Guile] Only use the SCM_ API when the function
  12709. `scm_slot_exists_p' exists (needed for GOOPS support).
  12710. This function was renamed during the Guile 1.5 series
  12711. from `scm_slots_exists_p'.
  12712. Report the right runtime library when invoked with
  12713. -scm -ldflags.
  12714. 11/03/2003: mkoeppe (Matthias Koeppe)
  12715. [Chicken] Fix #782052. The --with-chickencfg configure
  12716. option (and others) were not accepted.
  12717. 11/02/2003: mkoeppe (Matthias Koeppe)
  12718. [Guile] Merge new set of GOOPS changes by John Lenz.
  12719. GOOPS objects are now manipulated directly by the C code.
  12720. Some fixes to typemap-GOOPS interaction.
  12721. 11/02/2003: mkoeppe (Matthias Koeppe)
  12722. [Guile] Remove the file argument to -scmstub and -goops.
  12723. The Scheme files are now always called MODULE.scm or
  12724. MODULE-primitive.scm, where MODULE is the module name and
  12725. "primitive" can be changed by the -primsuffix option.
  12726. The Scheme files are now placed in the directory given by
  12727. the -outdir option, or the current directory.
  12728. (Patch by John Lenz, slightly modified.)
  12729. *** INCOMPATIBILITY [Guile] ***
  12730. 11/02/2003: mkoeppe (Matthias Koeppe)
  12731. Unify the pointer-conversion runtime API. The standard
  12732. functions are:
  12733. * SWIG_NewPointerObj (POINTER, TYPE, FLAGS)
  12734. -- Create an scripting object that represents a typed
  12735. pointer. FLAGS are language specific.
  12736. * SWIG_ConvertPtr (INPUT, RESULT, TYPE, FLAGS)
  12737. -- Get a pointer from the scripting object INPUT and
  12738. store it in the place RESULT. When a type mismatch
  12739. occurs, return nonzero.
  12740. * SWIG_MustGetPtr (INPUT, TYPE, ARGNUM, FLAGS)
  12741. -- Get a pointer from the scripting object INPUT and
  12742. return it. When a type mismatch occurs, throw an
  12743. exception. If ARGNUM > 0, report it as the
  12744. argument number that has the type mismatch.
  12745. [Guile]: No changes.
  12746. [MzScheme]: No changes.
  12747. [Perl]: Add the function SWIG_NewPointerObj.
  12748. The function SWIG_MakePtr is kept.
  12749. The function SWIG_MustGetPtr is currently not
  12750. supported.
  12751. [Python]: Add the function SWIG_MustGetPtr.
  12752. [Ruby]: Add the function SWIG_MustGetPtr.
  12753. [Tcl]: Remove the "interp" argument of
  12754. SWIG_NewInstanceObj, SWIG_ConvertPtr,
  12755. SWIG_ConvertPacked, and SWIG_ConvertPtrFromString.
  12756. The function SWIG_MustGetPtr is currently
  12757. not supported.
  12758. No changes to Pike because its pointer conversion code did
  12759. not look complete. No changes to PHP4, because I did not
  12760. understand its runtime code. No changes to Chicken
  12761. because major changes are expected soon anyway. No
  12762. changes to Java, OCaml, C# because they do not seem to
  12763. have a pointer-conversion runtime API.
  12764. *** INCOMPATIBILITY [Tcl] ***
  12765. 11/02/2003: mkoeppe (Matthias Koeppe)
  12766. [Perl5, PHP4, Pike, Python, Ruby, Tcl]: Use the
  12767. preprocessor to rename external functions of the SWIG
  12768. runtime API to follow the naming convention
  12769. SWIG_<language>_<function>. This should allow linking
  12770. more than one interpreter into a program.
  12771. 10/31/2003: cheetah (William Fulton)
  12772. [C#] Fix since introducing the exception and std::string delegates.
  12773. The fix overcomes linker errors when using more than one SWIG module.
  12774. Problem reported by Andreas Schörk.
  12775. 10/31/2003: beazley
  12776. Incorporated patch: [ 823302 ] Incr Tcl support.
  12777. Contributed by Alexey Dyachenko.
  12778. Note: needs documentation.
  12779. 10/31/2003: beazley
  12780. Incorporated patch: [ 829325 ] new Python Module options and features.
  12781. Robin Dunn writes:
  12782. This patch makes a number of changes to the SWIG python module.
  12783. 1. Add -apply option, and change the default code
  12784. output to use the foo(*args, **kw) calling syntax
  12785. instead of using apply(). If the -apply option is
  12786. given then code is generated as before. This is very
  12787. similar to Patch #737281 but the new -modern option
  12788. makes the second half of that patch unnecessary so it
  12789. is not included here.
  12790. 2. Add -new_repr option. This is the same as my Patch
  12791. #797002 which I will mark as closed since it is no
  12792. longer needed. When this new option is used then the
  12793. __repr__ methods that are generated for proxy classes
  12794. will be more informative and give details about the
  12795. python class and the C++ class.
  12796. 3. Add %feature("addtofunc"). It allows you to insert
  12797. one or more lines of code inside the shadow method or
  12798. function that is already generated, instead of
  12799. replacing the whole thing like %feature("shadow") does.
  12800. For __init__ it goes at the end, for __del__ it goes
  12801. at the begining and for all others the code generated
  12802. is expanded out to be like
  12803. def Bar(*args, **kwargs):
  12804. val = _module.Foo_Bar(*args, **kwargs)
  12805. return val
  12806. and the "addtofunc" code is inserted just before the
  12807. return statement. If the feature is not used for a
  12808. particular method or function then the shorter code is
  12809. generated just like before.
  12810. 4. A little bit of refactoring to make implementing
  12811. addtofunc a little easier.
  12812. 5. Added a -modern command-line flag that will cause
  12813. SWIG to omit the cruft in the proxy modules that allows
  12814. it to work with versions of Python prior to 2.2. The
  12815. result is a simpler, cleaner and faster python proxy
  12816. module, but one that requires Python 2.2 or greater.
  12817. 10/31/2003: beazley
  12818. Incorporated patch: [ 829319 ] XML module tweaks.
  12819. This adds a new command line option -xmllite that
  12820. greatly reduces the amount of emitted XML code by
  12821. eliminating some fields mostly used in SWIG's
  12822. internal processing. Contributed by Robin Dunn.
  12823. 10/31/2003: beazley
  12824. Incorporated patch: [ 829317 ] Adds DohSplitLines function.
  12825. Contributed by Robin Dunn.
  12826. 10/29/2003: beazley
  12827. Fixed [ 827907 ] argout objects not being wrapped properly (PATH).
  12828. Patch contributed by Salvador Fandiño García.
  12829. 10/29/2003: beazley
  12830. Fixed [ 826996 ] perl type checking ignores perl subclasses.
  12831. This enhancement makes it so wrapped classes and structs can
  12832. be subclassed in Perl and used normally.
  12833. Patch contributed by Salvador Fandiño García.
  12834. 10/16/2003: cheetah (William Fulton)
  12835. [C#] IntPtr marshalled with a void* instead of int in C function
  12836. declarations. The casts thus look more conventional, for example:
  12837. // old
  12838. DllExport double SWIGSTDCALL CSharp_get_Shape_x(int jarg1) {
  12839. ...
  12840. Shape *arg1 = (Shape *) 0 ;
  12841. arg1 = *(Shape **)&jarg1;
  12842. ...
  12843. }
  12844. // new
  12845. DllExport double SWIGSTDCALL CSharp_get_Shape_x(void * jarg1) {
  12846. ...
  12847. Shape *arg1 = (Shape *) 0 ;
  12848. arg1 = (Shape *)jarg1;
  12849. ...
  12850. }
  12851. 10/14/2003: beazley
  12852. Fixed a subtle problem with overloaded methods and smart pointers.
  12853. If a class has overloaded methods like this:
  12854. class Foo {
  12855. public:
  12856. int bar(int x);
  12857. static int bar(int x, int y);
  12858. };
  12859. and the class is used as a smart pointer:
  12860. class FooPtr {
  12861. public:
  12862. Foo *operator->();
  12863. };
  12864. The SWIG would try to expose the static member Foo::bar
  12865. through FooPtr---resulting bogus wrapper code and a compiler
  12866. error.
  12867. Due to the way in which overloading is handled, it is
  12868. extremely difficult to eliminate the static method in
  12869. this case. Therefore, it is still exposed. However,
  12870. the generated code now compiles and works.
  12871. 10/05/2003: mkoeppe (Matthias Koeppe)
  12872. [Guile, MzScheme, Chicken]: Remove symbol clashes between
  12873. the runtime libraries by renaming all extern common.swg
  12874. functions with the preprocessor.
  12875. 10/05/2003: mkoeppe (Matthias Koeppe)
  12876. [Guile] Added basic GOOPS support, contributed by John Lenz.
  12877. See the documentation for details.
  12878. *** NEW FEATURE ***
  12879. 10/04/2003: mkoeppe (Matthias Koeppe)
  12880. [Guile] New option, -only-setters, which disables
  12881. traditional getter and setter procedures for structure slots.
  12882. 10/03/2003: mkoeppe (Matthias Koeppe)
  12883. [Guile] Added run test for reference_global_vars by John Lenz.
  12884. 09/30/2003: beazley
  12885. Partial solution to [ 792180 ] C++ smart-pointer/namespace mixup revisited.
  12886. The problem is not easy to fix (at least it doesn't seem so), but is
  12887. related to the instantiation of qualified templates inside of other
  12888. namespaces. SWIG now generates an error message in this case rather
  12889. than generating broken wrappers.
  12890. 09/30/2003: beazley
  12891. Fixed [ 800012 ] ENTER macro from CORE/scope.h clashes with libc search.h.
  12892. Reported by Britton Leo Kerin.
  12893. 09/30/2003: beazley
  12894. Fixed [ 811518 ] Casting ints to doubles (w/ solution?)
  12895. Addresses a problem with overloading in the Perl module.
  12896. Reported by Gerald Dalley.
  12897. 09/28/2003: mkoeppe
  12898. [Guile with -scm option] Fix typo in generated code for
  12899. procedures-with-setters. Reported by John Lenz.
  12900. 09/26/2003: beazley
  12901. Fixed [ 812528 ] externs not correct when throw is in signature.
  12902. Reported by Joseph Winston.
  12903. 09/23/2003: cheetah (William Fulton)
  12904. SWIG was generating a number of symbols that didn't comply with
  12905. the ISO C/C++ standard, in particular ISO/IEC 14882:1998(E) 17.4.3.1.2
  12906. where double underscores are forbidden as well as symbols starting with
  12907. an underscore followed by an upper case letter. Most of these have
  12908. been rooted out. See new section added to internals.html development
  12909. manual 'Symbol Naming Guidelines for Generated C/C++ Code'.
  12910. 09/23/2003: cheetah (William Fulton)
  12911. Director typemap name changes:
  12912. inv => directorin
  12913. outv => directorout
  12914. argoutv => directorargout
  12915. *** POTENTIAL INCOMPATIBILITY ***
  12916. 09/19/2003: mrose (Mark Rose)
  12917. [Python] Director constructors now default to __disown = 0,
  12918. which is the intended behavior and fixes the director_finalizer
  12919. test case under python.
  12920. 09/12/2003: cheetah (William Fulton)
  12921. [C#] - Typemaps added for std::string and const std::string &.
  12922. - New delegate for creating a C# string given a char *. It
  12923. can be used by calling SWIG_csharp_string_callback as shown
  12924. in the std::string 'out' typemap. Useful if the return type is
  12925. mapped to a C# string and the calling function is responsible
  12926. for cleaning up memory as the C# garbage collector doesn't
  12927. free the memory created in C/C++ and then returned as a C# string.
  12928. - The exception delegates have moved into an inner class in the
  12929. intermediate class, thereby freeing up the static constructor.
  12930. 09/11/2003: beazley
  12931. (Internals)
  12932. Major refactoring of iteration over lists and hashes. The
  12933. DOH library now uses iterators. They work like this:
  12934. List *l = (some list);
  12935. Iterator i;
  12936. for (i = First(l); i.item; i = Next(i)) {
  12937. // i.item contains the actual list item.
  12938. // i.item is NULL at end of list
  12939. ...
  12940. }
  12941. Hash *h = (some hash);
  12942. Iterator j;
  12943. for (j = First(h); j.item; j = Next(j)) {
  12944. // j.item contains hash table item
  12945. // j.key contains hash table key
  12946. // Both j.item and j.key are NULL at end
  12947. ...
  12948. }
  12949. The old iteration functions Firstitem(), Nextitem(), Firstkey(),
  12950. and Nextkey() are gone.
  12951. The new iterators are simpler, result in better memory use,
  12952. and may be faster. Also, there are no longer any problems
  12953. iterating over the same list/hash in multiple places at
  12954. the same time. For example, this is fine:
  12955. Iterator i,j;
  12956. for (i = First(l); i.item; i = Next(i)) {
  12957. for (j = First(l); j.item; j = Next(j)) {
  12958. ...
  12959. }
  12960. }
  12961. (This never worked in previous versions).
  12962. *** POTENTIAL INCOMPATIBILITY ***. This will probably break
  12963. third party extensions to SWIG (or give them further encouragement
  12964. to join the SWIG CVS-tree :-).
  12965. 09/10/2003: mkoeppe (Matthias Koeppe)
  12966. [Guile] Fix memory leaks in the "list-vector.i" typemaps.
  12967. 09/09/2003: mkoeppe (Matthias Koeppe)
  12968. [Chicken] Use C_mk_bool rather than C_mkbool. This fixes
  12969. the wrapping of boolean values for Chicken 1.10 and newer.
  12970. Reported by Dave <hundo@yahoo.com> / Felix Winkelmann
  12971. <felix@proxima-mt.de>.
  12972. 09/05/2003: cheetah (William Fulton)
  12973. [Java] Directors implemented for Java. In summary this is a big new feature
  12974. which supports upcalls from C++ to Java. Code is generated to support C++
  12975. callbacks to call into Java and true polymorphic behaviour for Java classes
  12976. derived from C++ classes. See java.html for details. Contributed by
  12977. Scott Michel.
  12978. 09/05/2003: Tiger
  12979. Created contract example directory at /SWIG/Examples/contract
  12980. Added simple contract examples (simple_c & simple_cxx)
  12981. Modified contract module's output format
  12982. *** NEW FEATURE ***
  12983. 09/01/2003: cheetah (William Fulton)
  12984. Test-suite build improvements:
  12985. - Multiple build directories working for the test suite, so it is now
  12986. possible to run configure in multiple subdirectories and run the test
  12987. suite in each of these sub directories.
  12988. - 'make distclean' fixed so it doesn't bomb out on the Examples directory
  12989. when using multiple subdiretory builds. Required the following directories
  12990. to be moved:
  12991. Examples/GIFPlot/Perl -> Examples/GIFPlot/Perl5
  12992. Examples/GIFPlot/Php -> Examples/GIFPlot/Php4
  12993. These new directories used to be symbolic links to the old directory.
  12994. Also the Examples/test-suite/Perl symbolic link has been removed.
  12995. - Running the test-suite, other than from the root directory, say
  12996. in Examples/test-suite/python will now display all the code being
  12997. executed.
  12998. - The following 3 C# compilers are detected during configure and work with
  12999. the test-suite: Mono, Portable.NET and Microsoft.
  13000. 09/01/2003: Tiger
  13001. Added inheritance support for design by contract feature.
  13002. 09/01/2003: beazley
  13003. Fixed [ 794914 ] Wrong types in template specialization.
  13004. SWIG was not handling arguments correctly in template
  13005. partial specialization. For example,
  13006. template<class T> class Foo<T *> {
  13007. public:
  13008. T *blah();
  13009. };
  13010. %template(FooInt) Foo<int *>;
  13011. in this class, the return type of blah was set to
  13012. 'int **', but it should really be 'int *'. This has been
  13013. fixed, but it will affect all prior uses of partial
  13014. specialization.
  13015. 09/01/2003: beazley
  13016. Fixed [ 786394 ] Patch for generated perl code does not compile under RedHat9.
  13017. Reported by Scott Finneran.
  13018. 09/01/2003: beazley
  13019. Fixed [ 791579 ] (unsigned) long long handled incorrectly (Tcl).
  13020. This was an error in the Tcl typemaps.i file.
  13021. Reported by Kjell Wooding.
  13022. 09/01/2003: beazley
  13023. Fixed [ 797573 ] no way to rename classes coming from C structures.
  13024. This problem relates to renaming of anonymous structures with a
  13025. typedef. For example:
  13026. %rename(Bar) Foo;
  13027. typedef struct {
  13028. ...
  13029. } Foo;
  13030. Reported by Britton Leo Kerin.
  13031. 09/01/2003: beazley
  13032. Fixed [ 797576 ] -help seems to imply that only tcl-specific options exist.
  13033. Added a comment to alert user to other options.
  13034. Reported by Britton Leo Kerin.
  13035. 09/01/2003: beazley
  13036. Fixed [ 798205 ] Segfault in SWIG_ConvertPtr.
  13037. Reported by Prabhu Ramachandran.
  13038. 08/30/2003: mrose (Mark Rose)
  13039. Modified the director typemaps in python/std_complex.i to use the
  13040. new-style macro and conversion functions, which eliminated some
  13041. redundant code. Fixed a few bugs in these typemaps as well, although
  13042. more testing is needed.
  13043. 08/29/2003: mrose (Mark Rose)
  13044. Completed initial support for wrapping abstract classes with directors.
  13045. Constructor wrappers will be generated for abstract classes that have
  13046. directors, and instances of the director classes will be created regardless
  13047. of whether the proxy class has been subclassed in the target language.
  13048. No checks are made during construction to ensure that all pure virtual
  13049. methods are implemented in the target language. Instead, calls to
  13050. unimplemented methods will throw SWIG_DIRECTOR_PURE_VIRTUAL_EXCEPTION
  13051. exceptions in C++.
  13052. Integrated Prabhu Ramachandran's typemap patches, which provide director
  13053. typemap support for enums and std::size_t, and fix a couple bugs in the
  13054. director std::vector<> typemaps.
  13055. 08/29/2003: cheetah (William Fulton)
  13056. [C#] Implemented exception handling for throwing C# exceptions from C/C++ code.
  13057. A few delegate functions are available for calling which then throw the C#
  13058. exception. Use the SWIG_CSharpThrowException function from C/C++ typemaps.
  13059. See the generated wrapper code or csharphead.swg for all available exceptions.
  13060. Example:
  13061. SWIG_CSharpThrowException(SWIG_CSharpException, "exception description");
  13062. The 'throws' typemaps are also now implemented, so code is automatically
  13063. generated to convert any C++ exception into a C# System.Exception when the C++
  13064. method declares an exception specification such as:
  13065. int foo() throw(Bar);
  13066. Also any parameters that are references to a C++ class or a class passed by value
  13067. and are passed as a C# null will now throw a C# NullReferenceException.
  13068. 08/29/2003: cheetah (William Fulton)
  13069. [C#] Fix to match the calling convention of all pinvoke methods so that they
  13070. match the calling convention used by default in the C# 'static extern' declarations
  13071. (__stdcall is used on Windows).
  13072. 08/19/2003: cheetah (William Fulton)
  13073. [Java] Reworked std::string typemaps. Fixes a number of string in std namespace
  13074. problems. For example %template vector<string>. The templated class' get method
  13075. wasn't returning a Java String, but a SWIGTYPE_p_string. Reported
  13076. by Zach Baum.
  13077. 08/15/2003: beazley
  13078. Fixed [ 763522 ] 1.3.19 segfault in SwigType_add_pointer/DohInsertitem.
  13079. Related to problem with unnamed class handling in Perl module.
  13080. 08/15/2003: beazley
  13081. Fixed [ 763563 ] Missing indication of optional arguments.
  13082. Tcl module. Reported by Krzysztof Kozminski.
  13083. 08/15/2003: beazley
  13084. Fixed [ 787432 ] long param handled as int. Tcl module
  13085. now uses Tcl_GetLongFromObj to convert integer values.
  13086. 08/11/2003: beazley
  13087. Fixed [ 775989 ] numeric template parameters. There were
  13088. some errors in template expansion related to the use of
  13089. arrays where the array dimension was a template parameter.
  13090. It should work now. Reported by Bryan Green.
  13091. 08/10/2003: mrose (Mark Rose)
  13092. Added a director typemap (outv) for return by value and cleaned up up a few
  13093. of the commented director typemaps.
  13094. 08/10/2003: mrose (Mark Rose)
  13095. Fixed constructor generation for director classes to ignore private
  13096. constructors. Protected constructors are also ignored for now, pending
  13097. a solution to the problem of wrapping classes that only define protected
  13098. constructors.
  13099. 08/07/2003: cheetah (William Fulton)
  13100. New commandline option -outdir <dir> to specify where the language specific
  13101. files are to be generated. This is useful for target languages like Python,
  13102. Java etc which generate proxy files in the appropriate language.
  13103. This option does not apply to the C/C++ wrapper file.
  13104. 08/07/2003: cheetah (William Fulton)
  13105. On Windows the generated files (other than the _wrap.c or _wrap.cxx files)
  13106. were sometimes incorrectly being generated into the current directory unless
  13107. the input file used the Unix path separator. The Windows path separator
  13108. should now be used. Bug reported by Robert Davies.
  13109. 08/07/2003: beazley
  13110. Added array variable set typemap to Perl module.
  13111. 08/07/2003: beazley
  13112. Fixed [ 775677 ] Array init causes codegen bug..
  13113. 08/07/2003: beazley
  13114. Fixed [ 779062 ] Class"\n"::foo not supported. SWIG
  13115. should now correctly handle whitespace in between
  13116. namespace qualifiers. For example "A :: Foo :: Bar".
  13117. 07/31/2003: cheetah (William Fulton)
  13118. Fixes for parameters which are classes that are passed by value and have
  13119. a default value. A copy constructor for SwigValueWrapper is required
  13120. (SF #780056). Also fixed memory leak in these circumstances. These mods
  13121. also fix SF #780054.
  13122. 07/28/2003: beazley
  13123. Improved run-time error message for pointers in Python module.
  13124. Contributed by Zooko.
  13125. 07/10/2003: ballabio (Luigi Ballabio)
  13126. [Almost all languages] Wrappers for std::pair added.
  13127. Typemaps for Python, Ruby, Guile and MzScheme.
  13128. 07/01/2003: mkoeppe (Matthias Koeppe)
  13129. [Chicken] Handle the case of more than one argout typemap
  13130. per function.
  13131. 06/29/2003: cheetah (William Fulton)
  13132. [Java, C#] SF #670949 request. The destructor wrapper function name is now
  13133. configurable. A new attribute called methodname in the
  13134. javadestruct/javadestruct_derived (Java) or csdestruct/csdestruct_derived (C#)
  13135. typemaps specifies the method name. For example in Java the destructor is
  13136. wrapped by default with the delete method:
  13137. %typemap(javadestruct, methodname="delete") SWIGTYPE {...}
  13138. 06/27/2003: cheetah (William Fulton)
  13139. [Java, C#] The throws attribute for adding exception classes to the throws
  13140. clause also now works with the following typemaps:
  13141. newfree
  13142. javain, javaout (Java)
  13143. csin, csout (C#)
  13144. For example, the 'AnException' will be added to the throws clause in the
  13145. proxy function:
  13146. %typemap(javaout, throws="AnException") int {
  13147. int returnValue=$jnicall;
  13148. if (returnValue==0) throw new AnException("Value must not be zero");
  13149. return returnValue;
  13150. }
  13151. 06/25/2003: mrose (Mark Rose)
  13152. [Python] Director typemap marshalling checks for null pointers when
  13153. walking the parameter list instead of relying soley on the parameter
  13154. count. Cures a segfault that occurred for multiple argument inv typemaps.
  13155. Someone with more Swig experience should probably review this code.
  13156. 06/24/2003: mkoeppe (Matthias Koeppe)
  13157. [Chicken] Don't emit calls to "C_check_for_interrupt",
  13158. which may result in an endless loop. Patch by felix@proxima-mt.de.
  13159. 06/20/2003: cheetah (William Fulton)
  13160. [C#] Finalizers now use destructor syntax as the override which was used in
  13161. the Finalize method is not in the ECMA standards, spotted by the MS compiler.
  13162. 06/10/2003: cheetah (William Fulton)
  13163. [C#] A number of changes have been made to remove the Java naming
  13164. that was used in the C# module.
  13165. Typemap name changes:
  13166. jni -> ctype
  13167. jtype -> imtype
  13168. jstype -> cstype
  13169. javain -> csin
  13170. javaout -> csout
  13171. javainterfaces -> csinterfaces
  13172. javabase -> csbase
  13173. javaclassmodifiers -> csclassmodifiers
  13174. javacode -> cscode
  13175. javaimports -> csimports
  13176. javaptrconstructormodifiers -> csptrconstructormodifiers
  13177. javagetcptr -> csgetcptr
  13178. javafinalize -> csfinalize
  13179. Feature name changes:
  13180. javaconst -> csconst
  13181. javamethodmodifiers -> csmethodmodifiers
  13182. Pragma changes:
  13183. pragma(java) -> pragma(csharp)
  13184. jniclassbase -> imclassbase
  13185. jniclassclassmodifiers -> imclassclassmodifiers
  13186. jniclasscode -> imclasscode
  13187. jniclassimports -> imclassimports
  13188. jniclassinterfaces -> imclassinterfaces
  13189. Special variable name changes:
  13190. $javaclassname -> $csclassname
  13191. $javainput -> $csinput
  13192. $jnicall -> $imcall
  13193. This will break SWIG interface files that use these typemaps, features
  13194. and pragmas. Please update your code or use macros for backwards
  13195. compatibility.
  13196. *** POTENTIAL INCOMPATIBILITY FOR C# MODULE ***
  13197. 06/10/2003: mkoeppe (Matthias Koeppe)
  13198. [MzScheme] Applied MzScheme module updates contributed by
  13199. John Lenz <jelenz@students.wisc.edu>.
  13200. - Updated mzscheme to use SWIG's common runtime type
  13201. system from common.swg.
  13202. - The Lib/mzscheme directory has been reorganized to
  13203. standardize names across the language modules:
  13204. mzscheme.i was moved to mzscheme.swg, mzscheme.swg and
  13205. mzschemedec.swg have been removed, mzrun.swg (which
  13206. contains the runtime code) has been added.
  13207. - The swig_proxy structure was renamed to swig_mz_proxy.
  13208. swig_mz_proxy now contains a pointer to a swig_type_info
  13209. structure.
  13210. - Added varin and varout typemaps for SWIGTYPE [] and
  13211. SWIGTYPE &.
  13212. - Garbage collection by calling scheme_add_finalizer() has
  13213. been added.
  13214. *** NEW FEATURE [MzScheme] ***
  13215. 06/10/2003: cheetah (William Fulton)
  13216. [Java] New typemaps: javadestruct and javadestruct_derived
  13217. for the C++ destructor wrapper. The javadestruct version gets used by
  13218. classes at the top of an inheritance chain and the javadestruct_derived
  13219. version gets used by other classes.
  13220. [C#] cildispose and cildisposeoverride typemaps replaced by
  13221. csdestruct and csdestruct_derived typemaps. The delete()
  13222. method has been removed and its functionality put into these
  13223. typemaps designed for the Dispose() method.
  13224. - New typemaps csinterfaces and csinterfaces_derived replace
  13225. the javainterfaces typemap. Also fixes the peculiarity of all classes
  13226. in an inheritance chain individually deriving from the IDisposable
  13227. interface.
  13228. - New typemap csfinalize for finalizers. C++ destructors are now called
  13229. by garbage collector during finalization. Problem reported by
  13230. Andreas Schörk.
  13231. 06/10/2003: Tiger
  13232. Modified contract code for error message output.
  13233. Contract code can now print out simple error message.
  13234. Modified contract code to prepare for inheritance
  13235. 06/03/2003: mkoeppe
  13236. [Guile] Applied Guile module updates contributed by
  13237. John Lenz <jelenz@students.wisc.edu>.
  13238. - SWIG currently uses Guile's gh_ API, which is marked as
  13239. deprecated in Guile 1.6 and will be removed in Guile
  13240. 1.9. This change introduces a command-line flag "-scm"
  13241. which causes SWIG to generate wrappers that use Guile's
  13242. SCM API instead; this requires Guile >= 1.6.
  13243. - The Lib/guile directory has been reorganized to
  13244. standardize names across language modules: guiledec.swg
  13245. and guile.swg have been moved into guile_gh_run.swg,
  13246. guile.i has been moved to guile_gh.swg, guile_scm.swg
  13247. and guile_scm_run.swg which contain the SCM API stuff
  13248. have been added
  13249. - ghinterface.i, which contains the defines from the gh_
  13250. functions to the scm_functions has been added
  13251. - The API for dealing with pointer objects is now
  13252. SWIG_ConvertPtr, SWIG_MustGetPtr, SWIG_NewPointerObj.
  13253. - Added varin and varout typemaps for SWIGTYPE [] and SWIGTYPE &
  13254. - Garbage collection has been added.
  13255. *** NEW FEATURE [Guile] ***
  13256. 06/01/2003: cheetah (William Fulton)
  13257. Dimensionless arrays such as
  13258. int foo[] = {1, 2};
  13259. extern int bar[];
  13260. produce a warning that the variable is read-only. Depending on the target
  13261. language, this used to cause compile errors or generate a setter that
  13262. generated a runtime error. A setter cannot be automatically generated
  13263. because the array size cannot be determined by SWIG. A varin, globalin
  13264. or memberin typemap (depending on the target language) must be written
  13265. by the user.
  13266. 05/29/2003: beazley
  13267. Refinement to default typemap matching and arrays. When an
  13268. array is declared like this:
  13269. int foo[4];
  13270. The default typemap now resolves to
  13271. SWIGTYPE [ANY]
  13272. If no match is found for that, it then resolves to
  13273. SWIGTYPE []
  13274. If no array dimension is specified in the original declaration,
  13275. the SWIGTYPE [] is used right away.
  13276. Note: This change has been made to resolve problems related to
  13277. arrays with and without dimensions. For example, sometimes SWIG
  13278. was generating setter functions for array variables with no dimensions
  13279. (an error). Likewise, SWIG sometimes made arrays with dimensions
  13280. read-only (also an error). This fixes the arrays_global test
  13281. problem.
  13282. 05/28/2003: beazley
  13283. Fixed subtle type handling bug with references and pointers.
  13284. If you had functions like this:
  13285. typedef Foo Bar;
  13286. Foo *func1();
  13287. void func2(Bar &x);
  13288. Then func2() wouldn't accept objects returned by func1()
  13289. because of a type error. It should work now.
  13290. Reported by Brian Yang.
  13291. 05/21/2003: cheetah (William Fulton)
  13292. Fixes to some of the Visual C++ example project files which would not
  13293. work with spaces in the paths held in the environment variables used to
  13294. point to the target language's library / include directory.
  13295. SF bug #740769
  13296. 05/21/2003: songyanf (Tiger)
  13297. Added -contracts option.
  13298. First try of the idea of "Wrap by Contract":
  13299. build up realiable cross-language module by wrapping with SWIG.
  13300. Implemented basic assertion
  13301. (preassertion & postassertion & invariant)
  13302. for simple C/C++ functions.
  13303. Current format of contracts are:
  13304. %contract class_name :: func_name (paras...) {
  13305. require:
  13306. boolean exprs;
  13307. exprs;
  13308. ensure:
  13309. boolean expr;
  13310. exprs;
  13311. invariant:
  13312. boolean expr;
  13313. exprs;
  13314. }
  13315. *** NEW FEATURE ***
  13316. 05/19/2003: cheetah (William Fulton)
  13317. Build tweaks. There were a few preprocessor definitions which were
  13318. specified in the Makefile for passing on the commandline when compiling.
  13319. These are now all defined in swigconfig.h. Autoconf doesn't normally
  13320. allow installation directories to be defined in this config header file,
  13321. but an autoconf archive macro enables this. This macro along with future
  13322. autoconf macros are going to be put in the Tools/config directory.
  13323. 'swig -version' now reports the target build platform.
  13324. 05/11/2003: cheetah (William Fulton)
  13325. [C# and Java] Fix to the following typemaps:
  13326. javabase, javainterfaces, javaimports, javaclassmodifiers,
  13327. javaptrconstructormodifiers, javafinalize, javagetcptr & javacode.
  13328. These are the typemaps for modifying/generating proxy classes.
  13329. Previously the typemaps would use the proxy class name and not the
  13330. C++ type, which was inconsistent with all other typemaps.
  13331. In most circumstances the proxy class name and the C++ class name/type
  13332. is the same except for classes in namespace, templated classes etc. so
  13333. this shouldn't affect most cases.
  13334. *** POTENTIAL INCOMPATIBILITY FOR JAVA and C# MODULES ***
  13335. 05/09/2003: cheetah (William Fulton)
  13336. Visual C++ Project files have been added so that the runtime libraries
  13337. can be built on Windows (for Tcl, Perl, Python and Ruby).
  13338. 05/01/2003: beazley
  13339. Fixed problem with return by value, const, and private constructors.
  13340. For example:
  13341. class B {
  13342. private:
  13343. B();
  13344. public:
  13345. B(const B&);
  13346. };
  13347. class A {
  13348. ...
  13349. const B returnB() const;
  13350. ...
  13351. };
  13352. Problem and patch suggestion reported by Bill Hoffman.
  13353. 04/29/2003: cheetah (William Fulton)
  13354. Build changes:
  13355. - Single autoconf invocation - autoconf in the Tools directory has gone.
  13356. - Libtool bootstrapped when running autogen.sh. This requires anyone
  13357. using the cvs version of SWIG to have libtool installed on their
  13358. machine. Suggest version 1.4.2 or higher, preferably the latest - 1.5.
  13359. - Automake is now used to build the runtime libraries in conjunction
  13360. with libtool.
  13361. - Runtime libraries are now successfully built as DLLs on Cygwin.
  13362. - Skipping languages is no longer just determined in the top level
  13363. makefile but in configure.in. This info is used for building
  13364. the runtime libraries and for running the examples and test-suite.
  13365. - These changes have fixed multiple build directory builds, that is
  13366. building from directories other than the top level directory.
  13367. Installation from multiple build directories also working. An initial
  13368. configure in the top level directory is no longer needed as described
  13369. in 04/02/2003 entry. A 'make distclean' will be needed before building
  13370. in a directory other than the top level directory if the autotools
  13371. have been run from this top level directory at some point, but
  13372. autoconf will tell you this. Note that 'make check' only works from
  13373. the top level directory at the moment.
  13374. 04/28/2003: beazley
  13375. Fixed [ 723471 ] Wrapper_print() fails with preprocessor directives.
  13376. 04/28/2003: beazley
  13377. Minor refinement of const static member variable handling
  13378. described in CHANGES 08/11/2002. Previously, SWIG merely
  13379. checked to see if there was an initializer in the declaration.
  13380. Now, SWIG additionally checks to make sure the static member
  13381. is const.
  13382. 04/25/2003: ljohnson (Lyle Johnson)
  13383. [Ruby] Added a kind of limited support for multiple inheritance,
  13384. activated using the -minherit command-line option. I've also updated
  13385. the "C++ Inheritance" section of the Ruby documentation to discuss
  13386. how this works, and its limitations. Also also modified the minherit.i
  13387. test case to run against this.
  13388. 04/25/2003: ljohnson (Lyle Johnson)
  13389. [Ruby] Added the -globalmodule command-line option for the Ruby
  13390. module, for wrapping stuff into the global module (Kernel) instead
  13391. of a nested module. Updated documentation accordingly.
  13392. 04/23/2003: mrose (Mark Rose)
  13393. Fixed symname error in director calls to Python methods
  13394. that extend C++ operators.
  13395. Stopped director destructor wrappers from calling __set_up,
  13396. which was leaving the director flag in an inconsistent state.
  13397. 04/23/2003: beazley
  13398. Fixed problem with namespace resolution and nested namespaces.
  13399. Reported by Alfred Lorber (and Marcelo Matus).
  13400. 04/16/2003: cheetah (William Fulton)
  13401. Patch for Java examples and test-suite to run on Mac OS X.
  13402. 04/15/2003: ljohnson (Lyle Johnson)
  13403. [Ruby] Incorporated Nobu Nakada's patches for supporting the Ruby
  13404. 1.8 allocation framework.
  13405. 04/15/2003: ljohnson (Lyle Johnson)
  13406. [Ruby] Replaced all uses of the deprecated STR2CSTR() macro with the
  13407. safer StringValuePtr() macro. For more information, see ruby-talk:67059
  13408. and follow-ups to that post.
  13409. 04/11/2003: beazley
  13410. Fixed problem with preprocessor macro expansion. For example:
  13411. #define min(x,y) ((x) < (y)) ? (x) : (y)
  13412. int f(int min);
  13413. Reported by Sebastien Recio.
  13414. 04/10/2003: cheetah (William Fulton)
  13415. [Java] Added a runtime check to typemaps in arrays_java.i library to check
  13416. that the Java array passed in is the same size as the C array and throw an
  13417. exception if not.
  13418. Also fix to use delete instead of free for arrays created using new.
  13419. 04/07/2003: cheetah (William Fulton)
  13420. Remove GCC3 warning when compiling the examples and test-suite:
  13421. cc1plus: warning: changing search order for system directory "/usr/include"
  13422. cc1plus: warning: as it has already been specified as a non-system directory
  13423. See SF patch #715531 submitted by Gerald Williams
  13424. 04/03/2003: cheetah (William Fulton)
  13425. [C#] Improved wrapping of enums and constants. These were previously
  13426. wrapped as C# variables rather than constants. Either these are wrapped
  13427. as readonly (runtime) constants or compile time constants, depending on
  13428. the %javaconst directive (The directive is likely to change name soon).
  13429. For example wrapping:
  13430. %javaconst(0);
  13431. #define ABC 22
  13432. %javaconst(1) XYZ;
  13433. #define XYZ 33
  13434. is now:
  13435. public static readonly int ABC = examplePINVOKE.get_ABC();
  13436. public const int XYZ = 33;
  13437. 04/03/2003: cheetah (William Fulton)
  13438. [Java] Global constants and enums are put in their own interface called
  13439. xxxConstants, where xxx is the module name. This is an improvement as
  13440. it is possible to derive (implement) a Java class from the xxxConstants
  13441. interface to improve the syntax; namely when wrapping:
  13442. enum {ONE=1, TWO, THREE};
  13443. accessing these from a Java class implementing xxxConstants is neater:
  13444. int number = ONE;
  13445. than the previous:
  13446. int number = xxx.ONE;
  13447. Patch submitted by Dave Dribin.
  13448. 04/02/2003: cheetah (William Fulton)
  13449. Build improvements for multiple builds. This allows one to build
  13450. the SWIG executable and runtime libraries for different platforms/compilers
  13451. etc by running configure in different directories. This isn't 100% just
  13452. yet and won't be until libtool is better configured... a 'configure' and
  13453. 'make distclean' needs to be run in the root directory before it all works.
  13454. For example:
  13455. $ ./configure
  13456. $ make distclean
  13457. $ mkdir config1; cd config1; ../configure CC=gcc CXX=g++; make; cd ..
  13458. $ mkdir config2; cd config2; ../configure CC=cc CXX=c++; make; cd ..
  13459. To be improved. A 'make check' does not work yet either.
  13460. 04/01/2003: beazley
  13461. Fixed template partial specialization argument expansion bug.
  13462. This showed up when trying to use std_vector.i with vectors
  13463. of pointers.
  13464. 03/31/2003: cheetah (William Fulton)
  13465. Fix for parallel make builds of SWIG, for example
  13466. make -j 4
  13467. Build failure reported by Bill Clarke.
  13468. 03/28/2003: beazley
  13469. Released 1.3.19.
  13470. Version 1.3.19 (March 28, 2003)
  13471. ===============================
  13472. 03/28/2003: beazley
  13473. Variety of minor bug fixes to the 1.3.18 release including:
  13474. - Segmentation fault with %extend directive.
  13475. - Typemap variable substitution bug.
  13476. - Expression evaluation bug.
  13477. - Large memory leak with template expansion.
  13478. Version 1.3.18 (March 23, 2003)
  13479. ===============================
  13480. 03/21/2003: beazley
  13481. Fixed two problems with the %extend directive, overloading, and
  13482. template expansion. See the 'template_extend_overload' and
  13483. 'template_extend_overload_2' tests in Examples/test-suite for
  13484. details.
  13485. 03/20/2003: cheetah (William Fulton)
  13486. [C#] Added some typemaps as suggested by Andreas Schoerk for handling
  13487. parameters that are passed as pointers or by reference. These have
  13488. been put in typemaps.i.
  13489. 03/20/2003: beazley
  13490. Fixed a C++ scoping bug related to code like this:
  13491. class Foo {
  13492. public:
  13493. int Foo::bar();
  13494. };
  13495. Previously, SWIG just tossed out the Foo::bar() declaration. Now,
  13496. the declaration is wrapped provided that the prefix is exactly the
  13497. same as the current scope (including any enclosing namespaces).
  13498. Reported by Bruce Lowery.
  13499. 03/20/2003: beazley
  13500. Incorporated [ 696516 ] Enabling exception processing for data member access.
  13501. In some compilers, attribute access can generate exceptions. However,
  13502. SWIG ordinarily assumes that no exceptions will be raised. To disable this,
  13503. use the %feature("allowexcept"). For example:
  13504. %feature("allowexcept") Foo::x;
  13505. ...
  13506. class Foo {
  13507. public:
  13508. int x; /* Exception handling enabled */
  13509. ...
  13510. };
  13511. Patch contributed by Yakov Markovitch.
  13512. 03/20/2003: beazley
  13513. Incorporated Patch. [ 701860 ] Improve Performance (python proxies).
  13514. Gives a performance boost to proxy class code and the management of the
  13515. .this and .thisown attributes. Contributed by Mike Romberg.
  13516. 03/19/2003: cheetah (William Fulton)
  13517. [C# and Java] Added missing vararg support.
  13518. 03/18/2003: mrose (Mark Rose)
  13519. Removed code related to tagging individual methods for directors.
  13520. The concept of having directors for some but not all virtual methods
  13521. of a class is deeply flawed. The %feature("nodirector") tag is also
  13522. gone.
  13523. Directors are off by default. To enable them for a class, issue
  13524. %feature("director") classname; which will create director methods
  13525. for every virtual method in the hierarchy of the class.
  13526. 03/17/2003: beazley
  13527. Fixed a subtle problem with passing arguments of type function. For
  13528. example:
  13529. int foo(int x(int, int));
  13530. or
  13531. typedef int binop_t(int, int);
  13532. int foo(binop_t x);
  13533. In old versions, this would produce code that wouldn't compile. Now,
  13534. SWIG merely adds an extra pointer, making these declarations the same
  13535. as:
  13536. int foo(int (*x)(int, int));
  13537. typedef int binop_t(int, int);
  13538. int foo(binop_t *x);
  13539. Reported by Garth Bushell.
  13540. 03/17/2003: mrose (Mark Rose)
  13541. Fixed the return statement for director base class calls that have no
  13542. return value.
  13543. 03/15/2003: beazley
  13544. Fixed a problem with const smart-pointer wrapping. For example:
  13545. class Foo {
  13546. public:
  13547. int x;
  13548. void bar() const;
  13549. void spam();
  13550. };
  13551. class Blah {
  13552. ...
  13553. const Foo *operator->();
  13554. ...
  13555. };
  13556. In this case, only "x" and "bar" are visible from Blah (since application
  13557. of spam violates constness). Moreover, access to "x" is read-only.
  13558. 03/15/2003: mrose (Mark Rose)
  13559. Cleaned up two signed versus unsigned comparisons in python/std_vector.i.
  13560. 03/15/2003: cheetah (William Fulton)
  13561. [C#] Global variables are wrapped using properties instead of get and set methods.
  13562. Member variable wrapping bug fixes, for example wrapping pointers work now.
  13563. Typemaps are used for all variable wrapping to generate the property code.
  13564. 03/13/2003: mrose (Mark Rose)
  13565. Fixed a bug in the virtual method unrolling for directors.
  13566. The order of unrolling is now from base to derived, to ensure
  13567. that the most derived implementation of a director method is
  13568. found.
  13569. Director methods for pure virtual methods now throw
  13570. DIRECTOR_PURE_VIRTUAL_EXCEPTION if _up is set.
  13571. 03/12/2003: cheetah (William Fulton)
  13572. [C#] Polymorphism fix: virtual functions now use the appropriate
  13573. keyword in the C# proxy class, virtual or override.
  13574. Some 'using System;' statement fixes needed by the Mono compiler.
  13575. 03/11/2003: beazley
  13576. Fixed subtle bug in the application of SwigValueWrapper<> to
  13577. template classes with default constructors. Reported by
  13578. Bruce Lowery.
  13579. 03/11/2003: beazley
  13580. The $descriptor(type) variable is now expanded in code supplied to
  13581. %extend. This is useful for certain kinds of advanced wrapping
  13582. (especially container classes).
  13583. 03/11/2003: luigi
  13584. Support for std::map.
  13585. (a) Integration with scripting language (a la std::vector) for
  13586. Python, Ruby, MzScheme, and Guile;
  13587. (b) Simple wrapper for other languages
  13588. 03/10/2003: beazley
  13589. Fixed problem with escape sequences in string and character constants. SWIG
  13590. wasn't parsing certain octal codes correctly.
  13591. 03/07/2003: beazley
  13592. Fixed a variety of subtle preprocessor problems reported by
  13593. Sebastien Recio.
  13594. (a) Empty preprocessor values no longer generate "bad constant
  13595. value" errors. For example:
  13596. #define FOO
  13597. #define FOO BAR
  13598. (b) Macro names can now span multiple lines (technically valid,
  13599. although questionable practice). For example:
  13600. #define A_LONG_MACRO_\
  13601. NAME 42
  13602. (c) Whitespace is no longer required before certain macro values.
  13603. For example:
  13604. #define FOO"Hello"
  13605. #define BAR\
  13606. "Hello"
  13607. 03/07/2003: ljohnson (Lyle Johnson)
  13608. [Ruby] Added missing long long and unsigned long long typemaps
  13609. in the Lib/ruby/typemaps.i library file.
  13610. 03/07/2003: mrose (Mark Rose)
  13611. Added Examples/python/callback to demostrate how directors can
  13612. be used to implement callbacks in Python
  13613. Added Examples/python/extend to demonstrate virtual method
  13614. calls from C++ to Python (really the same as the callback
  13615. example, just a different context).
  13616. Added four tests for very basic director functionality. These
  13617. have runtime tests under python.
  13618. The Python module now emits #define SWIG_DIRECTORS near the
  13619. top of the output file if directors are enabled. This is useful
  13620. for disabling parts of tests in target languages that don't
  13621. support directors.
  13622. 03/06/2003: mrose (Mark Rose)
  13623. Added a section to Doc/Manual/Python.html on cross language
  13624. polymorphism (directors).
  13625. 03/06/2003: mrose (Mark Rose)
  13626. The short-lived "-fdirectors" command line option has been
  13627. removed. To enable directors, instead use the extended %module
  13628. directive as follows:
  13629. %module(directors="1") modulename
  13630. 03/06/2003: cheetah (William Fulton)
  13631. The long long typemaps have been rewritten so that they can be more
  13632. easily used with non ISO compilers, like Visual C++. For example
  13633. if you are wrapping the Windows 64 bit type __int64 the long long
  13634. typemaps can be used with %apply:
  13635. %apply long long { __int64 };
  13636. __int64 value1(__int64 x);
  13637. __int64 will now appear in the generated code instead of long long.
  13638. 03/06/2003: beazley
  13639. *** DEVELOPER CHANGE ***
  13640. Swig module mutation has been changed slightly. When a language
  13641. class method wants to save node attributes, it now uses one of the
  13642. following functions:
  13643. Swig_require()
  13644. Swig_save()
  13645. The first argument to these functions is a namespace in which
  13646. saved attributes are placed. For example,this code
  13647. Node *n;
  13648. Swig_save("cDeclaration",n,"type","parms","name",NIL);
  13649. saves the attributes as "cDeclaration:type", "cDeclaration:parms",
  13650. and so forth. If necessary, a language module can refer to
  13651. old values by using this special namespace qualifier.
  13652. In addition to this, a special attribute "view" contains the name
  13653. of the last namespace used to save attributes. In the above
  13654. example, "view" would have the value "cDeclaration". The value
  13655. of "cDeclaration:view" would have the previous view and so forth.
  13656. Swig_restore(n) restores a node to the state before the last
  13657. Swig_require() or Swig_save() call.
  13658. Note: This change makes it easier for language modules to refer
  13659. to old values of attributes.
  13660. 03/06/2003: mrose (Mark Rose)
  13661. Merged the cross-language polymorphism patch. When enabled, C++
  13662. "proxy" classes (called directors) are generated for each specified
  13663. C++ class. Directors pass method calls from C++ to Python, similar
  13664. to the way the usual proxy (shadow) classes pass method calls from
  13665. Python to C++. Together, these two types of proxies allow C++
  13666. classes that are extended in Python to behave just like ordinary
  13667. C++ classes and be used in C++ like native objects.
  13668. This feature is still very experimental and is disabled by default.
  13669. To enable director support, specify '-fdirectors' on the SWIG command
  13670. line or in the SWIG_FEATURES environment variable. In the interface
  13671. file, add %feature("director") to generate directors for all classes
  13672. that have virtual methods.
  13673. See http://stm.lbl.gov/~tm2/swig/ProxyDoc.html for more details.
  13674. 03/03/2003: beazley
  13675. Fixed a small glitch in typemap local variable replacement. If you had
  13676. a typemap like this:
  13677. %typemap(in) type ($1_type temp) {
  13678. ...
  13679. temp = ...;
  13680. ...
  13681. }
  13682. and no occurrence of "$1_type" appeared in the body, then the local
  13683. variable type wouldn't be substituted.
  13684. 03/03/2003: cheetah (William Fulton)
  13685. [C#] New version of the CSharp module which is typemap based.
  13686. It also uses ECMA C# and no longer uses Microsoft Visual C++.NET
  13687. glue. This means that it will work on non-Windows platforms.
  13688. Contributed by Neil Cawse.
  13689. 02/27/2003: beazley
  13690. Fixed [ 653548 ] error parsing casting operator definition.
  13691. SWIG now ignores casting operators declared outside of a class.
  13692. For example:
  13693. inline A::operator char *() { ... }
  13694. Bug reported by Martin Casado.
  13695. 02/27/2003: beazley
  13696. Added support for anonymous bit-fields. For example:
  13697. struct Foo {
  13698. int x : 4;
  13699. int : 4;
  13700. int y : 8;
  13701. };
  13702. Anonymous bit-fields are ignored by SWIG. Problem
  13703. reported by Franz Höpfinger.
  13704. 02/26/2003: cheetah (William Fulton)
  13705. [Java] Better typemaps in the Examples/java/typemap example and also
  13706. fixes subtle bug when using the StringBuffer typemaps more than once.
  13707. 02/26/2003: beazley
  13708. Fixed [ 642112 ] Constants char bug.
  13709. 02/26/2003: beazley
  13710. Fixed [ 675337 ] Partial template specialization not entirely working.
  13711. There was a subtle problem related to the naming and ordering of
  13712. template partial specialization arguments. Matching worked okay,
  13713. the resulting templates weren't expanded correctly.
  13714. 02/25/2003: beazley
  13715. Fixed problem with parsing (and generating code) for
  13716. references to arrays. For example:
  13717. int foo(int (&x)[10]);
  13718. 02/25/2003: beazley
  13719. Fixed [ 635347 ] Compilation warning from libpy.c.
  13720. Reported by Daniel L. Rall.
  13721. 02/25/2003: beazley
  13722. Fixed a subtle problem with virtual method implementation
  13723. checking and typedef.
  13724. typedef int *intptr;
  13725. struct A {
  13726. virtual int *foo() = 0;
  13727. };
  13728. struct B : public A {
  13729. virtual intptr foo() { };
  13730. };
  13731. SWIG was treating these declarations as different even though
  13732. they are the same (via typedef).
  13733. 02/25/2003: ljohnson (Lyle Johnson)
  13734. [Ruby] Added range checking for the NUM2USHRT macro, per [ 675353 ].
  13735. 02/24/2003: beazley
  13736. Fixed a subtle problem with the code that determined if a class is abstract
  13737. and can be instantiated. If you had classes like this:
  13738. struct A {
  13739. virtual int foo(int) = 0;
  13740. };
  13741. struct B : virtual A {
  13742. virtual int foo(int);
  13743. };
  13744. struct C : virtual A {
  13745. };
  13746. /* Note order of base classes */
  13747. struct D : B, C { }; /* Ok */
  13748. struct E : C, B { }; /* Broken */
  13749. then SWIG determined that it could instantiate D(), but not E().
  13750. This inconsistency arose from the depth-first search of the
  13751. inheritance hierarchy to locate the implementations of virtual
  13752. methods. This problem should now be fixed---SWIG will attempt
  13753. to locate any valid implementation of a virtual method by
  13754. traversing over the entire hierarchy.
  13755. 02/22/2003: cheetah (William Fulton)
  13756. [Java] Fix for using enum typemaps. The Java final static variable type
  13757. can be set using the jstype typemap, enabling enums to be mapped to
  13758. something other than int. Bug reported by Heiner Petith.
  13759. 02/21/2003: songyanf (Tiger)
  13760. Added CSharp (C#) module prototype
  13761. i.e. csharp.cxx & csharp.h at Source/Modules/.
  13762. They are for test usage only now and need improvement.
  13763. The interface also need to be modified.
  13764. *** NEW FEATURE ***
  13765. 02/20/2003: songyanf (Tiger)
  13766. Fixed problem with typedef with -fvirtual.
  13767. Similar as beazley's modification today.
  13768. 02/20/2003: beazley
  13769. Added support for gcc-style variadic preprocessor macros.
  13770. Patch [ 623258 ] GCC-style vararg macro support.
  13771. Contributed by Joe Mason.
  13772. 02/20/2003: beazley
  13773. Fixed [ 605162 ] Typemap local variables.
  13774. Reported by Lyle Johnson.
  13775. 02/20/2003: beazley
  13776. Fixed problem with abstract classes and typedef. For example:
  13777. class Foo {
  13778. public:
  13779. virtual void foo(int x) = 0;
  13780. };
  13781. typedef int Integer;
  13782. class Bar : public Foo {
  13783. public:
  13784. virtual void foo(Integer x);
  13785. };
  13786. SWIG was getting confused about the latter method---making Bar
  13787. abstract. Reported by Marcelo Matus.
  13788. 02/19/2003: cheetah (William Fulton)
  13789. [Java] %javaconst(flag) can also be used on enums as well as constants.
  13790. This feature enables true Java compiler constants so that they can be
  13791. used in Java switch statements. Thanks to Heiner Petith for patches.
  13792. 02/19/2003: songyanf (Tiger)
  13793. Modified -fcompact feature to deal with PP lines
  13794. 02/18/2003: beazley
  13795. Fixed [ 689040 ] Missing return value in std_vector.i.
  13796. Reported by Robert H. de Vries.
  13797. 02/18/2003: beazley
  13798. Fixed a few evil scoping problems with templates, namespaces, and the
  13799. %extend directive. Problem reported by Luigi Ballabio.
  13800. 02/18/2003: cheetah (William Fulton)
  13801. [Ruby] Improved support for Visual C++ and other native Windows compilers.
  13802. It is no longer necessary to specify "/EXPORT:Init_<module>", where <module> is the
  13803. swig module name when linking using these native Windows compilers.
  13804. 02/15/2003: songyanf (Tiger)
  13805. Added -fvirtual option.
  13806. Reduce the lines and size of the wrapper file
  13807. by omitting redifined virtual function in children classes.
  13808. Modified -compact option to -fcompact option
  13809. Added -small option.
  13810. -small = -fvirtual -fcompact
  13811. And it can be extended by future feature options,
  13812. which are used to reduce wrapper file szie.
  13813. Added SWIG_FEATURES environment variable check.
  13814. To dynamically set the feature options such as -fcompact & -fvirtual
  13815. *** NEW FEATURE ***
  13816. 02/13/2003: lenz
  13817. Updated Doc/Manual/Perl5.html to talk about C++ compile problems
  13818. configure.in now checks for PERL5_CCFLAGS
  13819. Runtime/Makefile.in and Example/Makefile.in now use PERL5_CCFLAGS
  13820. Added Lib/perl5/noembed.h which contains all the known macro conflicts
  13821. 02/12/2003: beazley
  13822. Fixed [ 685410 ] C++ Explicit template instantiation causes SWIG to exit.
  13823. Fixes a syntax error with declarations similar to this:
  13824. template class std::vector<int>;
  13825. SWIG now ignores the instantiation and generates a warning message.
  13826. We might do more later. Reported by Thomas Williamson.
  13827. 02/11/2003: cheetah (William Fulton)
  13828. Rewrote bool typemaps to remove performance warning for compiling generated code
  13829. under Visual C++.
  13830. 02/11/2003: cheetah (William Fulton)
  13831. Fix for wrapping reference variables (const non-primitive and all non-const types)
  13832. for example:
  13833. int& i;
  13834. Class& c;
  13835. const Class& c;
  13836. 02/11/2003: beazley
  13837. Fixed more very subtle preprocessor corner cases related to recursive
  13838. macro expansion. For example:
  13839. #define cat(x,y) x ## y
  13840. cat(cat(1,2),3) // Produces: cat(1,2)3
  13841. #define xcat(x,y) cat(x,y)
  13842. xcat(xcat(1,2),3) // Produces 123
  13843. See K&R, 2nd Ed. p. 231.
  13844. 02/10/2003: cheetah (William Fulton)
  13845. Fixed [ 683882 ] - patch submitted by F. Postma for SWIG to compile on HP-UX.
  13846. 02/10/2003: beazley
  13847. Fixed subtle preprocessor argument expansion bug. Reported by Marcelo Matus.
  13848. 02/10/2003: songyanf
  13849. Added -compact option.
  13850. Reduce the lines and size of the wrapper file
  13851. by omitting comments and combining short lines.
  13852. *** NEW FEATURE ***
  13853. 02/07/2003: beazley
  13854. Fixed [ 651355 ] Syntax error with cstring.i
  13855. Reported by Omri Barel.
  13856. 02/07/2003: beazley
  13857. Fixed [ 663632 ] incompatibility with standard cpp.
  13858. This is a refinement that fixes this problem:
  13859. // Some macro with an argument
  13860. #define FOO(x) x
  13861. int FOO; /* Not a macro---no arguments */
  13862. 02/05/2003: beazley
  13863. Fixed [ 675491 ] parse error with global namespace qualification.
  13864. Submitted by Jeremy Yallop.
  13865. 02/04/2003: beazley
  13866. Fixed bug in varargs processing introduced by the numinputs typemap parameter.
  13867. 01/08/2003: ttn
  13868. [xml] Fix string-replacement ordering buglet.
  13869. Thanks to Gary Herron.
  13870. 12/23/2002: cheetah (William Fulton)
  13871. Further build changes:
  13872. - The SWIG executable is now built using a single Makefile.
  13873. - This makefile is generated by Automake (Source/Makefile.am).
  13874. - Dependency tracking and tags support are in this makefile.
  13875. - Automake 1.7.2 and Autoconf 2.54 minimum versions are needed to build SWIG from CVS.
  13876. - Running ./autogen.sh now installs Autoconf/Automake support files into
  13877. Tools/config and these files are no longer stored in CVS.
  13878. - Bug fixes in 'make install' for systems using .exe executable extension and
  13879. ./configure --with-release-suffix=whatever
  13880. 12/16/2002: cheetah (William Fulton)
  13881. More build changes:
  13882. - Autoconf's AC_CANONICAL_HOST replaces proprietary approach for detecting build host.
  13883. - Autoconf support files moved to Tools/config.
  13884. 12/16/2002: cheetah (William Fulton)
  13885. Modifications to run on MacOS, submitted by Bernard Desgraupes.
  13886. Mainly ensuring generated files are output in the appropriate directory for
  13887. some modules.
  13888. 12/11/2002: cheetah (William Fulton)
  13889. Various build modifications and bug fixes:
  13890. - Simplification of version string. Use autoconf's PACKAGE_VERSION instead.
  13891. - Build time removed from SWIG version.
  13892. - Using standard autoconf config header generation.
  13893. - Updated old autoconf macros as reported by autoupdate.
  13894. - Removed $prefix in autoconf from search paths as autoconf won't expand them.
  13895. - Subtle bug fix where 'make prefix=/somewhere; make clean; make prefix=/somwhere/else'
  13896. produced an executable using the incorrect library directories.
  13897. - Added -ldflags commandline option for MzScheme, Ocaml, Pike and PHP.
  13898. - Fixed reporting of compiler used when using -version commandline option.
  13899. - SWIG web address added to -version commandline option.
  13900. 12/11/2002: beazley
  13901. Minor fix to Tcl dynamic cast typemaps. Reported by
  13902. Kristopher Blom.
  13903. 12/10/2002: beazley
  13904. Fixed subtle template argument replace bug. Reported by
  13905. Chris Flatley.
  13906. 12/10/2002: beazley
  13907. Reverted CHANGES 09/03/2002, preprocessor argument evaluation. Arguments
  13908. are not evaluated during collection, K&R, p. 230.
  13909. 12/06/2002: beazley
  13910. Fixed [ 649022 ] Compilation problems with KAI/KCC
  13911. 12/02/2002: beazley
  13912. SWIG 'rel-1-3' CVS branch merged back into the main branch.
  13913. Version 1.3.17 (November 22, 2002)
  13914. ==================================
  13915. 11/19/2002: beazley
  13916. Fixed [ 613922 ] preprocessor errors with HAVE_LONG_LONG.
  13917. 11/19/2002: beazley
  13918. Fixed [ 615480 ] mzscheme SWIG_MustGetPtr_.
  13919. 11/19/2002: beazley
  13920. Fixed [ 635119 ] SWIG_croak causes compiler warning.
  13921. 11/16/2002: cheetah (William Fulton)
  13922. [Java] Added typemaps for pointers to class members.
  13923. 11/15/2002: cheetah (William Fulton)
  13924. [Java] Bug fix: Overloaded C++ functions which cannot be overloaded in Java
  13925. once again issue a warning.
  13926. 11/14/2002: cheetah (William Fulton)
  13927. [Java] Handling of NULL pointers is improved. A java null object will now
  13928. be translated to and from a NULL C/C++ pointer by default. Previously when
  13929. wrapping:
  13930. class SomeClass {...};
  13931. void foo(SomeClass *s);
  13932. and it was called from Java with null:
  13933. modulename.foo(null)
  13934. a Java NullPointerException was thrown. Extra typemaps had to be written in
  13935. order to obtain a NULL pointer to pass to functions like this one. Now the
  13936. default wrapping will detect 'null' and translate it into a NULL pointer.
  13937. Also if a function returns a NULL pointer, eg:
  13938. SomeClass *bar() { return NULL; }
  13939. Then this used to be wrapped with a SomeClass proxy class holding a NULL
  13940. pointer. Now null is returned instead. These changes are subtle but useful.
  13941. The original behaviour can be obtained by using the original typemaps:
  13942. %typemap(javaout) SWIGTYPE {
  13943. return new $&javaclassname($jnicall, true);
  13944. }
  13945. %typemap(javaout) SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] {
  13946. return new $javaclassname($jnicall, $owner);
  13947. }
  13948. %typemap(javagetcptr) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] %{
  13949. protected static long getCPtr($javaclassname obj) {
  13950. return obj.swigCPtr;
  13951. }
  13952. %}
  13953. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  13954. 11/12/2002: beazley
  13955. Fixed problem with abstract methods and signatures. For example:
  13956. class abstract_foo {
  13957. public:
  13958. virtual int meth(int meth_param) = 0;
  13959. };
  13960. class abstract_bar : public abstract_foo {
  13961. public:
  13962. int meth(int meth_param_1, int meth_param_2) { return 0; }
  13963. };
  13964. In this case, abstract_bar is still abstract.
  13965. Fixes [ 628438 ] Derived abstract class not abstract.
  13966. Reported and patched by Scott Michel.
  13967. 11/11/2002: beazley
  13968. Fixed a matching problem with typemaps and array dimensions. For example, if you
  13969. had this:
  13970. typedef char blah[20];
  13971. and a typemap:
  13972. %typemap() char [ANY] {
  13973. ... $1_dim0 ...
  13974. }
  13975. then $1_dim* variables weren't be expanded properly. It should work now.
  13976. Problem reported by Pankaj Kumar Goel.
  13977. 11/07/2002: mkoeppe
  13978. Added an experimental new module that dumps SWIG's parse
  13979. tree as (Common) Lisp s-expressions. The module is
  13980. invoked with SWIG's -sexp command-line switch. The output
  13981. can be read into Common Lisp. There is (prototype)
  13982. example Lisp code that generates Foreign Function Interface
  13983. definitions for use with Kevin Rosenberg's UFFI.
  13984. *** EXPERIMENTAL NEW FEATURE ***
  13985. 11/07/2002: mkoeppe
  13986. Removed duplicate declaration of "cpp_template_decl" in
  13987. parser.y; bison 1.75 complained.
  13988. 11/06/2002: cheetah (William Fulton)
  13989. [Java] Default primitive array handling has changed like arrays of classes.
  13990. C primitive arrays are no longer wrapped by a Java array but with a pointer
  13991. (type wrapper class). Again the changes have been made for efficiency reasons.
  13992. The original typemaps have been moved into arrays_java.i, so the original
  13993. behaviour can be obtained merely including this file:
  13994. %include "arrays_java.i"
  13995. The array support functions are no longer generated by default. They are only
  13996. generated when including this file, thus this often unused code is only
  13997. generated when specifically requiring this type of array support.
  13998. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  13999. 11/05/2002: ljohnson (Lyle Johnson)
  14000. [Ruby] Added support for nested module declarations (as was
  14001. previously added for the Perl module). So a %module directive
  14002. of the form:
  14003. %module "Outer::Inner::Foo"
  14004. will nest everything as (in Ruby code):
  14005. module Outer
  14006. module Inner
  14007. module Foo
  14008. # stuff goes here
  14009. end
  14010. end
  14011. end
  14012. 11/05/2002: mkoeppe
  14013. [MzScheme] Add an argument (-declaremodule) that generates
  14014. code to correctly declare a primitive module extension.
  14015. Patch submitted by Bruce Butterfield.
  14016. 11/02/2002: cheetah (William Fulton)
  14017. [Java] Added patch submitted by Michael Cahill to remove unused parameter
  14018. warnings for the jenv and cls parameters. This patch also also allows one
  14019. to use "void" in the jni typemap for any type without code being generated
  14020. attempting to return a value.
  14021. 10/29/2002: cheetah (William Fulton)
  14022. [Java] Array handling is different. Arrays of classes are no longer wrapped
  14023. with proxy arrays, eg wrapping
  14024. class X {...};
  14025. X foo[10];
  14026. used to be wrapped with these Java getters and setters:
  14027. public static void setFoo(X[] value) {...}
  14028. public static X[] getFoo() {...}
  14029. This approach is very inefficient as the entire array is copied numerous
  14030. times on each invocation of the getter or setter. These arrays are now
  14031. wrapped with a pointer so it is only possible to access the first array element
  14032. using a proxy class:
  14033. public static void setFoo(X value) {...}
  14034. public static X getFoo() {...}
  14035. Arrays of enums have also been similarly changed. This behaviour is now like the
  14036. other SWIG language's implementation and the array library should be used to
  14037. access the other elements. The original behaviour can be achieved using the
  14038. macros and typemaps in arrays_java.i, for example:
  14039. %include "arrays_java.i"
  14040. JAVA_ARRAYSOFCLASSES(X)
  14041. class X {...};
  14042. X foo[10];
  14043. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  14044. 10/29/2002: cheetah (William Fulton)
  14045. [Java] Two new typemaps javain and javaout for generating the proxy class
  14046. and type wrapper class method calls to the JNI class. The new typemaps are
  14047. really used for transforming the jstype (used in proxy class and type wrapper
  14048. classes) to the jtype (used in the JNI class) and visa versa. A javain typemap
  14049. is required whenever an in typemap is written and similarly javaout for an out
  14050. typemap. An example is probably best to show them working:
  14051. %typemap(javain) Class "Class.getCPtr($javainput)"
  14052. %typemap(javain) unsigned short "$javainput"
  14053. %typemap(javaout) Class * {
  14054. return new Class($jnicall, $owner);
  14055. }
  14056. %inline %{
  14057. class Class {};
  14058. Class * bar(Class cls, unsigned short ush) { return new Class(); };
  14059. %}
  14060. The generated proxy code is then:
  14061. public static Class bar(Class cls, int ush) {
  14062. return new Class(exampleJNI.bar(Class.getCPtr(cls), ush), false);
  14063. }
  14064. Some new special variables have been introduced in order to use these typemaps.
  14065. Here $javainput has been replaced by 'cls' and 'ush'. $jnicall has been replaced by
  14066. the native method call, 'exampleJNI.bar(...)' and $owner has been replaced by 'false'.
  14067. $javainput is analogous to the $input special variable. It is replaced by the parameter name.
  14068. $jnicall is analogous to $action in %exception. It is replaced by the call to the native
  14069. method in the JNI class.
  14070. $owner is replaced by either true if %newobject has been used otherwise false.
  14071. The java.swg file contains default javain and javout typemaps which will produce the same code
  14072. as previously. This change is only of concern to those who have written their own typemaps as
  14073. you will then most likely have to write your own javain and javaout typemaps.
  14074. The javaout typemap also makes it possible to use a Java downcast to be used on abstract
  14075. proxy base classes. See the Java documentation on dynamic_cast.
  14076. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  14077. 10/24/2002: ttn
  14078. [Methodology] Upgaded to libtool 1.4.3, presumably w/ better
  14079. support for newish platforms (like MacOS X).
  14080. 10/21/2002: ttn
  14081. Fixed Runtime/Makefile.in bug -- thanks to Richard Calmbach.
  14082. 10/18/2002: ttn
  14083. Fixed typo in doh.h -- thanks to Max Horn.
  14084. Version 1.3.16 (October 14, 2002)
  14085. =================================
  14086. 10/13/2002: beazley
  14087. Fixed bug with %extend directive and %feature reported
  14088. by William Fulton.
  14089. 10/13/2002: beazley
  14090. Added OpenVMS build directory (vms). Contributed by
  14091. Jean-François Pieronne.
  14092. 10/09/2002: cheetah (William Fulton)
  14093. [Java] Added throws clause to the native functions in the JNI class.
  14094. The throws clause is the same as the one generated for proxy functions
  14095. and module class functions.
  14096. 09/27/2002: beazley
  14097. Fixed some problems with the %import directive and classes that
  14098. were defined but not wrapped. Problem reported by Leslie Brooks,
  14099. Gerry Woods, and others.
  14100. 09/23/2002: cheetah (William Fulton)
  14101. [Java] Some error checking added:
  14102. 1) OutOfMemoryException check in the char * typemaps.
  14103. 2) As SWIG treats pointers, references and passing by value all the
  14104. same, it is possible to pass a NULL pointer to a function that expects
  14105. an object passed by value or by reference. A NullPointerException is
  14106. now thrown under this scenario.
  14107. 09/20/2002: ttn
  14108. [Methodology] Reworked "make clean" and "make install"
  14109. to be more table driven.
  14110. [Docs] Explain how to extend "make install" w/ extra-install.list.
  14111. 09/15/2002: beazley
  14112. Deprecation of the "ignore" typemap. The "ignore" typemap has
  14113. been deprecated in favor of a generalization of the "in" typemap.
  14114. To ignore an argument, use something like this instead:
  14115. %typemap(in,numinputs=0) int *output (int temp) {
  14116. $1 = &temp;
  14117. }
  14118. This change fixes a number of subtle bugs related to the interaction
  14119. of the "in" and "ignore" typemaps (which were supposed to be
  14120. mutually exclusive).
  14121. The use of the numinputs argument is reserved for future expansion.
  14122. Currently, values >1 will generate an error. However, future
  14123. releases of SWIG may utilize that to support multi-input typemaps.
  14124. %typemap(ignore) still works, but generates a warning message and is
  14125. translated to %typemap(in,numinputs=0).
  14126. *** POTENTIAL INCOMPATIBILITY ***
  14127. *** NEW FEATURE ***
  14128. 09/15/2002: beazley
  14129. Fixed segmentation fault for unnamed structures. For example:
  14130. typedef struct {
  14131. } *blah;
  14132. Reported by Roger Gibson.
  14133. Note: we might be able to generate wrappers in special cases.
  14134. 09/13/2002: beazley
  14135. Minor modification to generated wrapper functions. Pointer arguments are now
  14136. always set to an initial value of 0. Simplifies typemap writing and cleanup
  14137. code (since you can rely on zero-value initialization). This also greatly
  14138. reduces the need to ever write an "arginit" typemap.
  14139. 09/12/2002: beazley
  14140. Minor enhancement to smart-pointer support. If operator->()
  14141. is part of an ignored base class like this,
  14142. %ignore Bar;
  14143. class Foo {
  14144. public:
  14145. int blah();
  14146. };
  14147. class Bar { /* Ignored */
  14148. public:
  14149. ...
  14150. Foo *operator->();
  14151. ...
  14152. };
  14153. class Spam : public Bar { };
  14154. then methods from Foo are still available. For example,
  14155. >>> s = Spam()
  14156. >>> s.blah()
  14157. 0
  14158. >>>
  14159. The only catch is that the operator->() itself is not available
  14160. (since it wasn't wrapped). Therefore, there won't be any
  14161. __deref__() operation unless it is explicitly added to Spam
  14162. (either using %extend or just placing operator->() in the
  14163. definition of Spam).
  14164. 09/11/2002: ttn
  14165. [Methodology] Reworked "make check" to be more table driven.
  14166. [Docs] Docuemented methodology in Manual/Extending.html.
  14167. 09/11/2002: ttn
  14168. [Docs] Prefixed Manual/*.html with "<!DOCTYPE html ...>" to
  14169. pander dotingly to (over-)sensitive editors.
  14170. 09/10/2002: ttn
  14171. [Guile] Converted Examples/guile/simple "make check"
  14172. behavior to actually check execution results. Reduced
  14173. iteration counts so that the test doesn't take too long.
  14174. 09/10/2002: beazley
  14175. SWIG-1.3.15 released.
  14176. Version 1.3.15 (September 9, 2002)
  14177. ==================================
  14178. 09/09/2002: beazley
  14179. Fixed nasty runtime type checking bug with subtypes and inheritance
  14180. and templates.
  14181. 09/09/2002: cheetah (William Fulton)
  14182. [Java] Java exception classes for a method's throws clause can be generated by
  14183. specifying them in a comma separated list in the throws attribute in any one
  14184. of the following typemaps: in, out, check, freearg, argout and throws. A classic
  14185. example would be to convert C++ exceptions into a standard Java exception:
  14186. %typemap(throws, throws="java.io.IOException") file_exception {
  14187. jclass excep = jenv->FindClass("java/io/IOException");
  14188. if (excep)
  14189. jenv->ThrowNew(excep, $1.what());
  14190. return $null; // or use SWIG_fail
  14191. }
  14192. class file_exception {...};
  14193. void open(const char *filename) throw(file_exception);
  14194. The Java method will then be declared with a throws clause:
  14195. public static void open(String filename) throws java.io.IOException {...}
  14196. 09/08/2002: mkoeppe
  14197. * [Guile] Improved the documentation system. The arglist no
  14198. longer gets cluttered with type specification, making it
  14199. more readable. (Also the ILISP function C-u M-x
  14200. `arglist-lisp' RET works better this way.) The types of
  14201. arguments are explained in an extra sentence after the
  14202. arglist.
  14203. There are now two documentation-related typemap arguments:
  14204. %typemap(in, doc="$NAME is a vector of integers",
  14205. arglist="$name") int *VECTOR { ... }
  14206. The "arglist" texts of all arguments of a function make up
  14207. its arglist in the documentation. The "doc" texts of all
  14208. arguments are collected to make a sentence that describes
  14209. the types of the arguments. Reasonable defaults are
  14210. provided.
  14211. As usual, $name is substituted by the name of the
  14212. argument. The new typemap variable $NAME is like $name,
  14213. but marked-up as a variable. This means that it is
  14214. upper-cased; in TeXinfo mode ("-procdocformat texinfo") it
  14215. comes out as @var{name}.
  14216. The directives %values_as_list, %values_as_vector,
  14217. %multiple_values now also have an effect on the
  14218. documentation. (This is achieved via the new pragmas
  14219. return_nothing_doc, return_one_doc, return_multi_doc.)
  14220. Documentation has also improved for variables that are
  14221. wrapped as procedures-with-setters (command-line switch
  14222. "-emit-setters").
  14223. * [Guile] Emit constants as _immutable_ variables. (This
  14224. was broken recently.)
  14225. 09/07/2002: mkoeppe
  14226. [Guile] Updated the typemaps in list-vector.i.
  14227. 09/07/2002: mkoeppe
  14228. Short-circuit the typechecks for overloaded functions.
  14229. (The changes in code generation are visible in the new
  14230. testcase "overload_complicated".)
  14231. 09/06/2002: cheetah (William Fulton)
  14232. [Java] Solution for [ 596413 ]
  14233. New typemap so that the Java proxy classes and type wrapper classes
  14234. wrapper constructor modifier can be tailored by users. The default value is
  14235. protected. Normally SWIG generates a constructor like this which can only
  14236. be accessed within one package:
  14237. protected Bar(long cPtr, boolean cMemoryOwn) {
  14238. ...
  14239. }
  14240. If you are using SWIG across multiple packages or want to use this constructor
  14241. anyway, it can now be accessed outside the package. To modify use for example:
  14242. %typemap(javaptrconstructormodifiers) SWIGTYPE "public"
  14243. to change to public for all proxy classes and similarly for all type wrapper classes:
  14244. %typemap(javaptrconstructormodifiers) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] "public"
  14245. 09/06/2002: cheetah (William Fulton)
  14246. [Java] Added throws typemaps for the Java module. C++ exceptions get converted into
  14247. java.lang.RuntimeException Java exceptions.
  14248. Warning: This may change from java.lang.Runtime exception in the future.
  14249. 09/05/2002: cheetah (William Fulton)
  14250. [Java] Fix for variables declared as references.
  14251. 09/05/2002: beazley
  14252. Fixed [ 605162 ] Typemap local variables. Reported by Lyle Johnson.
  14253. 09/05/2002: ljohnson (Lyle Johnson)
  14254. [Ruby] More updates to the Ruby module documentation, including
  14255. a new typemap example that demonstrates how to collect key-value
  14256. pairs from an argument list into a Hash.
  14257. 09/05/2002: beazley
  14258. Fixed bug with template expansion and constructors.
  14259. template<class T> class Foo {
  14260. public:
  14261. Foo<T>() { }
  14262. };
  14263. The extra <T> in the constructor was carried through in the
  14264. name--causing runtime problems in generated modules.
  14265. Reported by Jordi Arnabat Benedicto.
  14266. 09/05/2002: mkoeppe
  14267. [Guile] Support overloading.
  14268. 09/04/2002: ljohnson (Lyle Johnson)
  14269. [Ruby] Updated typemaps for long long and unsigned long long types
  14270. to use Ruby 1.7 support for these types when available.
  14271. 09/04/2002: ljohnson (Lyle Johnson)
  14272. [Ruby] Added output typemaps for const reference to primitive
  14273. types.
  14274. 09/04/2002: mkoeppe
  14275. [Guile] Fix pass-by-value typemaps. Reported by Arno
  14276. Peters via Debian bugtracking (#156902), patch by Torsten
  14277. Landschoff <torsten@debian.org>.
  14278. 09/03/2002: samjam (Sam Liddicott)
  14279. Better reference support.
  14280. Functions that want a void** can take a NULL by reference and
  14281. the void* will be made for you and then passed-by-reference
  14282. Also all integer-class native types can be passed by reference
  14283. where an int* or int& etc is needed
  14284. 09/03/2002: beazley
  14285. Changed the evaluation order of preprocessor macro arguments.
  14286. Arguments are now expanded by the preprocessor *before* they
  14287. are passed to macro expansion. This fixes a subtle expansion
  14288. bug reported by Anthony Heading.
  14289. 09/03/2002: beazley
  14290. Fixed the file include order (again, apparently). See 2/27/99.
  14291. 09/02/2002: beazley
  14292. [Perl] Better exception handling support. Since Perl error handling
  14293. relies on setjmp/longjmp, wrapper functions have been modified slightly
  14294. to provide an extra block scope:
  14295. XS(foo) {
  14296. char _swigmsg[SWIG_MAX_ERRMSG] = "";
  14297. const char *_swigerr = _swigmsg;
  14298. {
  14299. /* Normal wrapper function here */
  14300. ...
  14301. SWIG_croak("An error occurred\n");
  14302. ...
  14303. XSRETURN(argvi); /* Successful return */
  14304. fail:
  14305. /* cleanup code */
  14306. }
  14307. croak(_swig_err);
  14308. }
  14309. The macro SWIG_croak(x) sets the value of _swigerr to x and
  14310. executes a "goto fail". The whole wrapper function is enclosed
  14311. block scope to provide proper cleanup of C++ objects. Since
  14312. croak executes a longjmp(), there is no way to properly reclaim
  14313. resources if this executes in the same scope as the wrapper
  14314. function.
  14315. The _swigmsg[] variable is normally unused, but can be used
  14316. to store small error messages using sprintf or snprintf. It
  14317. has a capacity of at least 256 bytes (SWIG_MAX_ERRMSG).
  14318. 09/02/2002: beazley
  14319. [Tcl] Added better support for exceptions. Instead of returning TCL_ERROR,
  14320. use the macro SWIG_fail to return with an error. This ensures that
  14321. arguments are properly cleaned up. Exception specifiers are now
  14322. handled by default.
  14323. 09/02/2002: ljohnson (Lyle Johnson)
  14324. [Ruby] The type-checking system for the Ruby module has had a flaw
  14325. in that some types which should be considered equivalent
  14326. weren't. This bug was best demonstrated by the inherit_missing.i
  14327. test suite case, which defines a base class "Foo" that is
  14328. subclassed by "Bar". The "Foo" class isn't actually wrapped (i.e.
  14329. it's not directly accessible from Ruby) but we'd still like to be
  14330. able to pass "Bar" instances to functions expecting Foos and have
  14331. that work; it wasn't. The revised implementation (similar to that
  14332. used for some other language modules) adds a new instance variable
  14333. (__swigtype__) to each object that indicates its SWIG type;
  14334. that is, each "Bar" instance will now have a string instance
  14335. variable called "__swigtype__" whose value is "_p_Bar".
  14336. Unless developers were taking advantage of this low-level
  14337. implementation detail, they shouldn't notice any compatibility
  14338. problems; nevertheless, I'm marking it as a "potential
  14339. incompatibility".
  14340. *** POTENTIAL INCOMPATIBILITY ***
  14341. 09/01/2002: ljohnson (Lyle Johnson)
  14342. [Ruby] Fixed SF Bug #603199.
  14343. 08/08/2002: cheetah (William Fulton)
  14344. [Java] Added OUTPUT, INPUT and INOUT typemaps in typemaps.i for C++
  14345. references.
  14346. 08/27/2002: mkoeppe
  14347. [Guile] Fixed error in "lib_std_vector" testcase and
  14348. compiler warning in "lib_cdata" testcase.
  14349. 08/27/2002: ljohnson (Lyle Johnson)
  14350. [Ruby] Added the "%mixin" directive, which allows the user to
  14351. specify a comma-separated list of module names to mix-in to a
  14352. class. So, for example, if you'd like to specify that Ruby's
  14353. Enumerable module should be mixed-in to your class Foo, you'd
  14354. write:
  14355. %mixin Foo "Enumerable";
  14356. or to specify that the modules Fee, Fie and Fo should be mixed
  14357. in to Foo:
  14358. %mixin Foo "Fee,Fie,Fo";
  14359. *** NEW FEATURE ***
  14360. 08/27/2002: ljohnson (Lyle Johnson)
  14361. [Ruby] Modified the %alias directive so that multiple aliases
  14362. can be specified for an instance method by using a comma-separated
  14363. list of aliases.
  14364. 08/27/2002: ljohnson (Lyle Johnson)
  14365. [Ruby] Added "throw" typemaps for the Ruby module.
  14366. 08/26/2002: beazley
  14367. Two new command line options for printing dependencies.
  14368. 'swig -M' lists all file dependencies. 'swig -MM' lists
  14369. dependencies, but excludes files in the SWIG library.
  14370. Example:
  14371. % swig -M -python example.i
  14372. example_wrap.cxx: \
  14373. /u0/beazley/Projects/lib/swig1.3/swig.swg \
  14374. /u0/beazley/Projects/lib/swig1.3/python/python.swg \
  14375. example.i \
  14376. example.h
  14377. % swig -MM -python example.i
  14378. example_wrap.cxx: \
  14379. example.i \
  14380. example.h
  14381. *** NEW FEATURE ***
  14382. 08/26/2002: beazley
  14383. Fixed [ 597599 ] union in class: incorrect scope.
  14384. Reported by Art Yerkes.
  14385. 08/26/2002: beazley
  14386. Fixed [ 600132 ] Default argument with namespace.
  14387. Reported by Shibukawa Yoshiki.
  14388. 08/24/2002: beazley
  14389. Automatic C++ exception handling enabled for all language modules. This is
  14390. pretty simple. If you have a class like this:
  14391. class Foo {
  14392. };
  14393. class Bar {
  14394. public:
  14395. void blah() throw(Foo);
  14396. }
  14397. then the generated wrapper code looks like this:
  14398. wrap_Bar_blah() {
  14399. ...
  14400. try {
  14401. arg1->blah();
  14402. }
  14403. catch (Foo &_e) {
  14404. /* "throw" typemap code inserted. $1 = _e */
  14405. }
  14406. catch (...) {
  14407. throw;
  14408. }
  14409. }
  14410. The "throw" typemap can be used to raise an error in the target
  14411. language. It can do anything. Here is a very simple example:
  14412. %typemap("throw") Foo {
  14413. PyErr_SetString(PyExc_RuntimeError, "Foo exception");
  14414. return NULL;
  14415. }
  14416. To make this work in each language module, simply define a few default
  14417. "throw" typemaps for SWIGTYPE, SWIGTYPE *, int, const char *, and a
  14418. few common exception types. That's all there is to it.
  14419. Automatic exception handling can be disabled using -noexcept or
  14420. setting the NoExcept global variable to 1.
  14421. *** NEW FEATURE ***
  14422. 08/23/2002: beazley
  14423. [ Python ]
  14424. Automatic translation of C++ exception specifications into error handling code.
  14425. For example:
  14426. class Foo {
  14427. };
  14428. class Bar {
  14429. public:
  14430. void blah() throw(Foo);
  14431. }
  14432. In this case, Foo is wrapped as a classic-style class (compatible
  14433. with exception handling). Furthermore, you can write Python code
  14434. like this:
  14435. b = Bar()
  14436. try:
  14437. b.blah();
  14438. except Foo,e: # Note use of exception class here!
  14439. # Handle Foo error
  14440. ...
  14441. The object "e" in the exception handler is just a wrapped Foo
  14442. object. Access it like a normal object.
  14443. If an exception is not wrapped as a class, a RuntimeError
  14444. exception is raised. The argument to this exception is
  14445. the exception object. For example:
  14446. class Bar {
  14447. public:
  14448. void blah() throw(int);
  14449. }
  14450. b = Bar()
  14451. try:
  14452. b.blah();
  14453. except RuntimeError,e:
  14454. print e.args[0] # Integer exception value
  14455. Comments:
  14456. - If a class is used as an exception, it *must* be wrapped
  14457. as a Python classic-style class (new classes don't work).
  14458. - Automatic exception handling is compatible with %exception.
  14459. - Use -noexcept to turn off this feature.
  14460. - The newly introduced "throw" typemap is used to raise
  14461. Python errors (naturally).
  14462. *** EXPERIMENTAL NEW FEATURE ***
  14463. 08/23/2002: beazley
  14464. Information from throw() specifiers is now stored in the parse
  14465. tree. For example:
  14466. class Foo {
  14467. public:
  14468. int blah() throw(spam,bar);
  14469. }
  14470. The stored information is fully corrected for namespaces and works
  14471. with templates. Uses will follow.
  14472. 08/22/2002: beazley
  14473. Exception handling code is no longer applied to member access
  14474. function. For example, in this code
  14475. %exception {
  14476. try {
  14477. $action
  14478. } catch(whatever) {
  14479. ...
  14480. }
  14481. }
  14482. class Foo {
  14483. public:
  14484. int x;
  14485. ...
  14486. }
  14487. The exception handling code is not applied to accessor functions
  14488. for Foo::x. This should reduce the amount of extra code
  14489. generated.
  14490. Caveat: Exception handling code *is* used when attributes are
  14491. accessed through a smart-pointer or a synthesized attributed
  14492. added with %extend is used.
  14493. 08/22/2002: beazley
  14494. Made more patches to hopefully eliminate problems when compiling SWIG
  14495. as a 64-bit executable.
  14496. 08/22/2002: beazley
  14497. Fixed a bug with const reference members, variables, and static members.
  14498. For example:
  14499. class Foo {
  14500. public:
  14501. static const int &ref;
  14502. };
  14503. SWIG was trying to generate "set" functions which wouldn't compile.
  14504. 08/21/2002: beazley
  14505. Made the warning message for "Class X might abstract" off by default.
  14506. Enable with -Wall.
  14507. 08/21/2002: beazley
  14508. Refined handling of const and non-const overloaded methods. If
  14509. a class defines a method like this:
  14510. class Foo {
  14511. public:
  14512. int bar(int);
  14513. int bar(int) const;
  14514. }
  14515. Then the non-const method is *always* selected in overloading and
  14516. the const method silently discarded. If running with -Wall, a warning
  14517. message will be generated.
  14518. 08/19/2002: beazley
  14519. Better support for using declarations and inheritance. Consider this:
  14520. class Foo {
  14521. public:
  14522. int blah(int x);
  14523. };
  14524. class Bar {
  14525. public:
  14526. double blah(double x);
  14527. };
  14528. class FooBar : public Foo, public Bar {
  14529. public:
  14530. char *blah(char *x);
  14531. using Foo::blah;
  14532. using Bar::blah;
  14533. };
  14534. Now SWIG wraps FooBar::blah as an overloaded method that uses all
  14535. accessible versions of blah(). See section 15.2.2 in Stroustrup, 3rd Ed.
  14536. SWIG also supports access change through using declarations. For example:
  14537. class Foo {
  14538. protected:
  14539. int x;
  14540. int blah(int x);
  14541. };
  14542. class Bar : public Foo {
  14543. public:
  14544. using Foo::x;
  14545. using Foo::blah;
  14546. };
  14547. Caveat: SWIG does not actually check to see if declarations imported
  14548. via 'using' are in the inheritance hierarchy. If this occurs, the
  14549. wrapper code won't compile anyways---not sure it's worth worrying about.
  14550. 08/18/2002: beazley
  14551. Modified overloading dispatch to not include nodes with an "error" attribute.
  14552. A language module can set this if a node couldn't be wrapped and you don't want
  14553. it included in the dispatch function.
  14554. 08/18/2002: beazley
  14555. Enhancement to overloaded function dispatch. The dispatcher is now aware of
  14556. inheritance relationships. For example:
  14557. class Foo { };
  14558. class Bar : public Foo { };
  14559. void spam(Foo *f);
  14560. void spam(Bar *b);
  14561. In this case, the dispatcher re-orders the functions so that spam(Bar *b) is
  14562. checked first---it is more specific than spam(Foo *f).
  14563. 08/17/2002: beazley
  14564. Added -Werror command line option. If supplied, warning messages are treated
  14565. as errors and SWIG will return a non-zero exit code.
  14566. 08/17/2002: beazley
  14567. Fixed [ 596135 ] Typedef of reference can't compile. For example:
  14568. typedef int &IntRef;
  14569. void foo(IntRef i);
  14570. SWIG-1.3.14 generated code that wouldn't compile.
  14571. Version 1.3.14 (August 12, 2002)
  14572. ================================
  14573. 08/11/2002: mmatus
  14574. Static const members initialized during declaration, and
  14575. only them, ie:
  14576. struct A
  14577. {
  14578. static const int a = 1 ; // this one
  14579. static const int b; // not this one
  14580. };
  14581. are emitted like constants (equivalent to enums or
  14582. explicit %constant).
  14583. This is because they cannot be added directly to 'cvar'
  14584. since they lack the needed reference (well, you can force
  14585. them to have a real reference, but in an ugly way which
  14586. goes completely again the original purpose of initialize
  14587. them during declaration, you also have to deal with extra
  14588. linking matters, and it take a while to figure out what is
  14589. the problem and how to solve it).
  14590. Please test it with your preferred target language, and
  14591. not only the code generation, but really run the example
  14592. in the test-suite (static-const-member-2.i) because the
  14593. problem and the solution cannot be "fully" appreciated
  14594. until you try to load the module and run it.
  14595. In some target languages (python specially), this can
  14596. produces a difference in the way that the static constant
  14597. members 'a' and 'b' are internally wrapped. Hopefully,
  14598. they still can be accessed in the same way.
  14599. 08/11/2002: mmatus
  14600. [python] Now static const members can be accessed in a more
  14601. natural way, ie, if you have
  14602. struct A
  14603. {
  14604. typedef unsigned int viewflags;
  14605. static const viewflags forward_field = 0;
  14606. static const viewflags backward_field;
  14607. };
  14608. now you can do:
  14609. print A.backward_field
  14610. and also
  14611. a = A()
  14612. print a.forward_field
  14613. Note that if the static const members don't have an
  14614. initializer (like backward_field), still you can access
  14615. them in the same way in the python side, but the
  14616. implementation is a quite different: backward_field will
  14617. still appear in the cvar entity, and also, you are
  14618. responsible to initialize it in some code unit, and link it
  14619. properly. forward_field, by the other hand, will not
  14620. appear in the cvar entity but only as a A member, similar
  14621. to what happen with enum or %constant members.
  14622. 08/11/2002: mmatus
  14623. [python] Common code in the __setattr__/__getattr__ now
  14624. goes to two "free" methods at the beginning of the proxy
  14625. file, from where each class use it. This change reduces
  14626. the size of the proxy file, specially if you wrap a lot of
  14627. small classes in one module (up to 33% in some cases),
  14628. making it faster to load too.
  14629. 08/09/2002: beazley
  14630. [Perl5] If a function that returns char * returns NULL,
  14631. undef is returned to the Perl interpreter.
  14632. 08/09/2002: beazley
  14633. Fix to conversion operators and namespaces. For example:
  14634. namespace ns {
  14635. struct Foo { };
  14636. struct Bar {
  14637. operator Foo*();
  14638. };
  14639. }
  14640. In the wrapper code, SWIG was using ->operator Foo*()
  14641. when it should have been using ->operator ns::Foo*().
  14642. Note: if using %rename with a conversion operator, you
  14643. might have to do this:
  14644. %rename(toFooPtr) ns::operator ns::Foo*();
  14645. // ^^^^ note extra qualifier
  14646. namespace ns {
  14647. ...
  14648. 08/09/2002: beazley
  14649. [Python] Minor enhancement to 'const' variable declarations.
  14650. Normally const declarations are wrapped as read-only variables
  14651. accessible only through the cvar attribute (see SWIG.html for
  14652. a discussion of why). However, in many programs, "const"
  14653. declarations may just be constants---making the cvar. access
  14654. awkward. To fix this, "const" declarations are now available
  14655. both through cvar. and as a simple name. For example:
  14656. const int FOO = 42;
  14657. In Python:
  14658. >>> print example.cvar.FOO
  14659. 42
  14660. >>> print example.FOO
  14661. 42
  14662. Note: There are cases where the value of a "const" variable
  14663. might change. For example:
  14664. char *const BAR = "Hello World";
  14665. In this case, the pointer itself can not change, but the
  14666. data being pointed to could be modified. In these situations,
  14667. cvar.BAR should be accessed to obtained the current value.
  14668. 08/08/2002: beazley
  14669. [Python] Fixed generation of the proxy code (.py files) to more
  14670. closely follow the order of declarations as they appear in
  14671. the .i file. In the past, all of the class wrappers appeared
  14672. first, followed by function stubs, inserted Python code, and
  14673. other details.
  14674. 08/08/2002: cheetah (William Fulton)
  14675. [Java] Proxy method _delete() changed to delete(). There shouldn't ever
  14676. be a wrapped function called delete() as it is a C++ keyword and there
  14677. is no such thing as a member function in C.
  14678. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  14679. Backwards compatibility can be achieved by adding the function back in
  14680. for all proxy classes:
  14681. %typemap(javacode) SWIGTYPE %{
  14682. public void _delete() {
  14683. delete();
  14684. }
  14685. %}
  14686. Java backwards compatibility summary
  14687. ------------------------------------
  14688. There are a number of changes that have been made in improving the Java module
  14689. for ver 1.3.14. If at all possible change your code to take advantages of the
  14690. improvements. If you were using proxy classes you may not notice any backwards
  14691. compatibility issues. Here is an example which will help with most backwards
  14692. compatibility problems where it is not possible to modify the code that uses
  14693. the generated output:
  14694. Replace:
  14695. %module modulename
  14696. With:
  14697. %module (jniclassname="modulename") modulename;
  14698. %typemap(javacode) SWIGTYPE %{
  14699. public long getCPtr$javaclassname() {
  14700. return swigCPtr;
  14701. }
  14702. public void _delete() {
  14703. delete();
  14704. }
  14705. %}
  14706. %pragma(java) jniclassclassmodifiers="public";
  14707. The proxy constructors that took parameters (long cPtr, boolean cMemoryOwn)
  14708. were public and are now protected. If you were making use of these then you'll
  14709. have to modify your code and the best solution would be to use the new type
  14710. wrapper classes.
  14711. The other main areas are the pragmas and global variable wrapping. Replace
  14712. the pragmas with one of the new directives or typemaps mentioned below and use
  14713. %rename on the variables.
  14714. If you were not using proxy classes, you will have to define a jstype typemap
  14715. as well as a jtype typemap.
  14716. 08/08/2002: cheetah (William Fulton)
  14717. [Java] Fix for wrapping two dimension array variables.
  14718. 08/07/2002: beazley
  14719. [Python,Tcl]
  14720. Object management now has a much better sense of ownership.
  14721. Ownership bits is changed whenever an object is stored in a
  14722. global variable or structure member. For example:
  14723. struct Foo {
  14724. int val;
  14725. Foo *next;
  14726. };
  14727. Now in Python
  14728. >>> f = Foo()
  14729. >>> f.thisown
  14730. 1
  14731. >>> g = Foo()
  14732. >>> g.next = f # Assign a pointer
  14733. >>> f.thisown # Notice ownership change
  14734. 0
  14735. >>>
  14736. This scheme is mostly a conservative heuristic designed to
  14737. provide segmentation faults. It could cause a memory leak
  14738. if ownership is changed unnecessarily. In this case, you can
  14739. either write a typemap (that doesn't change ownership), or
  14740. manually set the thisown attribute back to 1.
  14741. 08/07/2002: beazley
  14742. [Tcl] Major usability improvements to the object interface.
  14743. Suppose you had code like this:
  14744. struct Foo {
  14745. int x;
  14746. int spam();
  14747. };
  14748. void blah(Foo *f);
  14749. In past versions of SWIG, you could create objects and use
  14750. them like this:
  14751. % Foo f
  14752. % f configure -x 3
  14753. % f spam
  14754. 37
  14755. The only problem is that if you tried to call blah(), it didn't
  14756. work:
  14757. % blah f
  14758. Type Error. Expected _p_Foo
  14759. %
  14760. Instead, you had to do this:
  14761. % blah [f cget -this]
  14762. SWIG now automatically extracts the -this pointer, avoiding this
  14763. problem. This means that saying "blah f" is perfectly legal and
  14764. everything will still work normally.
  14765. Caveat: Since pointer strings start with a leading underscore (_),
  14766. don't use this in object names. For example:
  14767. % Foo _f
  14768. % blah _f # Potential crash
  14769. Objects now have a -thisown attribute that shows the ownership.
  14770. This builds upon the CHANGES 11/24/2001 entry.
  14771. 08/07/2002: samjam, Sam Liddicott
  14772. Properly implemented pointer system using php resources.
  14773. Still need to work out whether or not to let script-users call
  14774. destructors directly
  14775. 08/06/2002: beazley
  14776. Upgraded mzscheme module to support version 201 and added
  14777. overloading support.
  14778. 08/05/2002: beazley
  14779. Added parsing support for extra grouping (in very limited cases).
  14780. For example:
  14781. typedef int (FuncPtr)(int, double);
  14782. *** EXPERIMENTAL ***
  14783. 08/03/2002: ljohnson (Lyle Johnson)
  14784. [Ruby] Updates to typemaps.i as those done previously for Perl,
  14785. Python and Tcl modules. Now supports reference types with INPUT,
  14786. OUTPUT and INOUT typemaps.
  14787. 08/02/2002: beazley
  14788. New library file cstring.i added. Provides macros for
  14789. manipulating char * data.
  14790. 08/02/2002: beazley
  14791. Deprecated the %new directive. Use %newobject instead. For
  14792. example:
  14793. %newobject foo;
  14794. ...
  14795. char *foo();
  14796. %newobject follows the same rules as %rename, %ignore, %feature,
  14797. etc.
  14798. *** POTENTIAL INCOMPATIBILITY ***
  14799. 08/01/2002: cheetah (William Fulton)
  14800. [Java] New attribute 'jniclassname' for the module directive allows a way of
  14801. changing the JNI class name from the default which uses the modulename with JNI
  14802. appended after it.
  14803. %module (jniclassname="name") modulename
  14804. If 'name' is the same as 'modulename' then the module class name gets changed
  14805. from 'modulename' to modulenameModule.
  14806. 08/01/2002: beazley
  14807. Fixed problem with file include order. Language specific
  14808. directories should take precedence over generic directories.
  14809. For example: "swig_lib/python/foo.i" should be loaded before
  14810. "swig_lib/foo.i". I thought this was the case already, but
  14811. apparently it has been broken for quite some time.
  14812. 08/01/2002: beazley
  14813. Added std_deque.i library file. Work in progress.
  14814. 08/01/2002: beazley
  14815. [Python,Tcl,Perl]
  14816. Improvements to typemaps.i. INPUT/INOUT typemaps perform better
  14817. error checking. Typemaps are now supplied for references like
  14818. int &OUTPUT, double &INOUT, etc.
  14819. 08/01/2002: beazley
  14820. [Python] Deprecated the T_* and L_* typemaps in typemaps.i.
  14821. Multiple return values are always placed in a tuple. Deprecated
  14822. the BOTH typemaps. This is now INOUT (e.g., int *INOUT).
  14823. *** POTENTIAL INCOMPATIBILITY FOR PYTHON MODULE ***
  14824. 08/01/2002: beazley
  14825. Deprecated the array.i, carray.i, and timer.i library files.
  14826. 08/01/2002: beazley
  14827. Deprecated the pointer.i library file. Use cpointer.i instead.
  14828. *** POTENTIAL INCOMPATIBILITY ***
  14829. 08/01/2002: cheetah (William Fulton)
  14830. [Java] For consistency the global variable getters and setters use the JavaBean
  14831. property design pattern like member variables always have. This means if you are
  14832. wrapping a variable called foo, the getter is called getFoo() and the setter is
  14833. called setFoo(). Before the recent changes to the Java module the getters and
  14834. setters were called get_foo() and set_foo(). If you really want the original
  14835. function names use the %rename directive like this: %rename(_foo) Foo;
  14836. 07/31/2002: beazley
  14837. Fixed casting problem with multiple inheritance. If you had this,
  14838. class foo {};
  14839. class bar : public foo {};
  14840. class baz : public foo {};
  14841. class spam : public bar, public baz {};
  14842. then the wrappers wouldn't compile due to an ambiguous cast.
  14843. Reported by Art Yerkes.
  14844. 07/30/2002: cheetah (William Fulton)
  14845. [Java] Due to new static typechecking all pointers held in a Java long are part of
  14846. the internal workings and this pointer value in the Java long has become abstracted
  14847. data. The type wrapper constructor and getCPtr() methods are as such protected.
  14848. If you need to mess around with pointers from Java or for example create a proxy
  14849. class or type wrapper class around a null pointer, add a function/constructor
  14850. to do so with the %javacode typemap. You can also make getCPtr() public again with
  14851. the %javagetcptr typemap.
  14852. 07/30/2002: cheetah (William Fulton)
  14853. [Java] Fixes for %typemap(ignore). In particular when ignoring the last parameter
  14854. in a function. Also for all parameters in constructors. These mods have also fixed
  14855. multi-argument typemaps for proxy classes - SF 581791.
  14856. 07/30/2002: cheetah (William Fulton)
  14857. [Java] %newobject (replacement for %new) now implemented for Java.
  14858. 07/29/2002: beazley
  14859. Fixed problem with typemap copies, %apply, and %clear inside
  14860. C++ namespaces.
  14861. 07/28/2002: cheetah (William Fulton)
  14862. [Java] The JNI class now has package access as the class modifier
  14863. has been changed from "public" to nothing. This has been done
  14864. as this class is now more for the internal workings of SWIG since the module
  14865. class has static type checking for all types.
  14866. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  14867. Backwards compatibility can be achieved by using the %jniclassclassmodifier
  14868. pragma to change it back to "public".
  14869. 07/28/2002: cheetah (William Fulton)
  14870. [Java] Proxy/Shadow classes are generated by default. The -proxy and
  14871. -shadow command line options are deprecated. If you want to use the
  14872. low-level functional interface then use the new -noproxy commandline option.
  14873. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  14874. 07/28/2002: cheetah (William Fulton)
  14875. [Java] Remaining pragmas shakeup. These were the remaining pragmas and their
  14876. new names where changed:
  14877. modulebase
  14878. modulecode
  14879. moduleclassmodifiers
  14880. moduleimport => moduleimports
  14881. moduleinterface => moduleinterfaces
  14882. The moduleimports works slightly differently to how the moduleimport pragma worked.
  14883. Now it actually takes code which gets placed before the class definition so the
  14884. whole import statement has to be given, for example:
  14885. %pragma(java) moduleimports=%{
  14886. import java.io.*;
  14887. import java.math.*;
  14888. %}
  14889. The moduleinterfaces is slightly different to the old moduleinterface in that if
  14890. more than one interface is required they must be comma separated in one use of
  14891. the pragma, for example:
  14892. %pragma(java) moduleinterfaces="Serializable, MyInterface"
  14893. These last two pragmas are consistent with the javainterfaces and javaimports
  14894. typemap.
  14895. A similar set of pragmas has been introduced, namely:
  14896. jniclassbase
  14897. jniclasscode
  14898. jniclassclassmodifiers
  14899. jniclassimport
  14900. jniclassinterface
  14901. These work in the same way as their module counterparts. Note that previously
  14902. the moduleXXX pragmas worked on the old module class which is now called the
  14903. JNI class (the class with the native functions). The jniclassXXX pragmas now
  14904. work on the new module class (the class that has all the global functions and
  14905. global variable getters and setters when using proxy classes, plus all other
  14906. remaining functions when using the low-level procedural interface).
  14907. In summary the contents of the pragmas make up a class like this:
  14908. <jniclassimports>
  14909. <jniclassmodifiers> class modulename extends <jniclassbase> implements <jniclassinterfaces> {
  14910. <jniclasscode>
  14911. ... SWIG generated functions ...
  14912. }
  14913. }
  14914. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  14915. 07/28/2002: cheetah (William Fulton)
  14916. [Java] Deprecated modulemethodmodifiers pragma and replaced with
  14917. a better %feature based directive called %javamethodmodifiers.
  14918. A useful example would be for synchronisation in multi-threaded apps:
  14919. %javamethodmodifiers foo(int a) "public synchronized";
  14920. Changes this function from the default ("public") to "public synchronized".
  14921. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  14922. 07/26/2002: beazley
  14923. Several directives now allow optional configuration parameters.
  14924. These include:
  14925. %module(name="value", name="value", ...) modulename
  14926. %import(name="value", ...) "filename.i"
  14927. %extend(name="value", ...) classname {
  14928. ...
  14929. }
  14930. These currently have no effect and are reserved for
  14931. future expansion.
  14932. 07/26/2002: beazley
  14933. Enhancements to smart-pointer handling. SWIG only provides
  14934. extra support for a smart-pointer if operator->() returns
  14935. a proper pointer. For example:
  14936. Foo *operator->();
  14937. If operator->() returns an object by value or reference,
  14938. then SWIG examines the returned object to see if it also
  14939. implements operator->(). If so, SWIG chases operator->()
  14940. until it can find one that returns a pointer. This allows
  14941. cases like this to work:
  14942. class Foo {
  14943. public:
  14944. void blah();
  14945. };
  14946. class Bar {
  14947. ...
  14948. Foo *operator->();
  14949. ...
  14950. };
  14951. class Spam {
  14952. ...
  14953. Bar operator->();
  14954. ...
  14955. };
  14956. For example:
  14957. >>> s = Spam()
  14958. >>> s.blah() # Invokes Foo::blah()
  14959. The s.blah() call actually invokes:
  14960. ((s.operator->()).operator->())->blah();
  14961. 07/26/2002: beazley
  14962. Fixed a bug with typedef and references. For example:
  14963. typedef Foo & FooRef;
  14964. FooRef blah();
  14965. Previous versions of SWIG generated code that wouldn't
  14966. compile.
  14967. 07/25/2002: beazley
  14968. Wrapping of static methods has been improved in proxy classes. In older
  14969. versions of SWIG, if you had this:
  14970. class Foo {
  14971. public:
  14972. static void bar();
  14973. };
  14974. The static method was only available as a function Foo_bar(). For example:
  14975. >>> Foo_bar()
  14976. Now, the static method can also be invoked through an instance like this:
  14977. >>> f = Foo()
  14978. >>> f.bar() # Invokes static method
  14979. This works with all versions of Python. Additionally, for Python-2.2,
  14980. the static method can be invoked as:
  14981. >>> Foo.bar()
  14982. The old-style function is still support for backwards compatibility. If
  14983. you care about making your code across different versions of Python,
  14984. either use Foo_bar() or access the method through an instance.
  14985. 07/25/2002: beazley
  14986. Changes to the Python module. Proxy classes now utilize new Python-2.2
  14987. features including properties and static methods. However, these features
  14988. are supported in a way that provides backwards compatibility with older
  14989. Python versions. In other words, proxy classes work with all versions
  14990. of Python and only use new features when running on Python-2.2.
  14991. 07/25/2002: beazley
  14992. Modified %extend so that overloaded methods can be added. For example:
  14993. %extend Foo {
  14994. void bar(int x) { };
  14995. void bar(char *s) { };
  14996. ...
  14997. }
  14998. This works with both C++ *and* C.
  14999. 07/24/2002: cheetah (William Fulton)
  15000. [Java] More new typemaps so that the Java proxy classes and type wrapper classes
  15001. can be further tailored by users. These are the default code for generating the
  15002. finalize() methods (proxy classes only) and the getCPtr() methods for proxy
  15003. classes and type wrapper classes:
  15004. %typemap(javafinalize) SWIGTYPE %{
  15005. protected void finalize() {
  15006. _delete();
  15007. }
  15008. %}
  15009. %typemap(javagetcptr) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [] %{
  15010. public static long getCPtr($javaclassname obj) {
  15011. return obj.swigCPtr;
  15012. }
  15013. %}
  15014. The javagetcptr typemap will enable users to handle Java null by overriding
  15015. this typemap - a requested feature.
  15016. The -nofinalize commandline option has been deprecated. The javafinalize
  15017. typemap is more powerful as it will allow the removal of the finalize methods
  15018. for all or any one or more particular proxy class.
  15019. 07/23/2002: cheetah (William Fulton)
  15020. [Java] The getCPtrXXX() function has been changed to a static function and
  15021. is now of the form:
  15022. protected static long getCPtr(XXX obj) {...}
  15023. This is a requested change which will allow Java null pointers to be used as null
  15024. can be passed in for obj. However, to achieve this the appropriate code must be
  15025. written using the new javagetcptr typemap directive.
  15026. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  15027. Backwards compatibility can be achieved by adding this function back in using the
  15028. new javacode typemap:
  15029. %typemap(javacode) SWIGTYPE %{
  15030. // SWIG-1.3.12 and SWIG-1.3.13
  15031. public long getCPtr$javaclassname() {
  15032. return swigCPtr;
  15033. }
  15034. // SWIG-1.3.11 and earlier
  15035. public long getCPtr() {
  15036. return swigCPtr;
  15037. }
  15038. %}
  15039. 07/23/2002: cheetah (William Fulton)
  15040. [Java] New directive to control constant code generation - %javaconst.
  15041. The default handling for handling constants is to get the value through
  15042. a JNI call, eg
  15043. #define YELLOW 5
  15044. #define BIG 1234LL
  15045. results in:
  15046. public final static int YELLOW = modulename.get_YELLOW();
  15047. public final static long BIG = modulename.get_BIG();
  15048. Earlier versions of the Java module initialised the value using the C value:
  15049. public final static int YELLOW = 5;
  15050. public final static long BIG = 1234LL;
  15051. This works in most cases, but the value for BIG won't compile as 1234LL is not
  15052. valid Java code and this is one of the reasons why the default is now to get the
  15053. values through a JNI call. The side effect is that these 'constants' cannot be used
  15054. in switch statements. The %javaconst directive allows one to specify the
  15055. way the constant value is initialised and works like other %feature
  15056. directives, eg
  15057. %javaconst(0); // all constants from this point on are initialised using the C value
  15058. %javaconst(1) BIG; // just BIG initialised using JNI call (must be parsed before BIG is defined)
  15059. 07/23/2002: beazley
  15060. *** IMPORTANT CHANGES TO THE PYTHON MODULE ***
  15061. (1) The Python module now enables shadow/proxy classes by default.
  15062. This means that two files are always created by SWIG. For
  15063. instance, if you have this:
  15064. // file: foo.i
  15065. %module foo
  15066. ...
  15067. Then swig generates two files "foo_wrap.c" and "foo.py".
  15068. (2) The name of the low-level C extension module has been changed
  15069. to start with a leading underscore. This means that you have
  15070. to compile the module as follows:
  15071. $ cc -c -I/usr/local/include/python2.2 foo_wrap.c
  15072. $ cc -shared foo_wrap.o $(OBJS) -o _foo.so
  15073. ^^^^
  15074. note extra underscore
  15075. This naming scheme is consistent with other Python modules that
  15076. utilize extension code. For instance, the socket module consists
  15077. of "_socket.so" and "socket.py". In previous versions of SWIG,
  15078. the shared object file was named "foocmodule.so".
  15079. (3) A new directive can be used to insert Python code into
  15080. the corresponding .py file. For example:
  15081. %pythoncode %{
  15082. def foo():
  15083. print "Hello World"
  15084. %}
  15085. This directive allows you to create modules as a mix of C and Python.
  15086. Python code is seamlessly added to the module.
  15087. (4) The -shadow command line option is deprecated. This is turned on
  15088. by default.
  15089. (5) To disable the generation of the extra python file, use the "-noproxy"
  15090. command line option.
  15091. *** POTENTIAL INCOMPATIBILITY ***
  15092. This change will likely break the build environment of projects that
  15093. utilize shadow classes. To fix this, you probably only need to
  15094. change the name of the target .so file. For example, if you have
  15095. Makefile information like this:
  15096. TARGET = examplecmodule.so
  15097. Just change it to:
  15098. TARGET = _example.so
  15099. *** DOCUMENTATION UPDATE ***
  15100. The file Doc/Manual/Python.html has been updated to describe these changes.
  15101. 07/23/2002: beazley
  15102. Added -noextern option. If supplied, SWIG will not generate
  15103. extra extern declarations. This is sometimes an issue on
  15104. non-unix platforms.
  15105. 07/23/2002: beazley
  15106. Added a warning for ignored friend functions.
  15107. 07/23/2002: beazley
  15108. Fixed [ 574498 ] -proxy and %include "pointer.i" clash.
  15109. Reported by David Creasy.
  15110. 07/23/2002: beazley
  15111. Fixed [ 576103 ] global destruction warning with shadow.
  15112. Perl extensions should no longer report the warning
  15113. "Use of uninitialized value during global destruction."
  15114. when running with "perl -w". Reported by
  15115. Brett Williams.
  15116. 07/23/2002: beazley
  15117. In C++ mode, SWIG now always defines namespace std. By default,
  15118. it's empty. However, this will silence errors from programs
  15119. that include statements such as "using namespace std;".
  15120. This fixes Bug [ 584017 ] using namespace std generates error.
  15121. Reported by Joseph Winston.
  15122. 07/22/2002: beazley
  15123. Added a new warning message for %apply. If you use %apply but no typemaps
  15124. are defined, you will get a warning message. This should help with
  15125. problems like this:
  15126. %apply char *OUTPUT { ... };
  15127. In old versions of SWIG, this silently did nothing. Now you get an error like this:
  15128. file:line. Warning. Can't apply (char *OUTPUT). No typemaps are defined.
  15129. 07/22/2002: cheetah (William Fulton)
  15130. [Java] Started Java pragma deprecation. Replacements use %typemap based
  15131. directives and enable proxy classes and the new type wrapper classes to be
  15132. tailored in various ways. These are the new typemaps:
  15133. %typemap(javabase) - base (extends) for Java class
  15134. %typemap(javaclassmodifiers) - class modifiers for the Java class: default is "public"
  15135. %typemap(javacode) - java code is copied verbatim to the Java class
  15136. %typemap(javaimports) - import statements for Java class
  15137. %typemap(javainterfaces) - interfaces (extends) for Java class
  15138. And these are the %pragma directives being deprecated:
  15139. allshadowbase
  15140. allshadowclassmodifiers
  15141. allshadowcode
  15142. allshadowimport
  15143. allshadowinterface
  15144. shadowbase
  15145. shadowclassmodifiers
  15146. shadowcode
  15147. shadowimport
  15148. shadowinterface
  15149. Note that it is possible to target a particular proxy class:
  15150. %typemap(javaimports) Foo "import java.util.*"
  15151. or a particular type wrapper class:
  15152. %typemap(javaimports) double* "import java.math.*"
  15153. Note that $javaclassname in these typemaps are substituted with either the proxy
  15154. classname when using proxy classes or the SWIGTYPE class name.
  15155. 07/18/2002: cheetah (William Fulton)
  15156. [Java] Java module overhaul to implement static type checking of all
  15157. types.
  15158. 1) Changes when using Java Proxy classes
  15159. ----------------------------------------
  15160. Previously when wrapping global functions:
  15161. class SomeClass{};
  15162. void foo(SomeClass* s);
  15163. SomeClass* bar();
  15164. The native method prototypes used a long for pointers and looked like this:
  15165. public class modulename {
  15166. ...
  15167. public final static native void foo(long jarg1);
  15168. public final static native long bar();
  15169. }
  15170. and unlike member functions of a C++ class there was no wrapper around the native calls
  15171. to make the use of them more user friendly. They would be used from Java like this:
  15172. SomeClass s = new SomeClass(modulename.bar(), false);
  15173. modulename.foo(s.getCPtrSomeClass());
  15174. Note that the following will have the same effect, but then it would not have
  15175. been possible to call any proxy member functions in SomeClass:
  15176. long s = modulename.bar();
  15177. modulename.foo(s);
  15178. Now wrapper functions are generated:
  15179. public class modulename {
  15180. public static void foo(SomeClass s) {
  15181. // calls the native function
  15182. }
  15183. public static SomeClass bar() {
  15184. // calls the native function
  15185. }
  15186. }
  15187. Which means these functions can now be used more naturally with proxy classes:
  15188. SomeClass s = modulename.bar();
  15189. modulename.foo(s);
  15190. 2) Changes when not using Java Proxy classes
  15191. --------------------------------------------
  15192. The so called low-level interface was rather low-level indeed. The
  15193. new static type checking implementation makes it less so but it remains a
  15194. functional interface to the C/C++ world. Proxy classes are the obvious way to use
  15195. SWIG generated code, but for those who want a functional interface all non-primitive
  15196. types now have a simple Java class wrapper around the C/C++ type. Pointers and
  15197. references to primitive types are also wrapped by type wrapper classes. The type
  15198. wrapper classnames are based on the SWIG descriptors used by the other language
  15199. modules. For example:
  15200. C/C++ type Java type wrapper class name
  15201. ---------- ----------------------------
  15202. int* SWIGTYPE_p_int
  15203. double** SWIGTYPE_p_p_double
  15204. SomeClass* SWIGTYPE_p_SomeClass
  15205. SomeClass& SWIGTYPE_p_SomeClass
  15206. SomeClass SWIGTYPE_p_SomeClass
  15207. Note that everything wrapped by SWIG is accessed via a pointer even when wrapping
  15208. functions that pass by value or reference. So the previous example would now be
  15209. used like this:
  15210. SWIGTYPE_p_SomeClass s = example.bar();
  15211. example.foo(s);
  15212. Note that typedefs that SWIG knows about are resolved, so that if one has
  15213. class Foo{};
  15214. typedef Foo Bar;
  15215. then any use of Bar will require one to use SWIGTYPE_p_Foo;
  15216. Some considerations:
  15217. Make sure you make a firm decision to use either proxy classes or the functional
  15218. interface early on as the classnames are different.
  15219. 3) Pointers and non-parsed types
  15220. --------------------------------
  15221. Sometimes SWIG cannot generate a proxy class. This occurs when the definition of
  15222. a type is not parsed by SWIG, but is then used as a variable or a parameter.
  15223. For example,
  15224. void foo(Snazzy sds);
  15225. If SWIG has not parsed Snazzy it handles it simply as a pointer to a Snazzy.
  15226. The Java module gives it a type wrapper class around the pointer and calls it
  15227. SWIGTYPE_p_Snazzy. In other words it handles it in the same manner as types are
  15228. handled in the low-level functional interface. This approach is used for all
  15229. non-proxy classes, eg all pointer to pointers and pointers to primitive types.
  15230. 4) Backwards compatibility
  15231. -----------------------
  15232. Backwards compatibility is not an issue if you have been using proxy classes and
  15233. no global variables/functions. Otherwise some changes will have to be made.
  15234. The native methods still exist but they are now in a JNI class, which is called
  15235. modulenameJNI. As this class is really part of the internal workings,
  15236. it should not be required so the class has become protected. Some pragmas/directives
  15237. will hopefully be added to help with backwards compatibility.
  15238. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  15239. 07/18/2002: beazley
  15240. Modified wrapping of uninstantiated templates returned by
  15241. value. Just to be safe, they are now wrapped by SwigValueWrapper<>
  15242. just in case they don't define a default constructor. This
  15243. would be used if you had code like this
  15244. Foo<int> blah();
  15245. void moreblah(Foo<int> x);
  15246. but you didn't instantiate Foo<int> using %template.
  15247. We should probably add a warning for this.
  15248. 07/17/2002: beazley
  15249. Added an error check to detect shadowed template paramaters.
  15250. For example:
  15251. template<class T> class Foo {
  15252. public:
  15253. int T;
  15254. };
  15255. This results in an error, not a warning. This warning is
  15256. also needed to fix some rather insidious problems like
  15257. this:
  15258. struct T {
  15259. int blah;
  15260. };
  15261. template<class T> class Foo {
  15262. public:
  15263. typedef T Traits; // Which T is this????
  15264. };
  15265. In this case, the template parameter T shadows the outer
  15266. structure (which is what you want).
  15267. 07/16/2002: beazley
  15268. Improved support for templates with integer arguments. SWIG is
  15269. much more aware of situations such as this:
  15270. const int Size = 100;
  15271. %template(Foo100) Foo<100>;
  15272. void bar(Foo<Size> *x); // Knows that Foo<Size> is the same as Foo<100>;
  15273. 07/15/2002: beazley
  15274. Fixed bug with %feature/%ignore/%rename and namespaces.
  15275. For example:
  15276. %ignore Foo::Bar
  15277. namespace Foo {
  15278. class Bar {
  15279. ...
  15280. };
  15281. }
  15282. Reported by Marcelo Matus.
  15283. 07/09/2002: beazley
  15284. Added parsing support for constructors that try to catch
  15285. exceptions in initializers. For example:
  15286. class Foo {
  15287. Bar b;
  15288. public:
  15289. Foo(int x) try
  15290. : b(x) { ... }
  15291. catch(int) {
  15292. ...
  15293. }
  15294. }
  15295. This has no effect on the generated wrappers. However, the try and catch
  15296. parts of the declaration are ignored. See Stroustrup, 3rd Ed, section
  15297. 14.4.6.1 for details.
  15298. 07/06/2002: beazley
  15299. Fixed bug in template symbol table management. This fixes
  15300. two bugs. First, mixing abstract methods, templates, and
  15301. inheritance no longer generates a failed assertion.
  15302. template <class T>
  15303. class A {
  15304. public:
  15305. virtual void foo() = 0;
  15306. };
  15307. template <class T>
  15308. class B : public A<T>
  15309. {
  15310. };
  15311. %template(A_int) A<int>;
  15312. %template(B_int) B<int>;
  15313. This fix also fixes a subtle problem with default values and
  15314. templates. For example:
  15315. template <class C>
  15316. struct B {
  15317. typedef unsigned int size_type;
  15318. static const size_type nindex = static_cast<size_type>(-1);
  15319. void foo(size_type index = nindex);
  15320. };
  15321. Bugs reported by Marcelo Matus.
  15322. 07/05/2002: ljohnson (Lyle Johnson)
  15323. [Ruby] Changed the definition of the SWIG_ConvertPtr() function
  15324. for the SWIG/Ruby runtime support so that it looks like the
  15325. Python version. If the last argument (flags) is non-zero,
  15326. SWIG_ConvertPtr() will raise an exception for type mismatches
  15327. as before. If flags is zero, this function will return -1 for
  15328. type mismatches without raising an exception.
  15329. *** POTENTIAL INCOMPATIBILITY FOR RUBY MODULE ***
  15330. 07/04/2002: beazley
  15331. Overloaded functions/methods/constructors now work in many language
  15332. modules. The support is completely transparent--just call the
  15333. function normally and SWIG will dispatch to the correct implementation.
  15334. There are a variety of issues associated with this. Please refer
  15335. to the overloading section of Doc/Manual/SWIGPlus.html for details.
  15336. *** NEW FEATURE ***
  15337. 07/04/2002: beazley
  15338. Fixed a bug with namespaces, enums, and templates. For example:
  15339. namespace hello {
  15340. enum Hello { Hi, Hola };
  15341. template <Hello H>
  15342. struct traits
  15343. {
  15344. typedef double value_type;
  15345. };
  15346. traits<Hi>::value_type say_hi()
  15347. {
  15348. return traits<Hi>::value_type(1);
  15349. }
  15350. }
  15351. SWIG wasn't generating wrappers that properly qualified
  15352. traits<Hi>. Reported by Marcelo Matus.
  15353. 06/30/2002: beazley
  15354. Supplied array variable typemaps for Tcl module. If you have a
  15355. variable like this:
  15356. int foo[10];
  15357. then a set function like this is generated:
  15358. void foo_set(int *x) {
  15359. memmove(foo,x,10*sizeof(int));
  15360. }
  15361. 06/30/2002: beazley
  15362. New %fragment directive. When writing typemaps, it can be easy to
  15363. get carried away and write a lot of code. However, doing so causes
  15364. tremendous code bloat. A common way to solve this is to write
  15365. helper functions. For example:
  15366. %{
  15367. void some_helper_function() {
  15368. ...
  15369. }
  15370. %}
  15371. %typemap(in) type {
  15372. some_helper_function(...);
  15373. }
  15374. The only problem with this is that the wrapper file gets polluted
  15375. with helper functions even if they aren't used. To fix this,
  15376. a new fragment directive is available. For example:
  15377. (corrected typo in line below - 06/26/2008)
  15378. %fragment("type_header","header") %{
  15379. void some_helper_function() {
  15380. ...
  15381. }
  15382. %}
  15383. %typemap(in, fragment="type_header") type {
  15384. some_helper_function(...);
  15385. }
  15386. In this case, the code fragment is only emitted if the typemap is
  15387. actually used. A similar capability is provided for declaration
  15388. annotation and the %feature directive. For example:
  15389. %feature("fragment","type_header") SomeDeclaration;
  15390. The first argument to %fragment is the fragment name. The second argument
  15391. is the file section where the fragment should be emitted.
  15392. The primary use of this directive is for writers of language modules
  15393. and advanced users wanting to streamline typemap code.
  15394. *** EXPERIMENTAL NEW FEATURE ***
  15395. 06/30/2002: beazley
  15396. Supplied memberin typemaps for all arrays in an attempt to eliminate
  15397. confusion about their use.
  15398. 06/29/2002: beazley
  15399. Experimental support for smart-pointers. When a class defines
  15400. operator->() like this
  15401. class Foo {
  15402. ...
  15403. Bar *operator->();
  15404. ...
  15405. };
  15406. SWIG locates class Bar and tries to wrap its member variables and
  15407. methods as part of Foo. For example, if Bar was defined like this:
  15408. class Bar {
  15409. public:
  15410. int x;
  15411. int spam();
  15412. };
  15413. You could do this (in the target language):
  15414. f = Foo()
  15415. f.x = 4 # Accesses Bar::x
  15416. f.spam() # Accesses Bar::spam
  15417. The primary use of this feature is to emulate the behavior of C++
  15418. smart-pointers---which allow attributes to accessed transparently
  15419. through operator->.
  15420. This feature is supported automatically in SWIG---no special directives
  15421. are needed. To disable this behavior. Use %ignore to ignore
  15422. operator->.
  15423. *** NEW FEATURE ***
  15424. 06/26/2002: beazley
  15425. Deprecated the %except directive. %exception should be used instead.
  15426. 06/25/2002: beazley
  15427. Major cleanup of the modules directory. Eliminated most
  15428. header files, consolidated module code into single files.
  15429. 06/24/2002: beazley
  15430. Reworked the instantiation of language modules. All language
  15431. modules must now define a factory function similar to this:
  15432. extern "C" Language *
  15433. swig_python(void) {
  15434. return new PYTHON();
  15435. }
  15436. This function is then placed in a table and associated with
  15437. a command line option in swigmain.cxx.
  15438. This approach has a number of benefits. It decouples the
  15439. SWIG main program from having to know about the class
  15440. definitions for each module. Also, by using a factory
  15441. function, it will be easier to implement dynamic loading
  15442. of modules (simply load the file and invoke the factory
  15443. function).
  15444. 06/24/2002: beazley
  15445. Fixed syntax error for reference conversions. For example:
  15446. operator Foo &();
  15447. 06/24/2002: beazley
  15448. Fixed syntax error for operator new[] and operator delete[].
  15449. 06/24/2002: beazley
  15450. Fixed code generation problem for constants and default arguments
  15451. involving templates.
  15452. 06/19/2002: ljohnson (Lyle Johnson)
  15453. [Ruby] Fixed a bug for the '-feature' command line argument;
  15454. that setting was effectively being ignored and so the feature
  15455. name was always set equal to the module name.
  15456. 06/17/2002: beazley
  15457. Fixed problems with static members and enums in templates.
  15458. Version 1.3.13 (June 17, 2002)
  15459. ==============================
  15460. 06/16/2002: beazley
  15461. Fixed a bug with __FILE__ expansion in the preprocessor. On Windows,
  15462. the backslash (\) is now converted to (\\) in the string literal
  15463. used for __FILE__. Reported by Steve Glaser.
  15464. 06/14/2002: beazley
  15465. Fixed warning message about 'name private in this context'. The
  15466. warning is only generated for public methods. Reported by
  15467. Scott Michel.
  15468. 06/14/2002: beazley
  15469. Fixed some problems related to template instantiation
  15470. and namespaces. When SWIG expands a template, it does
  15471. so with fully resolved types. For example, if you have this:
  15472. template<class T> class foo { };
  15473. typedef double Double;
  15474. %template(foo_d) foo<Double>;
  15475. then, it is handled as foo<double> in the typesystem.
  15476. This fixes a number of subtle problems with inheritance
  15477. and templates.
  15478. 06/14/2002: ljohnson (Lyle Johnson)
  15479. [Ruby] Added missing bool typemaps for INPUT, OUTPUT and
  15480. INOUT in Lib/ruby/typemaps.i.
  15481. 05/29/2002: cheetah (William Fulton)
  15482. [Java] Fix for a couple of broken pragmas.
  15483. 05/29/2002: cheetah (William Fulton)
  15484. Fix for unnecessary cast when wrapping global variable where
  15485. the type is not parsed by SWIG - Java variables example
  15486. failure as reported by Larry Virden.
  15487. 06/10/2002: beazley
  15488. Modified %template to allow for empty instantiations.
  15489. %template() foo<int,int>;
  15490. This registers foo<int,int> with the type system, but
  15491. doesn't wrap it (same as %ignore). This may only be a
  15492. temporary measure. SWIG might be able to automatically
  15493. instantiate templates in certain cases.
  15494. 06/10/2002: beazley
  15495. Fixed function prototype problems with Tcl 8.4
  15496. 06/09/2002: beazley
  15497. Fixed problem with templates and location of base classes.
  15498. This one is a little mind-bending, but here is an example
  15499. that illustrates:
  15500. template <class ArgType, class ResType>
  15501. struct traits
  15502. {
  15503. typedef ArgType arg_type;
  15504. typedef ResType res_type;
  15505. };
  15506. template <class ArgType, class ResType>
  15507. struct Function
  15508. {
  15509. };
  15510. template <class AF, class AG>
  15511. struct Class : Function<typename traits<AF, AG>::arg_type,
  15512. typename traits<AF, AG>::res_type>
  15513. {
  15514. };
  15515. %template(traits_dd) traits <double, double>;
  15516. %template(Function_dd) Function <double, double>;
  15517. %template(Class_dd) Class <double, double>;
  15518. In this example, the base class of 'Class' is determined from
  15519. the Function template, but the types are obtained through typedefs.
  15520. Because of this, SWIG could not locate the wrapped base class
  15521. (Function<double,double>). Should be fixed in 1.3.13 even
  15522. though I can think of a million other things that might
  15523. also be broken.
  15524. 06/07/2002: beazley
  15525. Fixed a problem with conversion operators. If you had an
  15526. operator like this,
  15527. operator double() const;
  15528. SWIG was ommitting the "const" qualifier. This affected
  15529. %rename and other directives. Reported by Zhong Ren.
  15530. 06/07/2002: beazley
  15531. Lessened the strictness of abstract class checking. If
  15532. you have code like this:
  15533. class Foo {
  15534. public:
  15535. virtual int method() = 0;
  15536. };
  15537. class Bar : public Foo {
  15538. public:
  15539. Bar();
  15540. ~Bar();
  15541. };
  15542. SWIG will go ahead and generate constructor/destructors
  15543. for Bar. However, it will also generate a warning message
  15544. that "Bar" might be abstract (since method() isn't defined).
  15545. In SWIG-1.3.12, SWIG refused to generate a constructor at all.
  15546. 06/07/2002: beazley
  15547. Change to %template directive. If you specify something like this:
  15548. %template(vi) std::vector<int>;
  15549. It is *exactly* the same as this:
  15550. namespace std {
  15551. %template(vi) vector<int>;
  15552. }
  15553. SWIG-1.3.12 tried to instantiate the template outside of the namespace
  15554. using some trick. However, this was extremely problematic and full
  15555. holes. This version is safer.
  15556. 06/07/2002: beazley
  15557. Fixed bug with scope qualification and templates. For example:
  15558. A<B::C>::DD
  15559. Before, this was separated as scopes A<B, C>, and DD. Fixed now.
  15560. 06/06/2002: beazley
  15561. Allow the following syntax:
  15562. class A { };
  15563. struct B : A { ... };
  15564. A base class without a specifier is assumed to be public for a struct.
  15565. 06/06/2002: beazley
  15566. Fixed syntax error with template constructor initializers.
  15567. Reported by Marcelo Matus.
  15568. 06/06/2002: beazley
  15569. Fixed bug with default template arguments.
  15570. Reported by Marcelo Matus.
  15571. 06/05/2002: beazley
  15572. Fixed subtle problems with %rename directive and template
  15573. expansion.
  15574. Code like this should now work:
  15575. %rename(blah) foo<double>::method;
  15576. ...
  15577. template<class T> class foo {
  15578. public:
  15579. void method();
  15580. };
  15581. %template(whatever) foo<double>;
  15582. 06/05/2002: beazley
  15583. Resolved some tricky issues of multi-pass compilation and
  15584. and inheritance. The following situation now generates
  15585. an error:
  15586. class Foo : public Bar {
  15587. ...
  15588. };
  15589. class Bar {
  15590. ...
  15591. };
  15592. The following code generates a warning about incomplete classes.
  15593. class Bar;
  15594. class Foo : public Bar { };
  15595. The following code generates a warning about an undefined class.
  15596. class Foo : public Bar { }; // Bar undefined
  15597. This fixes a failed assertion bug reported by Jason Stewart.
  15598. 06/05/2002: ljohnson
  15599. [Ruby] Added a warning message for the Ruby module about the lack
  15600. of support for multiple inheritance. Only the first base class
  15601. listed is used and the others are ignored. (Reported by Craig
  15602. Files).
  15603. 06/03/2002: beazley
  15604. Fixed a bug with struct declarations and typedef. For example:
  15605. typedef struct Foo Foo;
  15606. struct Foo {
  15607. ...
  15608. };
  15609. A few other subtle struct related typing problems were
  15610. also resolved.
  15611. Version 1.3.12 (June 2, 2002)
  15612. =============================
  15613. 05/30/2002: beazley
  15614. Fixed problem related to forward template class declarations and
  15615. namespaces. Bug reported by Marcelo Matus.
  15616. 05/30/2002: beazley
  15617. Added 'make uninstall' target. Contributed by Joel Reed.
  15618. 05/29/2002: beazley
  15619. Fixed rather insidious bug with %rename, %feature and template specialization.
  15620. For example:
  15621. %exception vector::__getitem__ {
  15622. ... some exception ...
  15623. }
  15624. template<class T> class vector {
  15625. ...
  15626. T __getitem__(int index); // Fine
  15627. ...
  15628. };
  15629. template<> class vector<int> {
  15630. ...
  15631. T __getitem__(int index); // Oops.
  15632. ...
  15633. };
  15634. Now, the %exception directive (and other features) should correctly apply to
  15635. both vector and specializations.
  15636. 05/29/2002: beazley
  15637. Subtle changes to %template() directive. Template arguments are now
  15638. reduced to primitive types in template matching. For example:
  15639. template<class T> class vector<T *> {
  15640. ... partial specialization ...
  15641. }
  15642. typedef int *IntPtr; // Gross typedef
  15643. // Gets the above partial specialization
  15644. %template(vectorIntPtr) vector<IntPtr>;
  15645. This change is extremely subtle, but it fixes a number of potential
  15646. holes in Luigi's STL library modules. For example:
  15647. typedef int Integer;
  15648. %template(vectori) vector<int>;
  15649. 05/29/2002: beazley
  15650. Fixed rather insidious typemap bug related to const. const
  15651. was being discarded through typedefs.
  15652. 05/29/2002: ljohnson (Lyle Johnson)
  15653. [Ruby] Added input typemaps for const references to primitive
  15654. types (in Lib/ruby/ruby.swg).
  15655. 05/29/2002: cheetah (William Fulton)
  15656. [Java] The java arrray support functions are enclosed by
  15657. a SWIG_NOARRAYS #define. Useful if not using arrays and
  15658. it is desirable to minimise the amount of compiled code.
  15659. 05/29/2002: cheetah (William Fulton)
  15660. [Java] Enums were not renamed when using %name or %rename
  15661. fix.
  15662. 05/28/2002: ljohnson
  15663. [Ruby] Modified the name of the wrapper functions for the
  15664. "new" singleton method and "initialize" instance method for
  15665. consistency with the other language modules. The wrapper name
  15666. for the function that implements "new" is alloc_classname and
  15667. the wrapper name for the function that implements "initialize"
  15668. is new_classname.
  15669. 05/27/2002: beazley
  15670. Changes to runtime. Pointer conversion/creation functions
  15671. now almost always have an extra "flags" argument. For
  15672. example:
  15673. SWIG_ConvertPtr(obj, void **, swig_type_info *ty, int flags);
  15674. ^^^^^^^^^^
  15675. This extra parameter is reserved for future expansion and will
  15676. be used for more control over pointers in future versions.
  15677. 05/27/2002: beazley
  15678. Fix for C++ classes with private assignment operators. It
  15679. is now possible to safely return objects like this by value.
  15680. Caveat: the class must provide a copy constructor.
  15681. 05/26/2002: beazley
  15682. -proxy option added to many language modules. This is the
  15683. same as -shadow. We are merely changing terminology.
  15684. 05/26/2002: beazley
  15685. [perl] Fixed some inconsistencies in the -package option.
  15686. -package merely sets the package name to be used on the
  15687. wrappers. It does not change the name of the shared library
  15688. file or the name of the generated .pm file. This was
  15689. broken at some point, but works again now.
  15690. 05/25/2002: beazley
  15691. [perl] Fixed [ 475452 ] memory leak in return-by-value.
  15692. Problem related to static member variables returning newly
  15693. allocated objects. Reported by Roy Lecates.
  15694. 05/25/2002: beazley
  15695. [perl] Fixed [ 513134 ] %BLESSEDMEMBERS isn't always right.
  15696. Reported by Fleur Diana Dragan.
  15697. 05/25/2002: beazley
  15698. Fixed [ 540735 ] -importall and the -I option.
  15699. 05/25/2002: beazley
  15700. [guile] Fixed [ 532723 ] Default arg for char* can SegV.
  15701. Error in guile module. Reported by Brett Williams.
  15702. 05/25/2002: beazley
  15703. Subtle change to typemap application code. The "freearg"
  15704. typemap must exactly match up with the "in" or "ignore"
  15705. typemap. For example:
  15706. %typemap(in) (char *data, int len) { ... }
  15707. %typemap(freearg) char *data { ... }
  15708. void foo(char *data, int len);
  15709. In this case, the "in" typemap is applied, but the
  15710. freearg typemap is not. This is because the freearg
  15711. typemap doesn't match up with the input argument sequence.
  15712. 05/25/2002: beazley
  15713. Fixed [ 548272 ] Default argument code missing braces.
  15714. Reported by Brett Williams.
  15715. 05/25/2002: beazley
  15716. Fixed [ 547730 ] SwigValueWrapper needed for constructors.
  15717. Reported by William Fulton.
  15718. 05/25/2002: beazley
  15719. Undefined identifiers now evaluate to 0 when evaluating
  15720. preprocessor expressions. For example:
  15721. #if !FOO
  15722. ...
  15723. #endif
  15724. where FOO is undefined or set to some non-numeric value.
  15725. Fixes [ 540868 ] #if defined whatever - not parsed.
  15726. Reported by Adam Hupp.
  15727. 05/24/2002: beazley
  15728. SWIG now ignores the C++ 'export' keyword.
  15729. 05/23/2002: beazley
  15730. Some refinement of type-name mangling to account for pointers, arrays,
  15731. references, and other embedded type constructs.
  15732. 05/23/2002: beazley
  15733. Initial attempt at supporting template partial specialization. At
  15734. the very least, it is parsed and the classes are stored. Matching
  15735. of instantiations to specialized version is more limited and based on
  15736. the SWIG default typemap rules:
  15737. SWIGTYPE *
  15738. SWIGTYPE []
  15739. SWIGTYPE &
  15740. Now, why in the world would you want to use this feature? Other
  15741. than allowing for slightly modified class APIs, this capability is
  15742. primarily used to provide advanced wrapping support for STL-like
  15743. objects. It can also be mixed with typemaps. Here is an example:
  15744. /* Generic version */
  15745. template<class T> class vector {
  15746. %typemap(in) vector<T> * {
  15747. // A container of objects
  15748. }
  15749. };
  15750. /* Partial specialization (pointers) */
  15751. template<class T> class vector<T *> {
  15752. %typemap(in) vector<T> * {
  15753. // A container of pointers to objects.
  15754. }
  15755. };
  15756. /* Specialization (integers). */
  15757. template<> class vector<int> {
  15758. %typemap(in) vector<int> * {
  15759. // A container of integers.
  15760. }
  15761. };
  15762. *** EXPERIMENTAL FEATURE ***
  15763. 05/23/2002: beazley
  15764. Enhancement to typemaps. Normally, typemap variables are
  15765. renamed to avoid conflicts. For example:
  15766. %typemap(in) int * (int temp) {
  15767. $1 = &temp;
  15768. }
  15769. This results in code that creates and uses variables "temp1","temp2",
  15770. "temp3" and so forth depending on how many times the typemap is used.
  15771. Sometimes you want a single variable instead. To do that, using
  15772. the following naming scheme:
  15773. %typemap(in) int *(int _global_temp) {
  15774. }
  15775. Is this case, a single variable _global_temp is emitted in the
  15776. wrapper functions. It is shared across all typemaps. Repeated
  15777. typemaps do not replicate the variable---they use the first one
  15778. emitted.
  15779. *** NEW FEATURE ***
  15780. 05/23/2002: beazley
  15781. Minor enhancement to typemaps. If you have this code,
  15782. %typemap(in) Foo (int somevar = 3) {
  15783. ...
  15784. }
  15785. the default value for somevar is now emitted into the wrapper code.
  15786. 05/22/2002: beazley
  15787. Fixed %extend to be better behaved in namespaces. If you have code
  15788. like this:
  15789. namespace foo {
  15790. struct bar {
  15791. %extend {
  15792. void blah();
  15793. };
  15794. };
  15795. }
  15796. SWIG matches the blah() method to a C function named
  15797. void foo_bar_blah(foo::bar *self).
  15798. This is consistent with the non-namespace version.
  15799. Bug reported by Marcelo Matus.
  15800. 05/22/2002: beazley
  15801. New library files: cpointer.i, carrays.i, cmalloc.i. These
  15802. provide access to C pointers and memory allocation functions.
  15803. See Doc/Manual/Library.html for details.
  15804. 05/22/2002: cheetah (William Fulton)
  15805. [Java] C type char no longer maps to Java type byte, but to Java type char.
  15806. It is now treated as a character rather than a signed number. This fits in
  15807. with the other language modules and is a more natural mapping as char* is
  15808. mapped as a string of characters. Note that the C signed char type is still
  15809. mapped to a Java byte.
  15810. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  15811. 05/22/2002: cheetah (William Fulton)
  15812. [Java] Improved constants wrapping. Constants (#define and %constant) values
  15813. are now obtained through a JNI call. Previously the value was compiled as
  15814. Java code, but this didn't work for all cases, eg #define 123ULL.
  15815. 05/22/2002: beazley
  15816. Fixed bogus error message with %extend directive and C++
  15817. access specifiers. Reported by Marcelo Matus.
  15818. 05/22/2002: beazley
  15819. Namespaces and enums now work correctly. For example:
  15820. namespace Foo {
  15821. enum Bar { A, B };
  15822. }
  15823. Bug reported by Marcelo Matus.
  15824. 05/21/2002: beazley
  15825. The %types directive can now be used to specify inheritance relationships
  15826. in the runtime type system. For example,
  15827. %types(Foo = Bar);
  15828. specifies that Foo isa Bar. Using this is potentially quite dangerous.
  15829. However, this is useful in certain cases (and in the SWIG library).
  15830. 05/20/2002: beazley
  15831. %nodefault and %makedefault directives now require a trailing semicolon.
  15832. For example:
  15833. %nodefault;
  15834. ...
  15835. %makedefault;
  15836. In addition both directives can take a class name. For example:
  15837. %nodefault Foo;
  15838. class Foo { /* No default constructor/destructor */
  15839. };
  15840. class Bar { /* Default constructor/destructor generated */
  15841. };
  15842. *** POTENTIAL INCOMPATIBILITY ***
  15843. If you don't use the trailing semicolon, things will mysteriously break.
  15844. 05/20/2002: beazley
  15845. More improvements to type system handling. SWIG now correctly handles
  15846. template names and parameters in a namespace. For example:
  15847. namespace foo {
  15848. template<class T> class bar { };
  15849. typedef int Integer;
  15850. void blah(bar<Integer> *x);
  15851. };
  15852. In the generated code, all of the typenames are properly qualified.
  15853. 05/17/2002: cheetah (William Fulton)
  15854. [Java] deprecated broken -jnic and -jnicpp commandline options. The C or C++
  15855. JNI calling convention is now determined from the -c++ commandline option.
  15856. 05/16/2002: cheetah (William Fulton)
  15857. [Java] The JCALL macros which exist so that the same typemaps can be used
  15858. for generating both the C and C++ JNI calling conventions no longer appear
  15859. in the generated code. This is because the output is now passed through the
  15860. SWIG preprocessor which does the macro expansion for either C or C++ (depending
  15861. on whether -c++ is passed on the SWIG commandline).
  15862. The generation of the functions used in the array typemaps have been adjusted
  15863. to take account of this. The side effect is that any typemaps which contained
  15864. JCALL macros within %{ %} brackets will have to be moved within {} brackets
  15865. so that the SWIG preprocessor can expand the macros.
  15866. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  15867. 05/13/2002: beazley
  15868. Class templates may now be used as template parameters. For example:
  15869. template<class T, template<class> class C> class Foo {
  15870. ...
  15871. };
  15872. template<class T> class Bar {
  15873. ...
  15874. };
  15875. %template(Fooi) Foo<int, Bar>;
  15876. SWIG doesn't really do anything special with this---it's just
  15877. another way of specifying a template parameter.
  15878. 05/13/2002: beazley
  15879. Minor refinement of template support. Template parameter names are no longer
  15880. required for types. For example:
  15881. template<bool> class Foo {
  15882. };
  15883. Obviously, names are required for template<class T>;
  15884. 05/12/2002: beazley
  15885. New macro expansion in typemaps. The sequence:
  15886. $descriptor(type)
  15887. Will expand into the SWIG type descriptor structor for
  15888. the given type. Type may be any abstract datatype.
  15889. For example:
  15890. $descriptor(int *)
  15891. $descriptor(int (*)(int,double))
  15892. $descriptor(vector<int> *)
  15893. Caveat: It is *NOT* currently legal to use other typemap
  15894. substitution variables in the macro. For example
  15895. $descriptor($1_type).
  15896. The primary purpose of this modification is to better
  15897. support typemaps for container objects or to allow typemaps
  15898. that might be performing type conversions.
  15899. *** NEW FEATURE ***
  15900. 05/11/2002: beazley
  15901. The wrapping of references to primitive types has been
  15902. changed as follows:
  15903. Arguments of type 'const primitive &' are now passed
  15904. by value as opposed to pointers. Return values of
  15905. type 'const primitive &' are returned as values instead of
  15906. pointers.
  15907. 'primitive' is any one of int, short, long, long long,
  15908. char, float, double, bool (as well as unsigned variants).
  15909. This change is being made to better support C++ wrapping--especially
  15910. code that makes use of templates and the STL.
  15911. 05/11/2002: beazley
  15912. The %template directive can now be used to access templates
  15913. in a namespace. For example:
  15914. namespace std {
  15915. template<class T> class complex {
  15916. T re, im;
  15917. public:
  15918. complex(T _r = T(), T _i = T()) : re(_r), im(_i) { }
  15919. T real() { return re; }
  15920. T imag() { return im; }
  15921. };
  15922. }
  15923. %template(complex) std::complex<double>;
  15924. Note: There are some very subtle namespace/symbol table
  15925. management issues involved in the implementation of this.
  15926. It may not work in certain cases.
  15927. 05/10/2002: beazley
  15928. Member template constructor support added. For example:
  15929. template<typename _T1, typename _T2>
  15930. struct pair {
  15931. _T1 first;
  15932. _T2 second;
  15933. pair() : first(_T1()), second(_T2()) { }
  15934. template<class _U1, class _U2> pair(const pair<_U1,_U2> &x);
  15935. };
  15936. To instantiate the template, use %template and %extend.
  15937. For example, this expands the constructor into a default
  15938. copy constructor:
  15939. %extend pair {
  15940. %template(pair) pair<_T1,_T2>;
  15941. }
  15942. Highly experimental. Other uses may be broken.
  15943. 05/10/2002: beazley
  15944. The %extend (%addmethods) directive no longer works unless
  15945. it appears in the public section of a class. An error
  15946. message is now generated (as opposed to a segmentation fault).
  15947. 05/09/2002: beazley
  15948. New %warnfilter() directive. This directive attaches a warning
  15949. filter to specific declarations and has the same semantics as
  15950. %rename, %ignore, %feature, and so forth. For example:
  15951. %warnfilter(501) foo; // Suppress overloaded warning
  15952. int foo(int);
  15953. int foo(double);
  15954. or
  15955. %warnfilter(501) Object::foo(double);
  15956. class Object {
  15957. public:
  15958. int foo(int);
  15959. int foo(double);
  15960. };
  15961. This feature only suppresses warnings in later stages of code
  15962. generation. It does not suppress warnings related to preprocessing
  15963. or parsing.
  15964. *** NEW FEATURE ***
  15965. 05/09/2002: beazley
  15966. SWIG now supports C99 variadic preprocessor macros. For example:
  15967. #define debugf(fmt,...) fprintf(stderr,fmt,__VA_ARGS__)
  15968. The argument "..." is used to indicate variable arguments which
  15969. are all placed into the special argument name __VA_ARGS__ in
  15970. the macro expansion.
  15971. SWIG also implements the GNU (##) extension for swallowing the
  15972. preceding comma when __VA_ARGS__ is empty. For example:
  15973. #define debugf(fmt,...) fprintf(stderr,fmt, ##__VA_ARGS__)
  15974. Here is how this is expanded:
  15975. debugf("%d", 3) --> fprintf(stderr,"%d",3)
  15976. debugf("Hello") --> fprintf(stderr,"Hello" )
  15977. (notice the deleted comma).
  15978. *** NEW FEATURE ***
  15979. 05/08/2002: samjam (Sam Liddicott)
  15980. Many changes to php module. Shadow classes are now implemented
  15981. entirely in native C and no need for php-code shadow wrappers
  15982. Populated template config.m4 and Makefile.in as needed by
  15983. phpize are generated.
  15984. 05/08/2002: ljohnson (Lyle Johnson)
  15985. [Ruby] A copy constructor is now turned into a "clone"
  15986. instance method (see Dave's change for copy constructors
  15987. dated 4/7/2002). This seems like the appropriate thing
  15988. to do for Ruby code.
  15989. 05/08/2002: ljohnson (Lyle Johnson)
  15990. [Ruby] Fixed [ 553864 ] Inline destructor code not written.
  15991. 05/08/2002: beazley
  15992. %ignore behaves better with constructors, destructors, and the
  15993. type system in general. For constructors and destructors,
  15994. %ignore now suppresses the creation of a default constructor
  15995. or destructor. For example:
  15996. %ignore ~Foo;
  15997. class Foo {
  15998. public:
  15999. Foo();
  16000. ~Foo();
  16001. ...
  16002. };
  16003. In SWIG-1.3.11, ~Foo() simply "disappeared" and the code generator
  16004. created a wrapper for a default destructor (as if it was never
  16005. declared in the interface). In SWIG-1.3.12, %ignore suppresses
  16006. the creation of a destructor if one is actually defined.
  16007. Similarly, even though a declaration is ignored, information
  16008. may still be needed to properly handle types. For example, here
  16009. is a very subtle error that is fixed by this change:
  16010. %ignore std::string; // Prevent class wrapping
  16011. namespace std {
  16012. class string {
  16013. ...
  16014. };
  16015. %typemap(in) string * {
  16016. ...
  16017. }
  16018. }
  16019. void foo(std::string *s); // Broken.
  16020. Before this fix, %ignore would cause the class definition to disappear.
  16021. This, in turn, would cause the typemap to be misapplied.
  16022. 05/08/2002: beazley
  16023. Minor changes to %rename, %ignore, %feature, and related directives
  16024. for better support of destructors. Destructors can now be precisely
  16025. tagged. For example:
  16026. %ignore Foo::~Foo;
  16027. %feature("action") ~Bar {
  16028. ...
  16029. }
  16030. *Developer warning*
  16031. Operations such as renaming and feature attachment for classes used to
  16032. be applied to destructors as well. For instance, if you did this:
  16033. %rename(Bar) Foo;
  16034. The operation applied to the class itself, the constructor, and
  16035. the destructor. This is no longer the case. Now such operations
  16036. will only apply to the class and the constructor. Note: if you
  16037. were relying on this for class renaming, be aware that renamed
  16038. classes should really only be handled at the level of the class itself
  16039. and not the level of individual declarations in the class (although
  16040. they can be renamed individually if needed). As far as I know,
  16041. the Language class is already taking care of this case correctly.
  16042. 05/07/2002: beazley
  16043. New set of tests. The Examples/test-suite/errors directory contains
  16044. tests that try to exercise all of SWIG's error and warning messages.
  16045. 05/07/2002: beazley
  16046. Start of a warning framework. Warning messages are now assigned numeric values
  16047. that are shown in warning messages. These can be suppressed using the
  16048. -w option. For example:
  16049. swig -w302 example.i
  16050. swig -w302,305 example.i
  16051. Alternatively, the #pragma preprocessor directive can be used to disable this:
  16052. #pragma SWIG nowarn=302
  16053. #pragma SWIG nowarn=302,305
  16054. Note: Since SWIG is a multi-pass compiler, this pragma should
  16055. only be used to change global settings of the warning filter. It should
  16056. not be used to selectively enable/disable warnings in an interface file.
  16057. The handling of #pragma occurs in the C++ preprocoessor and affects all
  16058. subsequent stages of compilation.
  16059. The -Wall option turns on all warnings and overrides any filters that
  16060. might have been set.
  16061. Warnings can be issued from an interface using %warn. For example:
  16062. %warn "110:%section is deprecated"
  16063. The first part of a warning message is an optional warning number.
  16064. A complete set of warning numbers is found in Source/Include/swigwarn.h.
  16065. *** NEW FEATURE ***
  16066. 05/07/2002: beazley
  16067. Internal parsing change. Directives to include files now use brackets [ ... ]
  16068. instead of { ... }.
  16069. %includefile "foo.i" [
  16070. ...
  16071. ]
  16072. The use of { ... } was a bad choice because they were included implicitly by
  16073. the preprocessor and made it impossible to properly detect legitimate missing '}'
  16074. errors.
  16075. 04/16/2002-
  16076. 05/02/2002: beazley
  16077. SWIG European Tour: Paris-Amsterdam-Bath.
  16078. 04/23/2002: beazley
  16079. The %addmethods directive has been renamed to %extend.
  16080. For example:
  16081. class Foo {
  16082. ...
  16083. };
  16084. %extend Foo {
  16085. int blah() { ... };
  16086. int bar() { ... };
  16087. ...
  16088. };
  16089. Motivation: the %addmethods directive can be used for many
  16090. other tasks including adding synthesized attributes, constructors,
  16091. and typemaps. Because of this, "addmethods" is somewhat misleading.
  16092. %extend more precisely describes this operation---extension of a
  16093. class or structure.
  16094. *** POTENTIAL INCOMPATIBILITY ***
  16095. %addmethods still works via a macro definition. However,
  16096. a warning message may be generated. Errors involving %addmethods
  16097. will actually refer to the %extend directive.
  16098. 04/23/2002: beazley
  16099. Further refinement of the type system. Typedef now
  16100. propagates through functions, pointers to functions,
  16101. and pointers to member functions.
  16102. For example:
  16103. typedef int Integer;
  16104. void foo(int (*x)(int), Integer (*y)(Integer));
  16105. In this case, arguments 'x' and 'y' have exactly
  16106. the same type (and would obviously accept objects
  16107. of either type).
  16108. Similarly, consider this:
  16109. class Foo {
  16110. };
  16111. typedef Foo Bar;
  16112. void bar(int (Foo::*x)(int), int (Bar::*y)(int));
  16113. In this case, arguments x and y are the same
  16114. type (via typedef).
  16115. 04/22/2002: beazley
  16116. SWIG now generates a warning message if any part of
  16117. an expression involves values from a private part of a class.
  16118. For example:
  16119. class Foo {
  16120. private:
  16121. static int X;
  16122. public:
  16123. void blah(int a, int b = X); // Warning
  16124. };
  16125. In this case, the default argument is ignored. There
  16126. are workarounds, but they are rather clumsy. For instance,
  16127. you might do this:
  16128. %feature("action") blah(int,int) {
  16129. if ($nargs == 1) {
  16130. result = blah(arg1);
  16131. } else {
  16132. result = blah(arg1,arg2);
  16133. }
  16134. }
  16135. void blah(int a, int b = 0);
  16136. 04/21/2002: beazley
  16137. Use of the %inline directive inside a namespace is
  16138. forbidden and now generates an error message. This is
  16139. not allowed since the inlined code that is emitted is
  16140. not placed inside a namespace. This confuses other
  16141. stages of parsing.
  16142. 04/21/2002: beazley
  16143. Some bug fixes to casting operations and expression
  16144. parsing. Due to some parsing issues, it is not
  16145. currently possible to use casts for all possible
  16146. datatypes. However, the common cases work.
  16147. 04/20/2002: beazley (Amsterdam)
  16148. Member templates now work. Simply use the %template
  16149. directive inside a class or %addmethods to create
  16150. instantiations (see Doc/Manual/SWIGPlus.html). Supporting
  16151. this was easy---earlier changes to templates made it
  16152. possible using only a two-line modification to the parser
  16153. and a few minor modifications elsewhere. Hmmm, come to
  16154. think of it, the smoke was rather thick in that Internet "cafe".
  16155. *** NEW FEATURE ***
  16156. 04/19/2002: beazley (TGV)
  16157. Improved handling of non-type template parameters. For example:
  16158. vector<int,100>;
  16159. Simple numbers and strings can be used with the %template
  16160. directive as well. For example:
  16161. %template(vecint100) vector<int,100>;
  16162. Note: Arithmetic expressions are not currently allowed.
  16163. Default template arguments now work and do not have to
  16164. be given to %template.
  16165. 04/18/2002: beazley (Paris)
  16166. Change in internal template handling. Template
  16167. parameters are now fully integrated into the type
  16168. system and are aware of typedefs, etc. This builds
  16169. upon the change below.
  16170. *** DEVELOPER WARNING ***
  16171. Word of caution to language module writers. The "name"
  16172. parameter of certain parse tree nodes (classes, functions, etc.)
  16173. may be parameterized with types. This parameterization is
  16174. done using SWIG type-strings and not the underlying C version.
  16175. For example,
  16176. int max<int *>(int *,int *)
  16177. has a name of "max<(p.int)>". If you use the name directly,
  16178. you may get syntax errors in the generated code. To fix this,
  16179. use SwigType_namestr(name) to convert a parameterized name
  16180. to a C name with valid syntax. The internal version is
  16181. used to reduce template types to a common representation
  16182. and to handle issues of typedef.
  16183. 04/16/2002: beazley (somewhere over the Atlantic)
  16184. Enhancement of typedef resolution. The type system is now
  16185. aware of template arguments and typedef. For example:
  16186. typedef int Integer;
  16187. foo(vector<int> *x, vector<Integer> *y);
  16188. In this case, vector<int> and vector<Integer> are
  16189. the same type. There is some interaction between this
  16190. mechanism and the implementation of typemaps. For example,
  16191. a typemap defined for vector<int> * would apply to either type.
  16192. However, a typemap for vector<Integer> * would only apply to
  16193. that type.
  16194. Typedefs and typemaps and matched by left-most expansion.
  16195. For example:
  16196. vector<Integer,Integer> -->
  16197. vector<int, Integer> -->
  16198. vector<int, int>
  16199. 04/24/2002: cheetah (William Fulton)
  16200. [Java] Changes to Java shadow classes.
  16201. Overcomes a bug where the module assumed that a pointer to a derived
  16202. class could be used in place of a pointer to a base class. Thanks
  16203. to Stephen McCaul for analysing the bug and submitting patches.
  16204. A consequence is that the getCPtr() method in each shadow class has
  16205. disappeared and has been replaced with a getCPtrXXX(), where XXX is the
  16206. shadow class name. If you have code that previously used getCPtr(),
  16207. and the associated class is wrapping a C struct or a C++ class that
  16208. is not involved in an inheritance chain, just use the new method. If
  16209. however, the class is involved in an inheritance chain, you'll have
  16210. to choose which pointer you really want. Backwards compatibility
  16211. has been broken as not using the correct pointer can lead to weird bugs
  16212. through ill-defined behaviour. If you are sure you want the old methods,
  16213. you could add them back into all shadow classes by adding this at the
  16214. beginning of your interface file:
  16215. %pragma(java) allshadowcode=%{
  16216. public long getCPtr(){
  16217. return swigCPtr;
  16218. }
  16219. %}
  16220. Please see entry dated 07/23/2002 to see how to do this after the deprecation
  16221. of the allshadowcode pragma.
  16222. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  16223. 04/13/2002: beazley
  16224. Fixed problem with default arguments and references. Declarations such
  16225. as this should now work:
  16226. void foo(const string &x = "Hello");
  16227. 04/12/2002: beazley
  16228. Added typemap $* substitutions for typemaps involving arrays.
  16229. Requested by William Fulton.
  16230. 04/11/2002: beazley
  16231. Template specialization is now supported. For example:
  16232. template<> class vector<int> {
  16233. ...
  16234. };
  16235. When the %template directive is used, it will use a specialization
  16236. if one is defined. There are still some limitations. Partial
  16237. specialization is not supported. A template of type <void *> does
  16238. not match all pointers.
  16239. *** NEW FEATURE ***
  16240. 04/11/2002: beazley
  16241. Major change to template wrapping internals. Template declarations are
  16242. no longer processed as macros but now result in real parse-tree
  16243. nodes. The %template directive expands these nodes into a
  16244. specific instantiation. This change enables a number of
  16245. new and interesting capabilities:
  16246. Directives such as %rename, %feature, and %addmethods can
  16247. now be applied to uninstantiated templates. For example:
  16248. %rename(barsize) vector::bar(char *buf, int len);
  16249. ...
  16250. template<typename T> class vector {
  16251. public:
  16252. ...
  16253. void bar(char *buf);
  16254. void bar(char *buf, int len); // Renamed
  16255. ...
  16256. };
  16257. %template(intvector) vector<int>; // Renaming carries through
  16258. By parsing templates into an internal data structure, it will
  16259. be possible to support specialization (and maybe partial
  16260. specialization).
  16261. This is highly experimental and a work in progress.
  16262. *** POTENTIAL INCOMPATIBILITY ***
  16263. In SWIG-1.3.11, template declarations were simply processed
  16264. as weird macros. No other information was retained. This
  16265. made it impossible to support more advanced features and
  16266. complicated many other parts of the implementation.
  16267. 04/09/2002: beazley
  16268. Change to template class wrapping. There were a variety of
  16269. "issues" with the old approach related to parsing, the type
  16270. system, and namespaces. These changes are meant to rectify
  16271. some of these problems:
  16272. A specific instantiation of a template can now be specified
  16273. by including the class inline like this:
  16274. class vector<int> {
  16275. public:
  16276. vector();
  16277. ~vector();
  16278. ... whatever ...
  16279. };
  16280. This is template specialization, but partial specialization is
  16281. not yet implemented.
  16282. The %template directive has been modified to expand roughly as
  16283. follows:
  16284. %template(vecint) vector<int>;
  16285. becomes
  16286. %rename(vecint> vector<int>;
  16287. class vector<int> {
  16288. public:
  16289. vector();
  16290. ...
  16291. };
  16292. Note that this simply builds upon the code above (templates
  16293. included inline).
  16294. This modified approach to wrapping fixes some subtle type
  16295. issues. For instance, you can now define typemaps and typedefs
  16296. like this:
  16297. %typemap(in) vector<int> * {
  16298. ...
  16299. }
  16300. typedef vector<int> intvector;
  16301. ...
  16302. void blah(intvector *v); // Gets the above typemap
  16303. This did not work in SWIG-1.3.11 due to a peculiarity of
  16304. the template implementation.
  16305. %template(name) no longer installs the template as a class
  16306. with name "name". This might break %addmethods as described
  16307. in the manual. For example:
  16308. %template(vecint) vector<int>;
  16309. %addmethods vecint { // Fails. vecint not a class
  16310. ...
  16311. };
  16312. To fix this, just use the template name instead:
  16313. %addmethods vector<int> {
  16314. ...
  16315. }
  16316. Note: This technique might be a way to implement some bizarre
  16317. template specialization techniques. For example:
  16318. %addmethods vector<int> {
  16319. // Only applied if vector<int> instantiated later
  16320. %typemap(in) vector<int> * {
  16321. ...
  16322. }
  16323. ...
  16324. };
  16325. *** POTENTIAL INCOMPATIBILITY ***
  16326. 04/08/2002: beazley
  16327. Fixed [ 540868 ] #if defined whatever - not parsed. SWIG should
  16328. now correctly handle preprocessor directives like this:
  16329. #if defined __cplusplus
  16330. ...
  16331. #endif
  16332. Note: was implemented previously, but there was a minor bug.
  16333. Reported by Adam Hupp.
  16334. 04/07/2002: beazley
  16335. %readonly and %readwrite are deprecated due to a change in the
  16336. implementation. Instead of being pragmas, mutability is now
  16337. controlled as a "feature" using the following two directives:
  16338. %immutable;
  16339. int x; // read-only variable
  16340. int y; // read-only variable
  16341. %mutable;
  16342. int z; // Modifiable
  16343. %immutable and %mutable are much more powerful than their older
  16344. counterparts. They can now pinpoint a specific declaration like
  16345. this:
  16346. %immutable x; /* Any x */
  16347. %immutable Foo::x; /* x in class Foo */
  16348. In fact, the matching algorithm is the same as for %rename,
  16349. %ignore, and other directives. This means that the declaration
  16350. %immutable Foo::x;
  16351. would not only apply to class Foo but to all derived classes
  16352. as well.
  16353. *** POTENTIAL INCOMPATIBILITY ***
  16354. %immutable and %mutable must be terminated by a semi-colon. This
  16355. differs slightly from the older %readonly and %readwrite directives.
  16356. Since %immutable and %mutable can be applied to declarations the
  16357. semicolon is needed to distinguish between a global feature and
  16358. one targeted to a single declaration. Note: this incompatibility is the
  16359. primary reason for changing the name of the directive.
  16360. 04/07/2002: beazley
  16361. New handling of copy constructors. If a class defines
  16362. constructors like this:
  16363. class Foo {
  16364. public:
  16365. Foo();
  16366. Foo(const Foo &); // Copy constructor
  16367. ...
  16368. };
  16369. SWIG now generates a function copy_Foo() for the copy
  16370. constructor.
  16371. In previous verions, this generated a name-clash and an
  16372. error message. To preserve backwards compatibility, SWIG
  16373. does not change the behavior if %rename is used to resolve
  16374. the name conflict. However, if no name resolution is made,
  16375. this new approach is used.
  16376. Copy constructors may be handled as a special case in the
  16377. target language. However, this is up to the language module
  16378. itself.
  16379. 04/07/2002: beazley
  16380. The %template directive is now namespace aware. This allows
  16381. code like this:
  16382. namespace foo {
  16383. template<typename T> max(T a, T b) { return a > b ? a : b; }
  16384. }
  16385. using namespace foo;
  16386. %template(maxint) max<int>; // Ok
  16387. namespace bar {
  16388. using foo::max;
  16389. %template(maxdouble) max<double>; // Ok
  16390. }
  16391. Caveat: the template name supplied to %template must be defined in the
  16392. same scope in which the %template directive appears. This code is
  16393. illegal:
  16394. %template(maxint) foo::max<int>;
  16395. 04/07/2002: beazley
  16396. Minor enhancement to preprocessor. The preprocessor can now perform
  16397. string comparison. For example:
  16398. #define A "hello"
  16399. ...
  16400. #if A == "hello"
  16401. ...
  16402. #endif
  16403. The primary use of this is in SWIG macros. For example:
  16404. %define FOO(x)
  16405. #if #x == "int"
  16406. /* Special handling for int */
  16407. ...
  16408. #endif
  16409. %enddef
  16410. Normal users can probably safely ignore this feature. However, it may
  16411. be used in parts of the SWIG library.
  16412. 04/07/2002: beazley
  16413. Further refinement of default constructor/destructor wrapper generation.
  16414. SWIG is now much more aware of pure virtual methods. For instance:
  16415. class A { /* Abstract */
  16416. public:
  16417. virtual void method1() = 0;
  16418. virtual void method2() = 0;
  16419. };
  16420. class B : public A { /* Abstract */
  16421. public:
  16422. virtual void method1() { };
  16423. };
  16424. class C : public B { /* Ok */
  16425. public:
  16426. virtual void method2() { };
  16427. };
  16428. In this case, SWIG will only generate default constructors for C.
  16429. Even though B looks fine, it's missing a required method and is abstract.
  16430. 04/04/2002: beazley
  16431. Subtle change to structure data member access. If you
  16432. have a structure like this:
  16433. struct Foo {
  16434. Bar b;
  16435. };
  16436. The accessor functions for b are generated as follows:
  16437. (1) If b is *not* defined as a structure or class:
  16438. Bar Foo_b_get(Foo *self) {
  16439. return self->b;
  16440. }
  16441. void Foo_b_set(Foo *self, Bar value) {
  16442. self->b = value;
  16443. }
  16444. (2) If b *is* defined as a structure or class:
  16445. Bar *Foo_b_get(Foo *self) {
  16446. return &self->b;
  16447. }
  16448. void Foo_b_set(Foo *self, Bar *value) {
  16449. self->b = *value;
  16450. }
  16451. See the "Structure data members" section of Doc/Manual/SWIG.html
  16452. for further details.
  16453. *** POTENTIAL INCOMPATIBILITY ***
  16454. This may break interfaces that relied on a lot of a undeclared
  16455. structure and class names. To get the old behavior, simply
  16456. use a forward declaration such as "struct Bar;"
  16457. 04/04/2002: beazley
  16458. C++ namespace support added. SWIG supports all aspects of
  16459. namespaces including namespace, using, and namespace alias
  16460. declarations. The default behavior of SWIG is to flatten
  16461. namespaces in the target language. However, namespaces are
  16462. fully supported at the C++ level and in the type system.
  16463. See Doc/Manual/SWIGPlus.html for details on the implementation.
  16464. 04/02/2002: cheetah (William Fulton)
  16465. [Java] Sun has modified javac in jdk1.4 to no longer compile
  16466. an import of an unnamed namespace. To fix this SWIG no longer
  16467. generates the import for packageless classes.
  16468. http://developer.java.sun.com/developer/bugParade/bugs/4361575.html
  16469. As reported SF #538415.
  16470. 03/27/2002: ljohnson (Lyle Johnson)
  16471. [Ruby] Added support for pointer-to-member, similar to that
  16472. for the Python module. Remarkably similar. Also added a new
  16473. example for this (Examples/ruby/mpointer), which is remarkably
  16474. similar to the Python example of the same name.
  16475. 03/26/2002: ljohnson (Lyle Johnson)
  16476. [Ruby] Made a few minor edits to the "Advanced Topics"
  16477. chapter of the SWIG manual and added a new major section
  16478. about how to create multi-module Ruby packages with SWIG.
  16479. 03/26/2002: ljohnson (Lyle Johnson)
  16480. [Ruby] Removed all of the old Ruby pragmas. If any of this
  16481. functionality is truly missed we can resurrect it, preferably
  16482. with some kind of feature-based directive.
  16483. 03/25/2002: ljohnson (Lyle Johnson)
  16484. [Ruby] Fixed SWIG exception library support for Ruby, which
  16485. has apparently been broken for some time. Luckily, no one seems
  16486. to have noticed.
  16487. 03/23/2002: beazley
  16488. C++-namespace support in SWIG directives.
  16489. %addmethods:
  16490. The %addmethods directive now accepts a fully qualified classname
  16491. and can be used inside C++ namespace declarations. For example:
  16492. // Attaches to the class Foo::Bar below
  16493. %addmethods Foo::Bar {
  16494. int somemethod() { ... }
  16495. };
  16496. namespace Foo {
  16497. class Bar {
  16498. public:
  16499. ...
  16500. };
  16501. // Attaches to the class Bar above
  16502. %addmethods Bar {
  16503. int othermethod() { ... };
  16504. }
  16505. }
  16506. %feature, %rename, %ignore, %exception, and related directives:
  16507. Namespaces are fully integrated into the renaming and declaration
  16508. matcher. For example:
  16509. %rename(display) Foo::print; // Rename in namespace Foo
  16510. %ignore Foo::Bar::blah; // Ignore a declaration
  16511. %rename directives can be placed inside namespace blocks as well. For
  16512. example:
  16513. namespace Foo {
  16514. %rename(display) print; // Applies to print below
  16515. void print();
  16516. };
  16517. Most other SWIG directives should work properly inside namespaces.
  16518. No other changes are needed.
  16519. 03/22/2002: beazley
  16520. Some changes to internal symbol table handling. SWIG no longer
  16521. manages structures and unions in a separate namespace than normal
  16522. declarations like ANSI C. This means you can't have a structure
  16523. with the same name as a function. For example:
  16524. struct Foo {
  16525. ...
  16526. }
  16527. int Foo() { ... }
  16528. This approach is more like C++. It's not clear that SWIG ever
  16529. really supported the ANSI C anyways---using the same name would
  16530. almost certainly generate a name-clash in the target language.
  16531. 03/22/2002: ljohnson (Lyle Johnson)
  16532. [Ruby] Fixed [ 517302 ] for handling of renamed overloaded
  16533. constructors. Now, renamed overloaded constructors are converted
  16534. into class singleton methods (basically acting as "factory"
  16535. methods).
  16536. 03/21/2002: beazley
  16537. Fixed [ 532957 ] %ignore parse error and casting operator.
  16538. Reported by William Fulton.
  16539. 03/18/2002: beazley (** ADVANCED USERS ONLY **)
  16540. Added support for dynamic casting in return values. A somewhat
  16541. common problem in certain C++ programs is functions that hide
  16542. the identity of underlying objects when they are returned
  16543. from methods and functions. For example, a program might include
  16544. some generic method like this:
  16545. Node *getNode();
  16546. However, Node * may just be base class to a whole hierarchy
  16547. of different objects. Instead of returning this generic Node *,
  16548. it might be nice to automatically downcast the object into the
  16549. appropriate type using some kind dynamic cast.
  16550. Assuming you understand the peril involved, a downcast can now
  16551. be performed using the following function in the run-time type
  16552. checker:
  16553. swig_type_info *SWIG_TypeDynamicCast(swig_type_info *, void **ptr);
  16554. This function checks to see if the type can be converted to another
  16555. type. If so, a different type descriptor (for the converted type)
  16556. is returned. This type descriptor would then be used to create
  16557. a pointer in the target language.
  16558. To use this, you would write a typemap similar to this:
  16559. %typemap(out) Node * {
  16560. swig_type_info *ty = SWIG_TypeDynamicCast($1_descriptor, (void **) &$1);
  16561. $result = SWIG_NewPointerObj($1, ty);
  16562. }
  16563. Alternatively,
  16564. %typemap(out) Node * = SWIGTYPE *DYNAMIC;
  16565. To make the typemap have any effect, you have to write a supporting
  16566. function that knows how to perform downcasting. For example:
  16567. %{
  16568. static swig_type_info *
  16569. Node_dynamic_cast(void **ptr) {
  16570. Node **nptr = (Node **) ptr;
  16571. Element *e = dynamic_cast<Element *>(*nptr);
  16572. if (e) {
  16573. *ptr = (void *) e;
  16574. return SWIGTYPE_p_Element;
  16575. }
  16576. Data *d = dynamic_cast<Data *>(*nptr);
  16577. if (d) {
  16578. *ptr = (void *) d;
  16579. return SWIGTYPE_p_Data;
  16580. }
  16581. return 0;
  16582. }
  16583. %}
  16584. There is no restriction on how types are determined. dynamic_cast<>
  16585. uses C++ RTTI. However, if you had some other mechanism for determining
  16586. the type, you could use that here. Note: it is important to save
  16587. the new pointer value back into the argument as shown. When downcasting,
  16588. the value of the pointer could change.
  16589. Finally, to make the casting function available, you have to register
  16590. it with the run-time type checker. Put this macro in your interface file.
  16591. DYNAMIC_CAST(SWIGTYPE_p_Node, Node_dynamic_cast);
  16592. Note: this feature does not introduce a performance penalty on
  16593. normal SWIG operation. The feature is only enabled by writing
  16594. a new typemap that explicitly calls SWIG_TypeDynamicCast() to
  16595. make a conversion.
  16596. Examples/test-suite/dynamic_cast.i contains a simple example.
  16597. This feature is not supported in the Java module due to differences
  16598. in the type-checking implementation.
  16599. *** EXPERIMENTAL FEATURE ***
  16600. 03/17/2002: beazley
  16601. Small change to type-name handling of unnamed structures and
  16602. typedef. If a structure of this form appears:
  16603. typedef struct {
  16604. ...
  16605. } Foo;
  16606. Then 'Foo' is used as the proper typename for the structure.
  16607. Furthermore, Foo can now be used as a name in C++ inheritance.
  16608. SWIG was already kind of doing this, but this modification refines
  16609. the implementation to more closely follow the C++ ARM, section
  16610. 7.1.3, p. 106. This fixes a couple of obscure corner cases.
  16611. 03/16/2002: beazley
  16612. Modified C++ inheritance with a few enhancements. First, type information
  16613. needed for casting and type-equivalence is generated even when base-classes
  16614. aren't defined in the interface. For example:
  16615. class Foo : public Bar { /* Bar unspecified */
  16616. public:
  16617. ...
  16618. };
  16619. void blah(Bar *b);
  16620. In this case, the blah() function still accepts Foo * even though nothing
  16621. is really known about Bar. Previous SWIG versions would just generate
  16622. a type error.
  16623. Inheritance has also been modified to work through typedef. For example:
  16624. class Bar {
  16625. };
  16626. typedef Bar OtherBar;
  16627. class Foo: public OtherBar {
  16628. }
  16629. In this case, the base class of OtherBar is correctly resolved back to
  16630. Bar. The use of the name OtherBar is lost in this resolution (the wrappers
  16631. will simply use Bar instead of the typedef name OtherBar).
  16632. 03/13/2002: beazley
  16633. %typemap, %apply, and related directives can now appear inside
  16634. class definitions.
  16635. 03/13/2002: beazley
  16636. Fixed a variety of problems related to compiling SWIG on 64-bit
  16637. platforms.
  16638. 03/12/2002: beazley
  16639. Fixed problem with "ignore" and "in" typemaps. Local variables
  16640. associated with "in" were being added to the wrapper function even
  16641. though they were never used. Mostly harmless, but it would lead
  16642. to a variety of compilation warnings.
  16643. 03/12/2002: beazley
  16644. Some changes to the internal type system and handling of nested C++
  16645. types. In previous versions of SWIG, if you had the following:
  16646. class Foo {
  16647. public:
  16648. typedef int Blah;
  16649. };
  16650. class Bar : public Foo {
  16651. public:
  16652. void somemethod(Blah x);
  16653. };
  16654. The argument type in somemethod() would implicitly be set to Bar::Blah.
  16655. Although this is technically allowed, it breaks typemaps. For example:
  16656. %typemap(in) Foo::Blah { ... }
  16657. doesn't match like you expect. This has been changed in SWIG-1.3.12.
  16658. Now, types are expanded using the class in which they were defined.
  16659. So, the argument type in somemethod() will be Foo::Blah---since the
  16660. type Blah was defined in Foo.
  16661. 03/10/2002: beazley
  16662. Fixed some subtle type scoping problems with typedef and C++ classes.
  16663. For example:
  16664. typedef int Blah;
  16665. class Bar {
  16666. public:
  16667. typedef double Blah;
  16668. void foo(Blah x, ::Blah y);
  16669. ...
  16670. }
  16671. 03/10/2002: beazley
  16672. Highly experimental change to handle variable length arguments.
  16673. First, there is no portable or reliable way to wrap
  16674. a varargs function in full generality. However, you *can* change
  16675. the function signature using %varargs.
  16676. %varargs(char *) fprintf;
  16677. ...
  16678. void fprintf(FILE *f, char *fmt, ...);
  16679. In this case, the variable length parameter "..." is
  16680. simply replaced by the parameters given in %varargs. This
  16681. results in a function like this:
  16682. void fprintf(FILE *f, char *fmt, char *s);
  16683. More than one argument can be used and default values
  16684. can be defined. For example, this code specifies a
  16685. maximum of four arguments.
  16686. %varargs(char *x1 = 0, char *x2 = 0, char *x3 = 0, char *x4 = 0) fprintf;
  16687. *** EXPERIMENTAL NEW FEATURE ***
  16688. 03/10/2002: beazley
  16689. Change to handling of variable length arguments. varargs
  16690. is now handled as a proper parameter and is passed to the
  16691. code generator. However, it still can't be handled correctly
  16692. (and will generate a typemap warning). This change has been
  16693. made to better incorporate variable length arguments with other
  16694. directives such as %ignore, %rename, %feature, and so forth.
  16695. 03/10/2002: beazley
  16696. Fixed [ 522555 ] Syntax error parsing "define" construct. SWIG
  16697. is a little more restrictive in determining #define statements
  16698. that will be wrapped as constants. Also added a better parser
  16699. error rule for handling bad constants.
  16700. 03/08/2002: cheetah (William Fulton)
  16701. [Java] Bug fix: Classes renamed with %rename that are derived from
  16702. another class generate more appropriate shadow class code.
  16703. 03/08/2002: cheetah (William Fulton)
  16704. [Java] Fixed SF [ #523632 ] and [ #513335 ] both reported by Israel
  16705. Tanner. Support for types that are used which are in a typedef. The
  16706. appropriate shadow class name is generated. Also generated correct
  16707. shadow classname when a templated class is used within another
  16708. templated class. See the cpp_typedef.i testcase.
  16709. 03/08/2002: cheetah (William Fulton)
  16710. [Java] Bug fix: No type was generated in shadow classes for types
  16711. that weren't wrapped by SWIG. The type is treated as a raw
  16712. pointer, ie no shadow class.
  16713. 02/22/2002: beazley
  16714. Refined the matching algorithm used by %rename, %ignore, and
  16715. %feature. If a type signature is supplied, it must exactly
  16716. match that used in the declaration---including any use of
  16717. const. For example:
  16718. %rename(foo1) foo(int);
  16719. %rename(bar1) bar(int) const;
  16720. class Blah {
  16721. public:
  16722. void foo(int); // Matched --> foo1
  16723. void foo(int) const; // Not matched
  16724. void bar(int); // Not matched
  16725. void bar(int) const; // Matched --> bar1
  16726. }
  16727. In previous versions, a non-const specification would match
  16728. both the non-const and const declarations. However, the whole
  16729. point of %rename and related directives is that they be able
  16730. to precisely pinpoint exact declarations in an interface. This
  16731. fixes the problem.
  16732. 02/21/2002: beazley
  16733. Reworked the handling of default constructor and destructors.
  16734. SWIG now makes a preliminary pass over the parse tree to discover
  16735. which classes support default allocation. This fixes a number
  16736. of very subtle issues in code generation and call/return by value.
  16737. 02/18/2002: cheetah (William Fulton)
  16738. Improved support on Cygwin: Perl, Python, Tcl, Ruby and Java should
  16739. work out of the box, barring the runtime library. Removed dllwrap
  16740. and replaced with newly working gcc -shared instead for Cygwin.
  16741. All this will require the new improved binutils 20010802 and later,
  16742. but the latest Cygwin is usually the best recommendation.
  16743. 02/15/2002: beazley
  16744. Fixed some problems related to wrapping of global variables
  16745. and Perl shadow classes. Reported by Chia-liang Kao.
  16746. 02/15/2002: ljohnson (Lyle Johnson)
  16747. [Ruby] Made a fix to the code generation for C++ class
  16748. constructors so that we get both a "new" singleton method
  16749. and an "initialize" instance method for each class. This
  16750. change enables developers to derive new Ruby classes from
  16751. SWIG-wrapped C++ classes and then override their initialize
  16752. methods to provide subclass-specific instance initialization.
  16753. 02/15/2002: ljohnson (Lyle Johnson)
  16754. [Ruby] Massive documentation update for the Ruby module,
  16755. contributed by Craig Files.
  16756. 02/14/2002: ljohnson (Lyle Johnson)
  16757. [Ruby] Bug fix: An error in the SWIG runtime support for Ruby
  16758. was causing several of the examples to fail. Reported by
  16759. William Fulton.
  16760. 02/14/2002: ljohnson (Lyle Johnson)
  16761. [Ruby] Bug fix: Enumerations defined within a class (such
  16762. as those seen in the Examples/ruby/enum example) were not
  16763. being exported with the correct names. Reported by William
  16764. Fulton.
  16765. 02/13/2002: ljohnson (Lyle Johnson)
  16766. [Ruby] Added a warning message when we run across overloaded
  16767. class constructors for C++ code, that this is currently not
  16768. supported (even if the overloads have been %renamed). For an
  16769. example of where this doesn't work, see Examples/ruby/operator.
  16770. 02/13/2002: ljohnson (Lyle Johnson)
  16771. [Ruby] Added an "ignored" warning message when the parser runs
  16772. across an operator!=() declaration for C++ code.
  16773. 02/11/2002: ljohnson (Lyle Johnson)
  16774. [Ruby] Added the "import", "import_template", "operator" and
  16775. "template" examples.
  16776. 02/11/2002: ljohnson (Lyle Johnson)
  16777. [Ruby] Added multi-module support.
  16778. 02/09/2002: ljohnson (Lyle Johnson)
  16779. [Ruby] Added the missing "#define SWIG_NOINCLUDE" at the top of
  16780. the wrapper code when the '-c' option is used.
  16781. 02/09/2002: ljohnson (Lyle Johnson)
  16782. Corrected a minor off-by-one error for the size of the
  16783. swig_types[] array that's generated in the wrapper code.
  16784. 02/08/2002: beazley
  16785. Fixed SF [ #515058 ] Wrong code for C++ templates.
  16786. Reported by Israel Taller.
  16787. Version 1.3.11 (January 31, 2002)
  16788. =================================
  16789. 01/30/2002: beazley
  16790. Fix to pass/return by value for C++ objects that define
  16791. no default constructor. Changes to the typemap system
  16792. made it impossible to wrap C++ objects with no default
  16793. constructor. This has been fixed, but the solution
  16794. involves some clever template magic contributed by
  16795. William Fulton. Please see the comments in the file
  16796. Lib/swig.swg for further details. This solution is
  16797. experimental and may be refined in a future release.
  16798. 01/30/2002: beazley
  16799. Global variables and member data of type "const char *"
  16800. can be set, but the old value is silently discarded without
  16801. any garbage collection. This may generate a memory leak.
  16802. This change is needed to more safely handle variables
  16803. like this:
  16804. const char *foo = "Hello World\n";
  16805. In this case, it's not safe to free the old value. However,
  16806. SWIG can dynamically allocate a new value and make foo point
  16807. to it. To fix this memory leak, you can probably do this:
  16808. %clear const char *foo;
  16809. %apply char * {const char *foo};
  16810. *** POTENTIAL INCOMPATIBILITY ***
  16811. 01/30/2002: beazley
  16812. Two minor typemap enhancements have been added. First,
  16813. typemaps can issue a warning message by including a special
  16814. warning attribute. For example:
  16815. %typemap(in,warning="I'm going to do something dangerous") ...
  16816. The warning message will show up whenever the typemap is
  16817. applied.
  16818. Second, a typemap can force a no-match by defining
  16819. %typemap(in) sometype "pass"
  16820. If this is used, the typemap system will *not* record a
  16821. typemap match for "sometype". This can be used to block
  16822. selected typemaps. For example, if you wanted to disable
  16823. a typemap feature for some type, you could do this.
  16824. // Do not allow global variables of type 'const char *' to be set.
  16825. %typemap(varin) const char * "pass"
  16826. It might also be possible to use this to do subtle and
  16827. strange things with typemaps. For example, if you wanted to
  16828. make 'blah *' an output value and 'const blah *' an input
  16829. parameter, you might do this:
  16830. %typemap(ignore) blah *(blah temp) {
  16831. $1 = &temp;
  16832. }
  16833. %typemap(argout) blah * {
  16834. ... return a value ...
  16835. }
  16836. /* Block unqualified typemaps defined above */
  16837. %typemap(ignore) const blah * "pass"
  16838. %typemap(argout) const blah * "pass"
  16839. %typemap(in) const blah * {
  16840. ... get input value ...
  16841. }
  16842. (This potential applications of typemaps suggested by Greg Stein).
  16843. *** NEW FEATURE ***
  16844. 01/29/2002: cheetah (william fulton)
  16845. [Java] Bug fix: No enumerations were wrapped when the -shadow
  16846. commandline option was not specified. Reported by Israel Taller.
  16847. 01/28/2002: cheetah (william fulton)
  16848. [Java] Global arrays are successfully wrapped. In fact they started
  16849. mostly working in SWIG-1.3.10.
  16850. 01/28/2002:richardp
  16851. Added first attempt at C++ and -shadow support for PHP4 module,
  16852. please test and mail me if any problems/ideas on improving it.
  16853. There is a known problem with uninitialized member variables,
  16854. please see Examples/php4/sync/README for details.
  16855. Also more PHP documentation added to Doc/Manual/Php.html
  16856. 01/27/2002:beazley
  16857. The ANSI C size_t type is now recognized as an integer by default.
  16858. 01/26/2002:beazley
  16859. long long and unsigned long long support added to many language modules.
  16860. This is not a portable feature and will require compiler support
  16861. for the long long type. In target languages that do not support
  16862. long long (e.g., Tcl and Perl), numbers are converted to a string
  16863. of digits. This prevents their use in arithmetic calculations, but
  16864. still allows values to be set from a string.
  16865. long long support requires the use of the strtoll() and strtoull()
  16866. functions as well as the 'lld' and 'llu' format specifiers
  16867. of sprintf().
  16868. 01/26/2002:beazley
  16869. Fixed [ #501827 ] Delete method is not called. The Tcl
  16870. module wasn't correctly calling destructors when they
  16871. were defined using %addmethods. This has been fixed.
  16872. Reported by Reinhard Fobbe.
  16873. 01/26/2002: beazley
  16874. Better support for long long and unsigned long long. Typemaps
  16875. have been included in a number of modules for handling these types.
  16876. In addition, the parser has been modified to accept long long
  16877. literals such as 1234LL and 1234ULL.
  16878. 01/27/2002: cheetah (william fulton)
  16879. [Java] A C char[] is mapped to a Java String which is the default
  16880. SWIG handling of char[] and char*. It used to be mapped to byte[].
  16881. Note that a C signed char[] array is mapped to byte[].
  16882. *** POTENTIAL INCOMPATIBILITY ***
  16883. 01/25/2002: beazley
  16884. Fixed a problem with return-by-value, C++, and
  16885. objects that define no default constructor.
  16886. Reported by Joel Reed.
  16887. 01/25/2002: cheetah (william fulton)
  16888. [Java] Overhaul of the Java module. The C code generation is now
  16889. done from typemaps.
  16890. 01/24/2002: cheetah (william fulton)
  16891. [Java] Support for arrays of enum pointers
  16892. 01/20/2002: cheetah (william fulton)
  16893. [Java] Error checking for null Java objects being passed to native
  16894. functions. Exception thrown now whereas before the JVM crashed.
  16895. 01/18/2002: cheetah (william fulton)
  16896. [Java] Corrected behaviour for functions that take arrays. For
  16897. example, when this c function:
  16898. void arrayfn(int array[]);
  16899. is wrapped the corresponding native function
  16900. public final static native void arrayfn(int[] array);
  16901. is produced. Previously if the C function made any changes to the
  16902. array elements, these were not reflected back into the Java array.
  16903. This has now been corrected so that the changes are propogated back
  16904. to Java and the calling function will see these changes. This is
  16905. how pure Java functions work, ie arrays are passed by reference.
  16906. 01/15/2002:mkoeppe
  16907. [Guile] New file cplusplus.i with C++ typemaps contributed
  16908. by Marcio Luis Teixeira <marciot@holly.colostate.edu>.
  16909. 01/11/2002: cheetah (william fulton)
  16910. [Java] Changed mapping of C long to Java type. Was mapped to Java
  16911. long, now mapped to Java int. If you want the previous mapping to
  16912. Java long use this approach in your interface file:
  16913. %clear long;
  16914. %typemap(jni) long "jlong"
  16915. %typemap(jtype) long "long"
  16916. %typemap(jstype) long "long"
  16917. %clear long[ANY];
  16918. %typemap(jni) long[ANY] "jlongArray"
  16919. %typemap(jtype) long[ANY] "long[]"
  16920. %typemap(jstype) long[ANY] "long[]"
  16921. %typemap(in) long[ANY] {write me for array support}
  16922. %typemap(out) long[ANY] {write me for array support}
  16923. %typemap(argout) long[ANY] {write me for array support}
  16924. %typemap(freearg) long[ANY] {write me for array support}
  16925. *** POTENTIAL INCOMPATIBILITY ***
  16926. This new mapping is more appropriate when interfacing to 32 bit
  16927. applications which are used in the current 32-bit JVMs. For future
  16928. 64-bit JVMs you may have to change these mappings - eg on Unix LP64
  16929. systems, but not on Microsoft 64bit Windows which will be using a
  16930. P64 IL32 model. This may be automated in a future version of SWIG.
  16931. 01/10/2002:beazley
  16932. Fixed [ 501677 ] %init block in wrong place. Reported
  16933. by Luigi Ballabio.
  16934. 01/09/2002: cheetah (william fulton)
  16935. [Java] Default support for the long long type. signed long long is
  16936. mapped to a Java long. unsigned long long is mapped to BigInteger.
  16937. 01/09/2002:beazley
  16938. Experimental change to parser to better support mixing of
  16939. int, long, short, unsigned, float, and double. The parser
  16940. should now support types like this:
  16941. short unsigned int
  16942. int unsigned short
  16943. unsigned short int
  16944. unsigned int short
  16945. This change also enables a type of 'long double' (previously
  16946. unsupported) to be used.
  16947. *** NEW FEATURE ***
  16948. 01/05/2002: cheetah (william fulton)
  16949. [Java] Casting fix for when function return type is a pointer as
  16950. reported by Gary Pennington 2002-01-05. The upper 32bits of the
  16951. 64 bit jlong will have contained junk for 32bit pointers.
  16952. 01/05/2002: cheetah (william fulton)
  16953. [Java] Better pointer handling in Java is possible as the
  16954. INPUT, OUTPUT and INOUT typemaps have been added into typemaps.i.
  16955. 01/05/2002: cheetah (william fulton)
  16956. [Java] $null can be used in input typemaps to return early from JNI
  16957. functions that have either void or a non-void return type. Example:
  16958. %typemap(check) int * %{
  16959. if (error) {
  16960. SWIG_exception(SWIG_IndexError, "Array element error");
  16961. return $null;
  16962. }
  16963. %}
  16964. If the typemap gets put into a function with void as return, $null
  16965. will expand to nothing:
  16966. void jni_fn(...) {
  16967. if (error) {
  16968. SWIG_exception(SWIG_IndexError, "Array element error");
  16969. return ;
  16970. }
  16971. ...
  16972. }
  16973. otherwise $null expands to zero, where javareturntype is either a
  16974. pointer or a primitive type:
  16975. javareturntype jni_fn(...) {
  16976. if (error) {
  16977. SWIG_exception(SWIG_IndexError, "Array element error");
  16978. return 0;
  16979. }
  16980. ...
  16981. }
  16982. 01/02/2002: cheetah (william fulton)
  16983. [Java] The Java module incorrectly used argout typemaps for
  16984. strings. This is now corrected and the code now resides
  16985. in the freearg typemap. The argout array typemaps have been split into
  16986. argout and freearg typemaps. This correction may require some user
  16987. written typemaps to be modified.
  16988. *** POTENTIAL INCOMPATIBILITY ***
  16989. 12/28/2001: cheetah (william fulton)
  16990. [Java] Multi typemaps now working for Java see multimap example.
  16991. [Java] Fix for recently introduced bug - freearg typemap code was appearing
  16992. before the function call.
  16993. 12/28/2001: cheetah (william fulton)
  16994. [Java] JCALL macro for JNI calls that work in both C and C++ typemaps
  16995. have been replaced with JCALL0, JCALL1, JCALL2, JCALL3 and JCALL4
  16996. macros.
  16997. *** POTENTIAL INCOMPATIBILITY ***
  16998. 12/22/2001:beazley
  16999. Resolved some inconsistent behavior with %rename and class renaming.
  17000. If you specify the following:
  17001. %rename(Foo) Bar;
  17002. class Bar {
  17003. public:
  17004. Bar();
  17005. ~Bar();
  17006. }
  17007. Then the %rename directive applies to the class itself, the constructor,
  17008. and the destructor (all will be renamed to Foo).
  17009. If a class defines more than one constructor, the overloaded variants
  17010. can still be renamed by specifying parameters to %rename. For example:
  17011. %rename(Bar_copy) Bar(Bar &);
  17012. class Bar {
  17013. public:
  17014. Bar();
  17015. Bar(Bar &);
  17016. ~Bar();
  17017. };
  17018. There are still some odd corner cases. If you specify
  17019. %rename(Foo) ::Bar;
  17020. then only the name of the class is changed and the constructor/destructor
  17021. names are left unmodified. If you specify
  17022. %rename(Foo) *::Bar;
  17023. then the names of the constructor/destructor functions are modified but
  17024. the name of the class is not.
  17025. 12/21/2001: cheetah (william fulton)
  17026. [Java] jni, jtype and jstype typemaps no longer hardcoded but real
  17027. typemaps. New variable substitution, $javaclassname, can be used in
  17028. the jstype typemaps. It is replaced with the Java shadow class name
  17029. where applicable.
  17030. [Java] Fix for recently introduced bug to do with inheritance when
  17031. using %import.
  17032. [Java] A few more bug fixes, todo with %rename and using the kind
  17033. with the type, eg
  17034. void fn(union uni myuni, struct str mystr, class cl mycl);
  17035. 12/20/2001:beazley
  17036. Fixed [ #494524 ] Preprocessor bug - apostrophe and #subst.
  17037. 12/20/2001:beazley
  17038. Added SWIG_VERSION preprocessor symbol. This is a hexadecimal
  17039. integer such as 0x010311 (corresponding to SWIG-1.3.11). This can
  17040. be used in the interface as follows:
  17041. #if SWIG_VERSION >= 0x010311
  17042. /* Use some fancy new feature */
  17043. #endif
  17044. Note: The version symbol is not defined in the generated SWIG
  17045. wrapper file.
  17046. *** NEW FEATURE ***
  17047. 12/20/2001:mkoeppe
  17048. [MzScheme]: Renamed mzswig_make_boolean to
  17049. swig_make_boolean, as the latter is used in the typemaps.
  17050. Reported by Luigi Ballabio.
  17051. 12/17/2001:mkoeppe
  17052. [Guile]: Rewrote list-vector.i using multi-dispatch
  17053. typemaps. Updated pointer-in-out.i. Make the
  17054. deprecated typemap-substitution of "$source" in "argout"
  17055. work as before.
  17056. 12/16/2001:mkoeppe
  17057. [Guile]: Fixed macros %values_as_list, %values_as_vector,
  17058. %multiple_values to use the proper %pragma syntax. New
  17059. Guile example/test "multivalue"; new Guile run-test for
  17060. test-suite item "list-vector" (currently broken).
  17061. 12/14/2001:mkoeppe
  17062. [Guile]: Fixed typemap-substition bug for "varin". Relaxed
  17063. valid-identifier check to allow all R5RS identifiers.
  17064. Version 1.3.10 (December 10, 2001)
  17065. ==================================
  17066. 12/08/2001:beazley
  17067. Modified %typemap so that %{ ... %} can also be used as a
  17068. code block (mostly for completeness). For example:
  17069. %typemap(in) blah %{
  17070. ...
  17071. %}
  17072. This form does not introduce a new block scope. Also, the
  17073. code enclosed in %{ ... %} is not processed by the preprocessor.
  17074. 12/08/2001:beazley
  17075. Fixed [ #459614 ] SWIG with multiple TCL interpreters.
  17076. 12/08/2001:beazley
  17077. Fixed [ #417141 ] rubydec.swg is wrong
  17078. Reported by Paul Brannan.
  17079. 12/08/2001:beazley
  17080. Fixed [ #410557 ] Problem with %addmethods on NT.
  17081. Reported by Magnus Ljung.
  17082. 12/08/2001:beazley
  17083. Fixed [ #445233 ] Enhancement: handle access change.
  17084. SWIG now parses (but ignores) C++ access changes for the
  17085. the following:
  17086. class A {
  17087. protected:
  17088. void something() { }
  17089. public:
  17090. A() {}
  17091. };
  17092. class B : private A {
  17093. public:
  17094. B() : A() { }
  17095. protected:
  17096. A::something; <---- Parsed, but ignored
  17097. };
  17098. Suggested by Krzysztof Kozminski.
  17099. 12/08/2001: cheetah (william fulton)
  17100. Fix for Ruby to work using Visual C++.
  17101. 12/06/2001:beazley
  17102. Fixed [ #465687 ] unsigned short parameters fail.
  17103. Reported by Gerald Williams.
  17104. 12/06/2001:beazley
  17105. Fixed SF [ #489594 ] PyString_FromString can't take NULL arg.
  17106. Reported by John Merritt. SWIG now converts string values
  17107. to Python using code like this:
  17108. resultobj = result ? PyString_FromString(result) : Py_BuildValue("");
  17109. 12/06/2001:beazley
  17110. Fixed SF [ #463561 ] Type conversions not generated.
  17111. Reported by Gerald Williams.
  17112. 12/04/2001:beazley
  17113. Fixed SF [ #470217 ] Tcl default argument handling.
  17114. Reported by Shaun Lowry.
  17115. 12/04/2001:beazley
  17116. Fixed SF [ #472088 ] defined(MACRO) expanded everywhere.
  17117. Embedded preprocessor directives such as
  17118. %#if defined(FOO)
  17119. are not expanded by the SWIG preprocessor.
  17120. Reported by Gerald Williams.
  17121. 12/04/2001:beazley
  17122. Fixed SF [ #476467 ] Problems with #define & commas.
  17123. 12/04/2001:beazley
  17124. Fixed SF [ #477547 ] wrong declaration of pointer functions.
  17125. Bad prototypes in Lib/tcl/ptrlang.i.
  17126. 12/04/2001:beazley
  17127. Fixed SF [ #483182 ] Constants can take args by mistake.
  17128. When swig -perl5 -const is used, constants are declared
  17129. with a void prototype. For example:
  17130. sub ICONST () { $examplec::ICONST }
  17131. Patch submitted by Rich Wales.
  17132. 12/03/2001:beazley
  17133. New %exception directive. This is intended to replace %except.
  17134. It works in exactly the same manner except it does not accept a
  17135. language specifier. For example:
  17136. %exception {
  17137. try {
  17138. $action
  17139. }
  17140. catch(SomeError) {
  17141. error
  17142. }
  17143. }
  17144. %exception is also name aware---allowing it to be applied to
  17145. specific declarations in an interface. For example:
  17146. %exception foo {
  17147. ...
  17148. exception for any function/method foo
  17149. ...
  17150. }
  17151. %exception Foo::bar {
  17152. ...
  17153. exception for method bar in class Foo
  17154. ...
  17155. }
  17156. %exception Foo::bar(double) {
  17157. ...
  17158. exception for method bar(double) in class Foo
  17159. ...
  17160. }
  17161. The semantics of this name matching is exactly the same as for %rename.
  17162. *** NEW FEATURE ***
  17163. 12/03/2001:beazley
  17164. Substantial cleanup of the Python shadow class code. Shadow classes
  17165. used to be created in this rather complicated manner involving about
  17166. a half-dozen strings created in bits and pieces. Shadow classes
  17167. are now generated in a more straightforward manner--in the same
  17168. order that appears in the interface file.
  17169. *** POTENTIAL INCOMPATIBILITY ***
  17170. The order in which declarations appear in the shadow file may differ.
  17171. 12/03/2001:beazley
  17172. The %insert directive (%{ ... %}, %runtime, %header, %wrapper, etc.)
  17173. can now be used inside of a class definition. This has potential
  17174. uses when generating shadow class code. For example:
  17175. class Foo {
  17176. ...
  17177. %insert("shadow") %{
  17178. # Some python code
  17179. def blah(self):
  17180. print "I'm blah!"
  17181. %}
  17182. ...
  17183. };
  17184. The support for class code insertion depends on the language module.
  17185. However, the intent of this feature is to simplify the task of extending
  17186. shadow class code. In the Python module, this inserts code with the
  17187. proper level of indendation (regardless of what was used in the SWIG
  17188. interface).
  17189. *** NEW FEATURE ***
  17190. 11/29/2001: cheetah (william fulton)
  17191. Modifications for Java and Python modules to work on cygwin.
  17192. Unfortunately a lot of the python module has started to produces code
  17193. which cannot be auto-imported using cygwin libtools so most of it is
  17194. still broken.
  17195. 11/28/2001:beazley
  17196. The %rename and %feature directive can now be used inside
  17197. of a class definition. For example:
  17198. class Foo {
  17199. %rename(foo_i) foo(int);
  17200. %rename(foo_d) foo(double);
  17201. public:
  17202. ...
  17203. void foo(int);
  17204. void foo(double);
  17205. ...
  17206. };
  17207. When used in this manner, the %rename directive only applies
  17208. to members of the class in which it appears as well as all
  17209. derived classes. In fact, this is really just the same
  17210. as saying:
  17211. %rename(foo_i) Foo::foo(int);
  17212. %rename(foo_d) Foo::foo(double);
  17213. class Foo {
  17214. ...
  17215. };
  17216. *** NEW FEATURE ***
  17217. 11/26/2001:beazley
  17218. Added the experimental %feature directive. %feature can be
  17219. used to attach arbitrary string attributes to parse tree nodes.
  17220. For example:
  17221. %feature("except") blah {
  17222. try {
  17223. $function
  17224. } catch (Error) {
  17225. whatever;
  17226. }
  17227. }
  17228. or
  17229. %feature("set") *::x_set "x";
  17230. or
  17231. %feature("blah") Foo::bar(int,double) const "spam";
  17232. The syntax is borrowed from the %rename directive. In fact, the
  17233. exact same semantics apply (inheritance, matching, etc.).
  17234. %feature is a very powerful low-level primitive that can be used to
  17235. customize individual language modules and to provide hints to
  17236. any stage of code generation. Features are attached to
  17237. parse tree nodes as attributes with names like "feature:*" where *
  17238. is replaced by the feature name (e.g., "feature:except", "feature:set",
  17239. etc.). Language modules can then look for the features using
  17240. a simple attribute lookup.
  17241. %feature is intended to be a replacement for a number of
  17242. older SWIG directives including %except and specialized
  17243. pragmas. It is more powerful (due to its parameterized
  17244. name matching) and it provides very precise control over
  17245. how customization features are attached to individual
  17246. declarations. There are future expansion plans that will
  17247. build upon this capability as well.
  17248. It's not certain that %feature will ever be used directly
  17249. by SWIG users. Instead, it may be a low-level primitive
  17250. that is used in high-level macro definitions. For instance,
  17251. to support properties, you might define a macro like this:
  17252. %define %property(name, setf, getf)
  17253. %feature("set") setf #name;
  17254. %feature("get") getf #name;
  17255. %enddef
  17256. Which allows a user to specify things like this:
  17257. %property(p, get_p, set_p);
  17258. class Blah {
  17259. public:
  17260. int get_p();
  17261. void set_p(int);
  17262. };
  17263. *** EXPERIMENTAL NEW FEATURE ***
  17264. 11/24/2001:beazley
  17265. The Tcl module has been expanded with some new features for
  17266. managing object ownership. For example:
  17267. set c [Circle -args 20]
  17268. $c area # Invoke a method
  17269. $c -disown # Releases ownership of the object
  17270. $c -acquire # Acquires ownership of the object
  17271. If Tcl owns the object, its destructor is invoked when the
  17272. corresponding object command is deleted in Tcl.
  17273. To simplify the destruction of objects, the following syntax
  17274. can be used:
  17275. $c -delete # Delete an object
  17276. This is an alternative for the more obscure variant of
  17277. rename $c {}
  17278. These features also add functionality at the C API level.
  17279. The following functions manage ownership from C and
  17280. can be used in typemaps.
  17281. SWIG_Acquire(void *ptr);
  17282. SWIG_Disown(void *ptr);
  17283. A new function for constructing instances is also available:
  17284. Tcl_Obj *
  17285. SWIG_NewInstanceObj(Tcl_Interp *interp, void *ptr,
  17286. swig_type_info *type, int own);
  17287. When used in a typemap, this creates a pointer object and
  17288. an interpreter command that can be used to issue methods and
  17289. access attributes as shown above.
  17290. *** NEW FEATURE ***
  17291. 11/23/2001:beazley
  17292. All Python-related %pragma operations have been eliminated.
  17293. Most of these were written for older SWIG versions in order to
  17294. compensate for limitations in earlier releases. In an effort
  17295. to reduce the amount of code-clutter and potential for errors,
  17296. it is easier to simply eliminate the pragmas and to start over
  17297. (if needed). To be honest, I'm not even sure the pragmas
  17298. worked in 1.3.9 and recent releases.
  17299. Note: If you need to insert code into the shadow class file
  17300. created by SWIG, simply use the %shadow directive like this:
  17301. %shadow %{
  17302. def some_python_code():
  17303. print "blah!"
  17304. %}
  17305. *** POTENTIAL INCOMPATIBILITY ***
  17306. 11/22/2001:beazley
  17307. Sweeping changes to the way in which the Python module handles
  17308. shadow classes. In early implementations, shadow classes were
  17309. merely Python wrappers around typed pointer objects. However,
  17310. some users actually wanted to receive the shadow class object in C.
  17311. To accommodate this, the dereferencing of the "this" pointer in
  17312. a shadow class was moved to C as described in CHANGES [8/8/99].
  17313. However, the process of returning pointers to Python was still
  17314. somewhat problematic. Specifically, shadow classes never worked
  17315. in situations such as these:
  17316. - Use of any kind of output typemap ('out' or 'argout')
  17317. - Global variables (broken as far as I can tell).
  17318. In the past, some users have dealt with this by manually trying
  17319. to create shadow class objects themselves from C/C++. However,
  17320. this was difficult because the C wrappers don't really know how
  17321. to get access to the corresponding Python class.
  17322. The Python module has now been modified to automatically attach
  17323. shadow class objects to pointers when they are returned to
  17324. Python. This process occurs in the function SWIG_NewPointerObj()
  17325. so the process is completely transparent to users. As a result,
  17326. shadow classes are now more seamlessly integrated with typemaps
  17327. and other features of SWIG.
  17328. This change may introduce a number of incompatibilities. The
  17329. SWIG_NewPointerObj() now takes an extra parameter "own" to
  17330. indicate object ownership. This can be used to return a pointer
  17331. to Python that Python should destroy. In addition, older code
  17332. that tries to manually construct shadow class objects or which
  17333. expects bare pointers may break---such pointers may already be
  17334. encapsulated by a shadow class.
  17335. *** POTENTIAL INCOMPATIBILITY ***
  17336. 11/20/2001:beazley
  17337. Modified the %insert directive to accept single braces { ... }.
  17338. For example:
  17339. %insert("header") {
  17340. ... some code ...
  17341. }
  17342. This works exactly like %{ ... %} except that the code in the
  17343. braces is processed using the preprocessor. This can be useful
  17344. in certain contexts such as low-level code generation in
  17345. language modules.
  17346. *** NEW FEATURE ***
  17347. 11/20/2001:beazley
  17348. Command line options are now translated into preprocessor
  17349. symbols. For example:
  17350. ./swig -python -shadow -module blah interface.i
  17351. Creates the symbols:
  17352. SWIGOPT_PYTHON 1
  17353. SWIGOPT_SHADOW 1
  17354. SWIGOPT_MODULE blah
  17355. Modules can look for these symbols to alter their code generation
  17356. if needed.
  17357. *** NEW FEATURE ***
  17358. 11/20/2001:beazley
  17359. Massive overhaul of the Perl5 module. A lot of code generation is
  17360. now driven by tables and typemaps. The generated wrapper code
  17361. also makes use of tables to install constants, variables, and
  17362. functions instead of inlining a bunch of procedure calls. The
  17363. separate variable initialization function is gone. Most
  17364. code generation is controlled via the perl5.swg file in the
  17365. library.
  17366. *** POTENTIAL INCOMPATIBILITY ***
  17367. 11/13/2001:beazley
  17368. Added parsing support for the C++ typename keyword. Primarily this
  17369. is added to better support templates. For example:
  17370. template<typename T> void blah(C& v) {
  17371. typename C::iterator i = v.begin();
  17372. }
  17373. Note: typename is supported in the parser in the same way as 'struct'
  17374. or 'class'. You probably shouldn't use it anywhere except in templates.
  17375. *** NEW FEATURE ***
  17376. 11/11/2001:beazley
  17377. Massive overhaul of the language module API. Most functions now
  17378. use a common, very simple, API. There are also a number of
  17379. interesting semantic side-effects of how code is actually generated.
  17380. Details will be forthcoming in Doc/Manual/Extending.html.
  17381. *** POTENTIAL INCOMPATIBILITY *** Language modules written for
  17382. previous versions of SWIG will no longer work,
  17383. 11/10/2001:beazley
  17384. Fixed a very subtle bug due to unnamed class wrapping. For example, if
  17385. you did this
  17386. typedef struct {
  17387. int x,y;
  17388. } gdPoint, *gdPointPtr;
  17389. void foo(gdPointPtr x);
  17390. Then the foo function would get a type-error. The problem has
  17391. to do with internal typedef handling and the fact that the typedef
  17392. declarations after the struct appear later in the parse tree.
  17393. It should work now. Problem reported by Vin Jovanovic.
  17394. 11/09/2001:beazley
  17395. Subtle change to "out" typemaps (and related variations). The name
  17396. that is attached to the typemap is now the raw C identifier that
  17397. appears on a declaration. This changes the behavior of
  17398. member functions. For example:
  17399. %typemap(out) int foo {
  17400. ...
  17401. }
  17402. class Blah {
  17403. public:
  17404. int foo(); // typemap gets applied
  17405. }
  17406. Previous versions never really specified how this was supposed to
  17407. work. In SWIG1.1, you could probably write a typemap for the
  17408. wrapper name like this:
  17409. %typemap(out) int Blah_foo { ... }
  17410. However, this old behavior is now withdrawn and not supported.
  17411. Just use the member name without any sort of special prefix.
  17412. *** POTENTIAL INCOMPATIBILITY ***
  17413. 11/06/2001:beazley
  17414. Changes to Tcl module initialization:
  17415. (1) SWIG now automatically includes the code needed to work with
  17416. Tcl stubs. Simply compile with -DUSE_TCL_STUBS.
  17417. (2) SWIG now automatically calls Tcl_PkgProvide to register
  17418. a package name. The package name is the same as the name
  17419. specified with the %module directive. The version number is
  17420. set to "0.0" by default. To change the version number, use
  17421. swig -pkgversion 1.2 interface.i.
  17422. *** POTENTIAL INCOMPATIBILITY ***
  17423. Modules that provided stubs and Tcl_PkgProvide on their own might
  17424. break. Simply remove that code.
  17425. 11/05/2001:beazley
  17426. Changed code generation of constants in the Tcl module. Constants
  17427. are now stored in a large table that get installed at module startup.
  17428. There are also no longer any static variables so it should generate
  17429. somewhat less code.
  17430. 11/04/2001:beazley
  17431. The "const" typemap has been renamed to "constant" in many language
  17432. modules. "const" is a C keyword which made the handling of the typemap
  17433. directive somewhat awkward in the parser.
  17434. *** POTENTIAL INCOMPATIBILITY ***
  17435. 11/04/2001:beazley
  17436. %typemap directive can now accept nearly arbitrary keyword parameters.
  17437. For example:
  17438. %typemap(in,parse="i",doc="integer") int "..."
  17439. The purpose of the keyword parameters is to supply code generation
  17440. hints to the target language module. The intepretation of the
  17441. parameters is language specific.
  17442. *** NEW FEATURE ***
  17443. 11/04/2001:beazley
  17444. Slight semantic change to internal call/return by value handling.
  17445. In previous versions of SWIG, call-by-value was translated
  17446. into pointers. For example:
  17447. double dot_product(Vector a, Vector b);
  17448. turned into this:
  17449. double wrap_dot_product(Vector *a, Vector *b) {
  17450. return dot_product(*a,*b);
  17451. }
  17452. This translation was normally performed by the SWIG core, outside
  17453. of the control of language modules. However, a side effect
  17454. of this was a lot of bizarre typemap behavior. For example,
  17455. if you did something like this:
  17456. %typemap(in) int32 {
  17457. ...
  17458. }
  17459. You would find that int32 was transformed into a pointer everywhere!
  17460. (needless to say, such behavior is unexpected and quite awkward to
  17461. deal with). To make matters worse, if a typedef was also used,
  17462. the pointer behavior suddenly disappeared.
  17463. To fix this, the pointer transformation is now pushed to the
  17464. language modules. This produces wrappers that look roughly
  17465. like this:
  17466. double wrap_dot_product(Vector *a, Vector *b) {
  17467. Vector arg1 = *a;
  17468. Vector arg2 = *b;
  17469. return dot_product(arg1,arg2);
  17470. }
  17471. This change also makes it easy to define typemaps for
  17472. arbitrary undefined types. For example, you can do this (and it
  17473. will work regardless what int32 is):
  17474. %typemap(in) int32 {
  17475. $1 = (int32) PyInt_AsLong($input);
  17476. }
  17477. *** POTENTIAL IMCOMPATIBILITY ***
  17478. This change may break call/return by value code generation in
  17479. some language modules.
  17480. 11/03/2001:beazley
  17481. Changed the name of the default typemaps to the following:
  17482. %typemap() SWIGTYPE {
  17483. ... an object ...
  17484. }
  17485. %typemap() SWIGTYPE * {
  17486. ... a pointer ...
  17487. }
  17488. %typemap() SWIGTYPE & {
  17489. ... a reference ...
  17490. }
  17491. %typemap() SWIGTYPE [] {
  17492. ... an array ...
  17493. }
  17494. %typemap() enum SWIGTYPE {
  17495. ... an enum value ...
  17496. }
  17497. %typemap() SWIGTYPE (CLASS::*) {
  17498. ... pointer to member ...
  17499. }
  17500. These types are used as the default for all types that don't match
  17501. anything else. See CHANGES log entry for 8/27/2000 for the
  17502. old behavior. The role of these types is also described in
  17503. Doc/Manual/Typemaps.html
  17504. *** POTENTIAL INCOMPATIBILITY ***
  17505. 10/25/2001:beazley
  17506. Modified Guile and Mzscheme modules to support
  17507. multi-argument typemaps.
  17508. 10/25/2001: cheetah (william fulton)
  17509. [Java] Fix to handle pointers to arrays.
  17510. 10/24/2001:beazley
  17511. Defining a typemap rule for enum SWIGENUM can now be used
  17512. to define default behavior for enum variables.
  17513. 10/22/2001:beazley
  17514. Ruby module modified to support multi-argument typemaps.
  17515. 10/22/2001:beazley
  17516. The Ruby module can now handle functions with an arbitrary
  17517. number of arguments. Previous versions were limited to
  17518. to functions with only 9 or 16 arguments depending on
  17519. the use of default arguments. Note: from some inspection
  17520. of the Ruby interpreter source, the new approach might be
  17521. a little faster as well.
  17522. 10/18/2001:beazley
  17523. Fixed a bug with forward class declarations and
  17524. templates.
  17525. class Foo <S,T>;
  17526. Bug reported by Irina Kotlova.
  17527. 10/16/2001:beazley
  17528. Support for multivalued typemaps added. The typemaps
  17529. are specified using the syntax below. Within each
  17530. typemap, variable substitution is handled as follows:
  17531. %typemap(in) (int argc, char *argv[]) {
  17532. $arg; // The input object in the target language
  17533. $1; // C local variable for first argument
  17534. $2; // C local variable for second argument
  17535. // These variables refer to either argument
  17536. $1_type, $1_ltype, $1_basetype, etc... (argc)
  17537. $2_type, $2_ltype, $2_basetype, etc... (argv[])
  17538. // Array dimension of argv
  17539. $2_dim0
  17540. }
  17541. Basically any variable that was available in normal typemaps
  17542. is available for either argument by prefacing the variable
  17543. name by '$n_' where n is the argument position.
  17544. Notes:
  17545. (1) Multi-valued typemaps can only be applied to a single
  17546. object in the target scripting language. For example,
  17547. you can split a string into a (char *, int) pair or
  17548. split a list into a (int, char []) pair. It is not
  17549. possible to map multiple objects to multiple arguments.
  17550. (2) To maintain compatibility with older SWIG versions, the
  17551. variables such as $target and $type are preserved and
  17552. are mapped onto the first argument only.
  17553. (3) This should not affect compatibility with older code.
  17554. Multi-valued typemaps are an extension to typemap handling.
  17555. Single valued typemaps can be specified in the usual
  17556. way.
  17557. The old $source and $target variables are officially
  17558. deprecated. Input variables are referenced through
  17559. $arg$ and output values are reference through $result$.
  17560. *** NEW FEATURE ***
  17561. 10/16/2001:beazley
  17562. Added parsing support for multivalued typemaps. The syntax
  17563. is a little funky, but here goes:
  17564. // Define a multivalued typemap
  17565. %typemap(in) (int argc, char *argv[]) {
  17566. ... typemap code ...
  17567. }
  17568. // Multivalued typemap with locals
  17569. %typemap(in) (int argc, char *argv[])(int temp) {
  17570. ... typemap code ...
  17571. }
  17572. // Copy a multivalued typemap
  17573. %typemap(in) (int argcount, char **argv) = (int argc, char *argv[]);
  17574. // Apply a multivalued typemap
  17575. %apply (int argc, char *argv[]) { (int argcount, char **argv) };
  17576. Note: this extra parsing support is added for future extension.
  17577. No language modules currently support multi-valued typemaps.
  17578. 10/11/2001:beazley
  17579. Modified the typemap matching code to discard qualifiers when
  17580. checking for a match. For example, if you have a declaration
  17581. like this:
  17582. void blah(const char *x);
  17583. The typemap checker checks for a match in the following order:
  17584. const char *x
  17585. const char *
  17586. char *x
  17587. char *
  17588. If typedef's are involved, qualifier stripping occurs before
  17589. typedef resolution. So if you had this,
  17590. typedef char *string;
  17591. void blah(const string x);
  17592. typemap checking would be as follows:
  17593. const string x
  17594. const string
  17595. string x
  17596. string
  17597. const char *x
  17598. const char *
  17599. char *x
  17600. char *
  17601. The primary reason for this change is to simplify the implementation
  17602. of language modules. Without qualifier stripping, one has to write
  17603. seperate typemaps for all variations of const and volatile (which
  17604. is a pain).
  17605. *** POTENTIAL INCOMPATIBILITY *** Typemaps might be applied in
  17606. places where they weren't before.
  17607. 10/9/2001: beazley
  17608. SWIG now generates wrappers that properly disambiguate
  17609. overloaded methods that only vary in constness. For
  17610. example:
  17611. class Foo {
  17612. ...
  17613. void blah();
  17614. void blah() const;
  17615. ...
  17616. };
  17617. To handle this, the %rename directive can be used normally.
  17618. %rename(blah_const) blah() const;
  17619. In the resulting wrapper code, method calls like this
  17620. are now generated:
  17621. (obj)->blah() // Non-const version
  17622. ((Foo const *)obj)->blah() // const version
  17623. This should force the right method to be invoked.
  17624. Admittedly, this is probably obscure, but we might
  17625. as well get it right.
  17626. 10/8/2001: beazley
  17627. The preprocessor now ignores '\r' in the input.
  17628. This should fix the following bug:
  17629. [ #468416 ] SWIG thinks macro defs are declarations?
  17630. 10/8/2001: beazley
  17631. Added support for ||, &&, and ! in constants. This
  17632. fixes SF [ #468988 ] Logical ops break preprocessor.
  17633. However, at this time, constants using these operators
  17634. are not supported (the parser will issue a warning).
  17635. 10/4/2001: beazley
  17636. Added -show_templates command line option. This makes
  17637. SWIG display the code it actually parses to generate
  17638. template wrappers. Mostly useful for debugging.
  17639. *** NEW FEATURE ***
  17640. 10/4/2001: beazley
  17641. Change to semantics of %template directive. When
  17642. using %template, the template arguments are handled
  17643. as types by default. For example:
  17644. %template(vecint) vector<int>;
  17645. %template(vecdouble) vector<double>;
  17646. To specify a template argument that is *not* a type, you
  17647. need to use default-value syntax. For example:
  17648. %template(vecint) vector<int,int=50>;
  17649. %template(vecdouble) vector<int,size=100>;
  17650. In this case, the type name doesn't really matter--only
  17651. the default value (e.g., 50, 100) is used during
  17652. expansion. This differs from normal C++, but I couldn't
  17653. figure out a better way to do it in the parser. Might
  17654. implement an alternative later.
  17655. *** POTENTIAL INCOMPATIBILITY ***
  17656. 10/4/2001: beazley
  17657. Major changes to template handling in order to provide
  17658. better integration with the C++ type-system. The main
  17659. problem is as follows:
  17660. Suppose you have a template like this:
  17661. template<class T> void blah(const T x) { stuff };
  17662. Now suppose, that you instantiate the template on a
  17663. type like this in SWIG:
  17664. %template(blahint) blah<int *>;
  17665. In C++, this is *supposed* to generate code like this:
  17666. void blah(int *const x) { stuff };
  17667. However, in SWIG-1.3.9, the template substitution gets it wrong
  17668. and produces
  17669. void blah(const int *x) { stuff };
  17670. (notice the bad placement of the 'const' qualifier).
  17671. To fix this, the SWIG parser now generates implicit typedefs
  17672. for template type arguments that produces code roughly
  17673. equivalent to doing this:
  17674. typedef int *__swigtmpl1;
  17675. %template(blahint) blah<__swigtmpl1>;
  17676. which generates code like this:
  17677. void blah(const __swigtmpl1 x) { stuff };
  17678. Since this is correct in both C++ and SWIG, it provides the right
  17679. semantics and allows everything to compile properly. However,
  17680. to clean up the generated code a little bit, the parser keeps
  17681. track of the template types and performs back-substitution to
  17682. the original type when building the parse tree. Thus, even
  17683. though the implicit typedef is used in the input and may appear
  17684. in the generated wrapper file (for proper compilation), the parse
  17685. tree will hide a lot of these details. For example:
  17686. void blah(const __swigtmpl1 x) { stuff };
  17687. will look like it was declared as follows (which is what
  17688. you want):
  17689. void blah(int *const x) { stuff }
  17690. The only place you are likely to notice the typedef hack
  17691. is in bodies of template functions. For example, if you
  17692. did this,
  17693. template<class T> class blah {
  17694. ...
  17695. %addmethods {
  17696. void spam() {
  17697. T tempvalue;
  17698. ...
  17699. }
  17700. }
  17701. }
  17702. you will find that 'T tempvalue' got expanded into some
  17703. strange typedef type. This *still* compiles correctly
  17704. so it's not a big deal (other than looking kind of ugly
  17705. in the wrapper file).
  17706. 10/4/2001: beazley
  17707. Fixed some inheritance problems in Tcl Object interface.
  17708. 10/1/2001: beazley
  17709. Tcl module has changed to use byte-backed pointer strings. This
  17710. implementation should be safe on 64-bit platforms. However,
  17711. the order in which digits appear in pointer values no longer
  17712. directly corresponds to the actual numerical value of a
  17713. pointer (on little-endian machines, pairs of digits appear
  17714. in reverse order).
  17715. 10/1/2001: beazley
  17716. Perl5 module is now driven by a configuration file 'perl5.swg'
  17717. in the SWIG library.
  17718. 10/1/2001: beazley
  17719. The perl5 module no longer tries to apply the "out" typemap
  17720. in code generated for magic variables. I'm surprised that
  17721. this ever worked at all (since all of the code that was there
  17722. was wrong anyways). Use the "varout" typemap to handle
  17723. global variables.
  17724. 10/1/2001: beazley
  17725. Fixed a bug related to character array members of structures.
  17726. For example:
  17727. struct Foo {
  17728. char name[32];
  17729. };
  17730. SWIG is normally supposed to return a string, but this was
  17731. broken in 1.3.9. The reason it was broken was actually
  17732. due to a subtle new feature of typemaps. When a data member
  17733. is set to an array like this, the return type of the related
  17734. accessor function is actually set to an array. This means
  17735. that you can now write typemaps like this:
  17736. %typemap(python,out) char [ANY] {
  17737. $target = PyString_FromStringAndSize($source,$dim0);
  17738. }
  17739. This functionality can be used to replace the defunct
  17740. memberout typemap in a more elegant manner.
  17741. 9/29/2001: beazley
  17742. Some further refinement of qualified C++ member functions.
  17743. For example:
  17744. class Foo {
  17745. ...
  17746. void foo() const;
  17747. ...
  17748. };
  17749. (i) The SWIG parser was extended slightly to allow 'volatile'
  17750. and combinations of 'const' and 'volatile' to be used. This
  17751. is probably rare, but technically legal. Only added for
  17752. completeness.
  17753. (ii) For the purposes of overloading, qualified and non-qualified
  17754. functions are different. Thus, when a class has methods like this:
  17755. void foo();
  17756. void foo() const;
  17757. Two distinct methods are declared. To deal with this, %rename
  17758. and similar directives have been extended to recognize const.
  17759. Thus, one can disambiguate the two functions like this:
  17760. %rename(fooconst) Foo::foo() const;
  17761. or simply ignore the const variant like this:
  17762. %ignore Foo::foo() const;
  17763. Note: SWIG currently has no way to actually invoke the const
  17764. member since the 'const' is discarded when generating wrappers
  17765. for objects.
  17766. 9/27/2001: beazley
  17767. New directive. %namewarn can be used to issue warning
  17768. messages for certain declaration names. The name
  17769. matching is the same as for the %rename directive.
  17770. The intent of this directive is to issue warnings for
  17771. possible namespace conflicts. For example:
  17772. %namewarn("print is a python keyword") print;
  17773. The name matching algorithm is performed after a name
  17774. has been resolved using %rename. Therefore, a
  17775. declaration like this will not generate a warning:
  17776. %rename("Print") print;
  17777. ...
  17778. void print(); /* No warning generated */
  17779. Since the warning mechanism follows %rename semantics, it is
  17780. also to issue warnings for specific classes or just for
  17781. certain member function names.
  17782. (Dave - I've been thinking about adding something like this
  17783. for quite some time. Just never got around to it)
  17784. *** NEW FEATURE ***
  17785. 9/27/2001: beazley
  17786. Enhanced the %ignore directive so that warning messages
  17787. can be issued to users. This is done using %ignorewarn
  17788. like this:
  17789. %ignorewarn("operator new ignored") operator new;
  17790. The names and semantics of %ignorewarn is exactly the
  17791. same as %ignore. The primary purpose of this directive
  17792. is for module writers who want to ignore certain types
  17793. of declarations, but who also want to alert users about it.
  17794. A user might also use this for debugging (since messages
  17795. will appear whenever an ignored declaration appears).
  17796. *** NEW FEATURE ***
  17797. 9/26/2001: beazley
  17798. Super-experimental support for overloaded operators.
  17799. This implementation consists of a few different parts.
  17800. (i) Operator names such as 'operator+' are now allowed
  17801. as valid declarator names. Thus the 'operator' syntax
  17802. can appear *anyplace* a normal declarator name was used
  17803. before. On the surface, this means that operators can
  17804. be parsed just like normal functions and methods.
  17805. However, it also means that operator names can be used
  17806. in many other SWIG directives like %rename. For example:
  17807. %rename(__add__) Complex::operator+(const Complex &);
  17808. (ii) Operators are wrapped *exactly* like normal functions
  17809. and methods. Internally, the operator name is used
  17810. directly meaning that the wrapper code might contain
  17811. statements like this:
  17812. arg0->operator*((Complex const &)*arg1);
  17813. This all seems to parse and compile correctly (at least
  17814. on my machine).
  17815. (iii) SWIG will no longer wrap a declaration if its symbol
  17816. table name contains illegal identifier characters. If
  17817. illegal characters are detected, you will see an error
  17818. like this:
  17819. Warning. Can't wrap operator* unless renamed to a valid identifier.
  17820. The only way to fix this is to use %rename or %name to bind
  17821. the operator to a nice name like "add" or something. Note:
  17822. the legal identifier characters are determined by the target
  17823. language.
  17824. There are certain issues with friend functions and operators.
  17825. Sometimes, friends are used to define mixed operators such
  17826. as adding a Complex and a double together. Currently, SWIG
  17827. ignores all friend declarations in a class. A global operator
  17828. declaration can probably be made to work, but you'll have to
  17829. rename it and it probably won't work very cleanly in the
  17830. target language since it's not a class member.
  17831. SWIG doesn't know how to handle operator specifications
  17832. sometimes used for automatic type conversion. For example:
  17833. class String {
  17834. ...
  17835. operator const char*();
  17836. ...
  17837. };
  17838. (this doesn't parse correctly and generates a syntax error).
  17839. Also: operators no longer show up as separate parse-tree
  17840. nodes (instead they are normal 'cdecl' nodes). I may
  17841. separate them as a special case later.
  17842. See Examples/python/operator for an example.
  17843. *** SUPER-EXPERIMENTAL NEW FEATURE ***
  17844. Version 1.3.9 (September 25, 2001)
  17845. ==================================
  17846. 9/25/2001: beazley
  17847. Fixed parsing problem with type declarations like
  17848. 'char ** const'. SWIG parsed this correctly, but the
  17849. internal type was represented incorrectly (the pointers
  17850. and qualifiers were in the wrong order).
  17851. 9/25/2001: beazley
  17852. Withdrew experimental feature (noted below) that was
  17853. causing serious parsing problems.
  17854. Version 1.3.8 (September 23, 2001)
  17855. ==================================
  17856. 9/23/2001: beazley
  17857. Included improved distutils setup.py file in the Tools
  17858. directory (look for the setup.py.tmpl file). Contributed by
  17859. Tony Seward.
  17860. 9/23/2001: beazley
  17861. Included two new RPM spec files in the Tools directory. Contributed
  17862. by Tony Seward and Uwe Steinmann.
  17863. 9/21/2001: beazley
  17864. Fixed SF Bug [ #463635 ] Perl5.swg does not compile in Visual C++
  17865. 9/21/2001: beazley
  17866. Two new directives control the creation of default
  17867. constructors and destructors:
  17868. %nodefault
  17869. %makedefault
  17870. These replace %pragma nodefault and %pragma makedefault.
  17871. (old code will still work, but documentation will only
  17872. describe the new directives).
  17873. 9/21/2001: beazley
  17874. Fixed SF Bug [ #462354 ] %import broken in 1.3.7.
  17875. 9/20/2001: beazley
  17876. Parser modified to ignore out-of-class constructor
  17877. and destructor declarations. For example:
  17878. inline Foo::Foo() :
  17879. Bar("foo")
  17880. {
  17881. }
  17882. inline Foo::~Foo() {
  17883. }
  17884. Suggested by Jason Stewart.
  17885. *** EXPERIMENTAL FEATURE ***
  17886. 9/20/2001: beazley
  17887. Modified the parser to ignore forward template class
  17888. declarations. For example:
  17889. template <class V, long S> class MapIter;
  17890. Suggested by an email example from Irina Kotlova.
  17891. 9/20/2001: beazley
  17892. Fixed problem with undeclared tcl_result variable in
  17893. the "out" typemap for Tcl. Reported by Shaun Lowry.
  17894. 9/20/2001: beazley
  17895. Incorporated changes to make SWIG work with ActivePerl.
  17896. Contributed by Joel Reed.
  17897. 9/20/2001: beazley
  17898. Slight change to the parsing of C++ constructor initializers.
  17899. For example:
  17900. class Foo : public Bar {
  17901. public:
  17902. Foo() : Bar(...) {...}
  17903. };
  17904. SWIG now discards the contents of the (...) regardless of
  17905. what might enclosed (even if syntactically wrong). SWIG
  17906. doesn't need this information and there is no reason to
  17907. needless add syntax rules to handle all of the possibilities
  17908. here.
  17909. 9/20/2001: beazley
  17910. Change to typemaps for structure members. If you have a
  17911. structure like this:
  17912. struct Vector {
  17913. int *bar;
  17914. };
  17915. The member name 'bar' is now used in any accessor functions.
  17916. This allows the "in" typemap to be used when setting the value.
  17917. For example, this typemap
  17918. %typemap(python,in) int *bar {
  17919. ...
  17920. }
  17921. now matches Vector::bar. It should be noted that this will also
  17922. match any function with an argument of "int *bar" (so you should
  17923. be careful).
  17924. *** NEW FEATURE. POTENTIAL INCOMPATIBILITY ***
  17925. 9/20/2001: beazley
  17926. Fixed SF bug #462642 setting string values in structures
  17927. 9/20/2001: beazley
  17928. Fixed SF bug #462398 problem with nested templates.
  17929. 9/20/2001: beazley
  17930. Fixed SF bug #461626 problem with formatting and C++ comments.
  17931. 9/20/2001: beazley
  17932. Fixed SF bug #462845 Wrong ownership of returned objects.
  17933. 9/19/2001: beazley
  17934. Fixed SF bug #459367. Default constructors for classes
  17935. with pure virtual methods.
  17936. 9/19/2001: beazley
  17937. Fixed problem with default arguments and class scope. For
  17938. example:
  17939. class Foo {
  17940. public:
  17941. enum bar { FOO, BAR };
  17942. void blah(bar b = FOO);
  17943. ...
  17944. }
  17945. SWIG now correctly generates a default value of "Foo::FOO" for
  17946. the blah() method above. This used to work in 1.1, but was
  17947. broken in 1.3.7. Bug reported by Mike Romberg.
  17948. Version 1.3.7 (September 3, 2001)
  17949. ==================================
  17950. 9/02/2001: beazley
  17951. Added special %ignore directive to ignore declarations. This
  17952. feature works exactly like %rename. For example:
  17953. %ignore foo; // Ignore all declarations foo
  17954. %ignore ::foo; // Only ignore foo in global scope
  17955. %ignore Spam::foo; // Only ignore in class Spam
  17956. %ignore *::foo; // Ignore in all classes
  17957. %ignore can also be parameterized. For example:
  17958. %ignore foo(int);
  17959. %ignore ::foo(int);
  17960. %ignore Spam::foo(int);
  17961. %ignore *::foo(int);
  17962. *** NEW FEATURE ***
  17963. 9/02/2001: cheetah (william fulton)
  17964. [Java] shadowcode pragma modified so that the code that is output
  17965. in the shadow file is placed relative to where it is placed in the
  17966. c/c++ code. This allows support for JavaDoc function comments.
  17967. 9/01/2001: beazley
  17968. Fixed SF Patch [ #447791 ] Fix for python -interface option.
  17969. Submitted by Tarn Weisner Burton.
  17970. 9/01/2001: beazley
  17971. SWIG no longer generates default constructors/destructors
  17972. for a class if it only defines a private/protected constructor
  17973. or destructor or if any one of its base classes only has
  17974. private constructors/destructors. This was reported in
  17975. SF Patch [ #444281 ] nonpublic/default/inhereted ctor/dtor
  17976. by Marcelo Matus.
  17977. 9/01/2001: beazley
  17978. Added patch to Perl5 module that allows constants to be
  17979. wrapped as constants that don't require the leading $.
  17980. This feature is enabled using the -const option.
  17981. Patch contributed by Rich Wales.
  17982. *** NEW FEATURE ***
  17983. 8/31/2001: beazley
  17984. Added parsing support for the 'volatile' type qualifier.
  17985. volatile doesn't mean anything to SWIG, but it is
  17986. needed to properly generate prototypes for declarations
  17987. that use it. It's also been added to make the SWIG type
  17988. system more complete.
  17989. *** NEW FEATURE ***
  17990. 8/30/2001: beazley
  17991. Added support for parameterized %rename directive. *** This
  17992. new feature can be used to greatly simplify the task of
  17993. resolving overloaded methods and functions. ***
  17994. In prior versions of SWIG, the %rename directive was
  17995. used to consistently apply an identifier renaming. For
  17996. example, if you said this:
  17997. %rename foo bar;
  17998. Every occurrence of 'foo' would be renamed to 'bar'.
  17999. Although this works fine for resolving a conflict with a
  18000. target language reserved word, it is useless for
  18001. for dealing with overloaded methods. This is because
  18002. all methods are simply renamed to the same thing
  18003. (generating the same conflict as before).
  18004. Therefore, the only way to deal with overloaded methods
  18005. was to go through and individually rename them all using
  18006. %name. For example:
  18007. class Foo {
  18008. public:
  18009. virtual void bar(void);
  18010. %name(bar_i) virtual void bar(int);
  18011. ...
  18012. };
  18013. To make matters worse, you had to do this for all
  18014. derived classes too.
  18015. class Spam : public Foo {
  18016. public:
  18017. virtual void bar(void);
  18018. %name(bar_i) virtual void bar(int);
  18019. ...
  18020. };
  18021. Needless to say, this makes it extremely hard to resolve
  18022. overloading without a lot of work and makes it almost
  18023. impossible to use SWIG on raw C++ .h files.
  18024. To fix this, %rename now accepts parameter declarators.
  18025. The syntax has also been changed slightly. For example,
  18026. the following declaration renames all occurrences of 'bar(int)'
  18027. to 'bar_i', leaving any other occurrence of 'bar' alone.
  18028. %rename(bar_i) bar(int);
  18029. Using this feature, you can now selectively rename
  18030. certain declarations in advance. For example:
  18031. %rename(bar_i) bar(int);
  18032. %rename(bar_d) bar(double);
  18033. // Include raw C++ header
  18034. %include "header.h"
  18035. When %rename is used in this manner, all occurrence of bar(int)
  18036. are renamed wherever they might occur. More control is obtained
  18037. through explicit qualification. For example,
  18038. %rename(bar_i) ::bar(int);
  18039. only applies the renaming if bar(int) is defined in the global scope.
  18040. The declaration,
  18041. %rename(bar_i) Foo::bar(int);
  18042. applies the renaming if bar(int) is defined in a class Foo.
  18043. This latter form also supports inheritance. Therefore, if you
  18044. had a class like this:
  18045. class Spam : public Foo {
  18046. public:
  18047. void bar(int);
  18048. }
  18049. The Spam::bar(int) method would also be renamed (since Spam
  18050. is a subclass of Foo). This latter feature makes it easy
  18051. for SWIG to apply a consistent renaming across an entire
  18052. class hierarchy simply by specifying renaming rules for
  18053. the base class.
  18054. A class wildcard of * can be used if you want to renaming
  18055. all matching members of all classes. For example:
  18056. %rename(bar_i) *::bar(int);
  18057. will rename all members bar(int) that are defined in classes.
  18058. It will not renamed definitions of bar(int) in the global
  18059. scope.
  18060. The old use of %rename is still supported, but is somewhat
  18061. enhanced.
  18062. %rename(foo) bar; // Renames all occurrences of 'bar'.
  18063. %rename(foo) ::bar; // Rename all 'bar' in global scope only.
  18064. %rename(foo) *::bar; // Rename all 'bar' in classes only.
  18065. %rename(foo) Foo::bar; // Rename all 'bar' defined in class Foo.
  18066. *** NEW FEATURE ***
  18067. 8/30/2001: beazley
  18068. Added support for data-member to member-function
  18069. transformation. For example, suppose you had a
  18070. structure like this:
  18071. struct Vector {
  18072. double x,y;
  18073. };
  18074. Now suppose that you wanted to access x and y
  18075. through a member function interface instead
  18076. of the usual SWIG behavior. For example:
  18077. f.set_x(3.4) # instead of f.x = 3.4
  18078. x = f.get_x() # instead of x = f.x
  18079. To do this, simply use the new %attributefunc
  18080. directive. For example:
  18081. %attributefunc(get_%s,set_%s)
  18082. struct Vector {
  18083. double x,y;
  18084. };
  18085. %noattributefunc
  18086. The arguments to %attributefunc are C-style printf
  18087. format strings that determine the naming convention
  18088. to use. %s is replaced with the actual name of the
  18089. data member. SWIG provides a number of printf
  18090. extensions that might help. For example, if you
  18091. wanted to title case all of the attributes, you
  18092. could do this:
  18093. %attributefunc(get%(title)s,set%(title)s);
  18094. This will turn an attribute 'bar' to 'getBar()' and 'setBar()'.
  18095. (someone requested this long ago, but I finally figured
  18096. how to implement it in a straightforward manner).
  18097. *** EXPERIMENTAL NEW FEATURE ***
  18098. 8/30/2001: beazley
  18099. SWIG now automatically generates default constructors
  18100. and destructors if none are defined. This used to be
  18101. enabled with a command line switch -make_default, but
  18102. most people want these functions anyways. To turn
  18103. off this behavior use the -no_default option or include
  18104. the following pragma in the interface file:
  18105. %pragma no_default;
  18106. This may break certain interfaces that defined their
  18107. own constructors/destructors using the same naming
  18108. convention as SWIG. If so, you will get duplicate
  18109. symbols when compiling the SWIG wrapper file.
  18110. *** POTENTIAL INCOMPATIBILITY ***
  18111. 8/29/2001: beazley
  18112. Changes to Perl5 shadow class code generation. Iterators
  18113. are no longer supported (FIRSTKEY, NEXTKEY). Also, attribute
  18114. access has been changed to rely on inheritance in order
  18115. to provide better behavior across modules.
  18116. 8/28/2001: beazley
  18117. Various obscure improvements to the type system and classes.
  18118. Strange declarations like this are now wrapped correctly
  18119. (i.e., the generated wrapper code doesn't cause the C++
  18120. compiler to die with a type error).
  18121. class Foo {
  18122. public:
  18123. typedef double Real;
  18124. Real foo(Real (*op)(Real,Real), Real x, Real y);
  18125. };
  18126. Inheritance of types is also handled correctly.
  18127. 8/28/2001: beazley
  18128. Changes to class wrappers. When SWIG sees two classes like this,
  18129. class X {
  18130. public:
  18131. void foo();
  18132. ...
  18133. }
  18134. class Y : public X {
  18135. public:
  18136. void bar();
  18137. ...
  18138. }
  18139. it now only generates two wrapper functions:
  18140. X_foo(X *x) { x->foo(); }
  18141. Y_bar(Y *y) { y->bar(); }
  18142. Unlike SWIG1.15, the foo() method does *not* propagate to a wrapper
  18143. function Y_foo(). Instead, the base class method X_foo() must be
  18144. used.
  18145. This change should not affect modules that use shadow classes, but
  18146. it might break modules that directly use the low-level C wrappers.
  18147. This change is being made for a number of reasons:
  18148. - It greatly simplifies the implementation of SWIG--especially
  18149. with anticipated future changes such as overloaded methods.
  18150. - It results in substantially less wrapper code--especially
  18151. for big C++ class hierarchies (inherited declarations
  18152. are no longer copied into every single derived class).
  18153. - It allows for better code generation across multiple
  18154. SWIG generated modules (code isn't replicated in
  18155. every single module).
  18156. *** POTENTIAL INCOMPATIBILITY ***
  18157. 8/22/2001: cheetah (william fulton)
  18158. Provided some Windows documentation in the Win directory and some
  18159. Visual C++ project files for running examples on Windows.
  18160. 8/28/2001: mkoeppe
  18161. [Guile] Handle renamed overloaded functions properly;
  18162. thanks to Marc Zonzon <Marc.Zonzon@univ-rennes1.fr> for the
  18163. patch. See the new test case name_cxx.
  18164. 8/27/2001: mkoeppe
  18165. [Tcl] Removed lots of warnings issued by the Sun Forte
  18166. compilers, which were caused by mixing function pointers
  18167. of different linkages (C++/C).
  18168. 8/23/2001: mkoeppe
  18169. Improved the MzScheme module by porting Guile's pointer
  18170. type checking system and making type dispatch
  18171. typemap-driven.
  18172. 8/22/2001: beazley
  18173. Entirely new symbol table processing. SWIG should be able to
  18174. report much better error messages for multiple declarations.
  18175. Also, the new symbol table allows for overloaded functions
  18176. (although overloading isn't quite supported in the language
  18177. modules yet).
  18178. 8/22/2001: cheetah (william fulton)
  18179. * [Java] %new support added.
  18180. * [Java] Package JNI name refixed!
  18181. 8/19/2001: beazley
  18182. Python module modified to support pointers to C++ members. This
  18183. is an experimental feature.
  18184. *** NEW FEATURE ***
  18185. 8/19/2001: beazley
  18186. Added limited parsing and full type-system support for pointers to
  18187. members. None of SWIG's language modules really know how to deal with
  18188. this so this is really only provided for completeness and future
  18189. expansion. Note: SWIG does not support pointers to members which
  18190. are themselves pointers to members, references to pointers to members,
  18191. or other complicated declarations like this.
  18192. *** NEW FEATURE ***
  18193. 8/19/2001: beazley
  18194. SWIG is much better at parsing certain C++ declarations. Operators and
  18195. friends generally don't cause anymore syntax errors. However, neither
  18196. are really supported.
  18197. 8/18/2001: beazley
  18198. Added *highly* experimental support for wrapping of C++
  18199. template declarations. Since C++ templates are essentially
  18200. glorified macros and SWIG has a fully operational C
  18201. preprocessor with macro support, the parser now converts
  18202. template declarations to macros. For example, a function
  18203. template like this
  18204. template<class T> T max(T a, T b);
  18205. is internally converted into a macro like this:
  18206. %define %_template_max(__name,T)
  18207. %name(__name) T max(T a, T b);
  18208. %enddef
  18209. To instantiate a version of the template, a special %template declaration
  18210. is used like this:
  18211. %template(maxint) max<int>;
  18212. %template(maxdouble) max<double>;
  18213. The parameter to the %template directive must be proper C identifier that's
  18214. used to uniquely name the resulting instantiation. When used, the
  18215. the expanded macro looks like this:
  18216. %name(maxint) int max(int a, int b);
  18217. %name(maxdouble) double max(double a, double b);
  18218. A similar technique is used for template classes. For instance:
  18219. template<class T> class vector {
  18220. T *data;
  18221. int sz;
  18222. public:
  18223. vector(int nitems);
  18224. T *get(int n);
  18225. ...
  18226. };
  18227. Gets converted into a macro like this:
  18228. %define %_template_vector(__name, T)
  18229. %{
  18230. typedef vector<T> __name;
  18231. %}
  18232. class __name {
  18233. T *data;
  18234. int sz;
  18235. public:
  18236. __name(int nitems);
  18237. T *get(int n);
  18238. ...
  18239. };
  18240. typedef __name vector<T>;
  18241. %enddef
  18242. A specific instantiation is created in exactly the same way:
  18243. %template(intvec) vector<int>;
  18244. The resulting code parsed by SWIG is then:
  18245. %{
  18246. typedef vector<int> intvec;
  18247. %}
  18248. class intvec {
  18249. int *data;
  18250. int sz;
  18251. public:
  18252. intvec(int nitems);
  18253. int *get(int n);
  18254. ...
  18255. };
  18256. typedef intvec vector<int>;
  18257. Note: the last typedef is non-standard C and is used by SWIG to provide
  18258. an association between the name "intvec" and the template type
  18259. "vector<int>".
  18260. CAUTION: This is an experimental feature and the first time SWIG has
  18261. supported C++ templates. Error reporting is essential non-existent.
  18262. It will probably break in certain cases.
  18263. *** EXPERIMENTAL NEW FEATURE ****
  18264. 8/15/2001: beazley
  18265. Change to wrapping of multi-dimensional arrays. Arrays
  18266. are now properly mapped to a pointer to an array of
  18267. one less dimension. For example:
  18268. int [10]; --> int *
  18269. int [10][20]; --> int (*)[20];
  18270. int [10][20][30]; --> int (*)[20][30];
  18271. This change may break certain SWIG extensions because
  18272. older versions simply mapped all arrays into a single
  18273. pointer such as "int *". Although possibly unusual,
  18274. the new version is correct in terms of the C type system.
  18275. *** POTENTIAL INCOMPATIBILITY ***
  18276. 8/06/2001: cheetah (william fulton)
  18277. * [Java] Array setters generated for struct/class array members.
  18278. 8/13/2001: beazley
  18279. Many improvements to Tcl/Perl/Python modules to better
  18280. work with multiple interface files and the %import directive.
  18281. 8/13/2001: beazley
  18282. Fixed up the behavior of %import in the Python module.
  18283. SWIG no longer pollutes the module namespace by using
  18284. 'from module import *' to refer to the other module.
  18285. Instead, it does a proper 'import module'. Also, SWIG
  18286. may work a lot better when importing modules that include
  18287. references to other imported modules.
  18288. 8/13/2001: mkoeppe
  18289. Added new typemap substitutions, generalizing those of the
  18290. Guile-specific 5/27/2001 changes:
  18291. * $descriptor is the same as SWIGTYPE$mangle, but also
  18292. ensures that the type descriptor of this name gets
  18293. defined.
  18294. * $*type, $*ltype, $*mangle, $*descriptor are the same as
  18295. the variants without star, but they REMOVE one level of
  18296. pointers from the type. (This is only valid for pointer
  18297. types.)
  18298. * $&type, $&ltype, $&mangle, $&descriptor are the same as
  18299. the variants without ampersand, but they ADD one level of
  18300. pointers to the type.
  18301. The Guile-specific substitution $basedescriptor was removed
  18302. because it was useless.
  18303. 8/12/2001: beazley
  18304. The %extern directive is now deprecated and withdrawn. The
  18305. purpose of this directive was to import selected definitions
  18306. from other interface files and headers. However, the same
  18307. functionality is better handled through %import. This
  18308. leaves SWIG with two file inclusion directives:
  18309. %include filename - Inserts into current interface
  18310. %import filename - Import types and classes from
  18311. another module
  18312. *** POTENTIAL INCOMPATIBILITY ***
  18313. 8/09/2001: beazley
  18314. Added new support for wrapping C/C++ callback functions.
  18315. A common problem with some C libraries is that many
  18316. functions take a function pointer as an argument. For example:
  18317. int do_op(..., int (*op)(int,int), ...);
  18318. Unfortunately, the only way to call such a function is to
  18319. pass it a function pointer of some compatible type. In
  18320. previous versions of SWIG, you had to solve this problem
  18321. with some really gross hacks. For example, if you wanted to
  18322. use the following function as a callback,
  18323. int foo(int, int);
  18324. you had to install a pointer to it as a constant. For example:
  18325. %constant int (*FOO)(int,int) = foo;
  18326. or
  18327. const int (*FOO)(int,int) = foo;
  18328. or if you had a really old SWIG version:
  18329. typedef int (*OP_FUNC)(int,int);
  18330. int do_op(..., OP_FUNC, ...);
  18331. const OP_FUNC FOO = foo;
  18332. Now, you can do one of two things:
  18333. %constant int foo(int,int);
  18334. This creates a constant 'foo' of type int (*)(int,int).
  18335. Alternatively, you can do this:
  18336. %callback("%s");
  18337. int foo(int,int);
  18338. int bar(int,int);
  18339. %nocallback;
  18340. In this case, the functions are installed as constants where
  18341. the name is defined by the format string given to %callback().
  18342. If the names generated by the format string differ from the
  18343. actual function name, both a function wrapper and a callback
  18344. constant are created. For example:
  18345. %callback("%(upper)s");
  18346. int foo(int,int);
  18347. int bar(int,int);
  18348. %nocallback;
  18349. Creates two wrapper functions 'foo', 'bar' and additionally
  18350. creates two callback constants 'FOO', 'BAR'.
  18351. Note: SWIG still does not provide automatic support for
  18352. writing callback functions in the target language.
  18353. *** NEW FEATURE ***
  18354. 8/06/2001: cheetah (william fulton)
  18355. * struct nesting fixes as per SF bug #447488.
  18356. 8/03/2001: beazley
  18357. The %name directive now applies to constants created with
  18358. #define and %constant. However, most language modules
  18359. were never written to support this and will have to be
  18360. modified to make it work. Tcl, Python, and Perl modules
  18361. are working now.
  18362. *** NEW FEATURE ***
  18363. 8/03/2001: beazley
  18364. Massive changes and simplification of C declaration parsing.
  18365. Although SWIG is still not a full C parser, its ability
  18366. to handle complex datatypes including pointers to functions
  18367. and pointers to arrays has been vastly improved.
  18368. 8/03/2001: cheetah (william fulton)
  18369. * Distribution fixes: autoconf no longer needed to install SWIG.
  18370. 8/02/2001: beazley
  18371. Removed two undocumented parsing features. SWIG no longer
  18372. supports out-of-class static function or variable
  18373. declarations. For example:
  18374. static int Foo::bar;
  18375. This feature may return if there is sufficient demand.
  18376. However, since SWIG is most often used with header files,
  18377. it is more likely for these definitions to be included
  18378. in the class definition.
  18379. *** POTENTIAL INCOMPATIBILITY ***
  18380. 8/02/2001: cheetah (william fulton)
  18381. * Cleanup of the GIFPlot examples. Upgraded Java GIFPlot example.
  18382. 8/01/2001: cheetah (william fulton)
  18383. * [Java] Efficiency changes: _cPtr used where possible rather than
  18384. getCPtr(). Bug fixes for inheritance - derived class sometimes
  18385. didn't delete the c memory when _delete() was called.
  18386. * [Java] Abstract c++ classes are wrapped with a java abstract shadow
  18387. class. Also a pure virtual function is mapped with an abstract method.
  18388. * The default output file has always been <module>_wrap.c. It is now
  18389. <module>_wrap.cxx if the -c++ commandline option is passed to swig.
  18390. This has been done as otherwise c++ code would appear in a c file.
  18391. *** POTENTIAL INCOMPATIBILITY ***
  18392. 7/31/2001: beazley
  18393. Modified the %constant directive to be more C-like in syntax.
  18394. The syntax is now:
  18395. %constant NAME = VALUE;
  18396. %constant TYPE NAME = VALUE;
  18397. For example:
  18398. %constant Foo *Bar = &Spam;
  18399. A more subtle case is as follows:
  18400. %constant int (*FOO)(int,int) = blah;
  18401. *** POTENTIAL INCOMPATIBILITY *** Modules that were using
  18402. the %constant directive directly will need to be modified.
  18403. 7/30/2001: beazley
  18404. Removed obscure and undocumented form of the %inline directive:
  18405. %inline int blah(int a, int b) {
  18406. ...
  18407. }
  18408. *** POTENTIAL INCOMPATIBILITY ***
  18409. (note: this feature was never documented and is withdrawn)
  18410. 7/30/2001: beazley
  18411. Removed support for functions with no explicitly declared
  18412. return type. For example:
  18413. foo(int);
  18414. In C, such functions were implicitly assumed to return an 'int'.
  18415. In C++, this is illegal. Either way, it's considered bad
  18416. style. Removing support for this in SWIG will simplify
  18417. certain issues in parsing.
  18418. *** POTENTIAL INCOMPATIBILITY ***
  18419. 7/30/2001: mkoeppe
  18420. * Partial merge from the CVS trunk. The Source/DOH directory
  18421. and most of the Source/Swig directory is up-to-date now.
  18422. * [Guile] %scheme is now a macro for %insert("scheme").
  18423. New syntax: %scheme "FILENAME";
  18424. New syntax: %scheme %{ SCHEME-CODE %}
  18425. New macros %multiple_values, %values_as_list,
  18426. %values_as_vector.
  18427. 7/29/2001: beazley
  18428. %readonly and %readwrite have been turned into SWIG pragmas.
  18429. %pragma(swig) readonly and %pragma(swig) readwrite. Macros
  18430. are used to provide backwards compatibility.
  18431. 7/29/2001: beazley
  18432. Minor changes to %pragma directive. %pragma must always
  18433. be directed to a specific language. For example:
  18434. %pragma(swig) make_default;
  18435. %pragma(perl5) include = "blah.i";
  18436. Also extended the pragma directive to allow code blocks
  18437. %pragma(foo) code = %{
  18438. ... some code ...
  18439. %}
  18440. *** POTENTIAL INCOMPATIBILITY ***
  18441. 7/29/2001: beazley
  18442. Change to the way 'const' variables are wrapped. In
  18443. previous versions of SWIG, a 'const' variable was
  18444. wrapped as a constant. Now, 'const' variables are
  18445. wrapped as read-only variables. There are several
  18446. reasons for making this change, mostly pertaining to
  18447. subtle details of how 'const' actually works.
  18448. This will probably break old interfaces that used 'const'
  18449. to create constants. As a replacement, consider using this:
  18450. const int a = 4; ===> %constant int a = 4;
  18451. *** POTENTIAL INCOMPATIBILITY ***
  18452. 7/29/2001: beazley
  18453. Reorganization and simplification of type parsing.
  18454. Types with 'const' should work correctly now.
  18455. 7/29/2001: beazley
  18456. Most swig directives related to the documentation system
  18457. are now deprecated.
  18458. 7/29/2001: beazley
  18459. Removed support for Objective-C in order to simplify
  18460. parser reconstruction. Will return if there is sufficient
  18461. demand.
  18462. *** POTENTIAL INCOMPATIBILITY ***
  18463. 7/29/2001: beazley
  18464. Code inclusion has been modified in the parser. A common
  18465. directive %insert is now used for everything. This
  18466. inserts a file into the output:
  18467. %insert(header) "foo.swg"
  18468. This inserts some inline code into the output
  18469. %insert(header) %{
  18470. ... some code ...
  18471. %}
  18472. There are five predefined targets for the insert directive:
  18473. "header" - Header section of wrapper file
  18474. "runtime" - Runtime section of wrapper file
  18475. "wrapper" - Wrapper section
  18476. "init" - Initialization function
  18477. "null" - Nothing. Discard.
  18478. The following directives are still supported, but are
  18479. now defined in terms of macros:
  18480. %{ ... %} -> %insert(header) %{ ... %}
  18481. %init %{ ... %} -> %insert(init) %{ ... %}
  18482. %wrapper %{ ... %} -> %insert(wrapper) %{ ... %}
  18483. %runtime %{ ... %} -> %insert(runtime) %{ ... %}
  18484. Language modules can define new named targets by using the
  18485. C API function Swig_register_filebyname() (see main.cxx).
  18486. For example, if you wanted to expose a shadow class file,
  18487. you could do this:
  18488. Swig_register_filebyname("shadow", f_shadow);
  18489. Then in the interface file:
  18490. %insert(shadow) %{ ... %}
  18491. Note: this change should not affect any old interfaces, but
  18492. does open up new possibilities for enhancements.
  18493. 7/29/2001: beazley
  18494. SWIG now always includes a standard library file 'swig.swg'.
  18495. This file defines a large number of macro definitions
  18496. that define the behavior of various SWIG directives.
  18497. Previously, all SWIG directives were handled as special
  18498. cases in the parser. This made the parser a large
  18499. bloated mess. Now, the parser is stripped down to a few
  18500. simple directives and macros are used to handle everything else.
  18501. 7/26/2001: cheetah (william fulton)
  18502. * Fixes for Sourceforge bug #444748 - new testcase cpp_static:
  18503. [TCL] Class with just static member variable/function fix
  18504. [Java] Fixed static variables support
  18505. [Ruby] Static variables workaround removed
  18506. 7/27/2001: mkoeppe
  18507. * stype.c (SwigType_default): Strip qualifiers first. The
  18508. default type of "int * const" is now "SWIGPOINTER *".
  18509. * main.cxx: Define "__cplusplus" in SWIG's preprocessor if
  18510. in C++ mode.
  18511. * [Guile]: Added some support for arrays and C++
  18512. references, fixing the "constant_pointers" test case.
  18513. * Moved most tests from the old Guile-specific test-suite
  18514. to the new test-suite. Also moved perl5/pointer-cxx
  18515. example there.
  18516. 7/26/2001: cheetah (william fulton)
  18517. * Test-suite added.
  18518. * Initial testcases: constant_pointers cpp_enum defines
  18519. sizeof_pointers unions virtual_destructor
  18520. * Make clean improvements.
  18521. 7/24/2001: cheetah (william fulton)
  18522. * [Java] Underscores in the package name and/or module name
  18523. no longer give linking problems.
  18524. 7/17/2001: cheetah (william fulton)
  18525. * More parser bug fixes for constant pointers
  18526. 7/19/2001: mkoeppe
  18527. * [Guile] Aesthetic improvement in variable wrappers.
  18528. 7/18/2001: beazley
  18529. * Fixed core-dump problem in pointer library when
  18530. freeing character arrays.
  18531. SF Bug [ #415837 ] pointer lib core dump
  18532. 7/18/2001: beazley
  18533. * Fixed problem with default destructors and shadow
  18534. classes. SF bug #221128.
  18535. 7/18/2001: beazley
  18536. * To provide better line-number tracking in interfaces
  18537. with lots of macros, special locator comments are
  18538. now generated by the SWIG preprocessor. For example:
  18539. /*@foo.i,42,BLAH@*/expanded macro/*@@*/
  18540. The first /*@...@*/ sequence sets the context
  18541. to point to the macro code. The /*@@*/ comment
  18542. terminates the context. The SWIG parser should
  18543. ignore all of the locator comments as should
  18544. the C compiler (should such comments end up
  18545. in generated wrapper code).
  18546. 7/18/2001: mkoeppe
  18547. * The parser now handles severely constified types in
  18548. typemaps. This introduced a new shift/reduce conflict, but
  18549. only with a heuristic function-pointer catch-all rule.
  18550. * [Guile]: Added typemaps for severely constified types.
  18551. * Fixed the "template-whitespace" problem by canonicalizing
  18552. whitespace, especially around angle brackets and commas.
  18553. 7/17/2001: mkoeppe
  18554. * [Guile]: A Scheme file is emitted if the -scmstub FILE.SCM
  18555. command-line option is used. The %scheme directive
  18556. (implemented as a macro for a pragma) allows to insert
  18557. arbitrary code here. In "simple" and "passive" linkage,
  18558. the file gets filled with define-module and export
  18559. declarations.
  18560. 7/17/2001: cheetah (william fulton)
  18561. * Parser bug fix to support constant pointers, eg int* const ptr.
  18562. Fixed everywhere - variables, parameters, return types etc. Note that
  18563. when wrapping a constant pointer variable only the getter is generated.
  18564. 7/17/2001: mkoeppe
  18565. * Fixed SF bug #441470 (#define X "//" would not be parsed,
  18566. see test-suite entry "preproc-1"), reported by T. W. Burton
  18567. <twburton@users.sf.net>.
  18568. * Changed the type of character constants to "char", rather
  18569. than "char *". Changed the individual language modules
  18570. to keep the old behaviour, except for the Guile module,
  18571. where it is desired to make them Scheme characters. This
  18572. fixes SF bug #231409, test-suite entry "char-constant".
  18573. * Applied patch for DOH/Doh/memory.c by Les Schaffer
  18574. <schaffer@optonline.net> (avoid required side effects in
  18575. assert).
  18576. 7/17/2001: cheetah (william fulton)
  18577. * Bug fix in parser for virtual destructor with void as parameter
  18578. * Bug fix in parser #defines embedded within classes/structs/unions
  18579. Consequently %constant can now also be placed within a struct/class/union.
  18580. * Bug fix in parser to allow sizeof(*I_am_a_pointer) within a #define
  18581. 7/16/2001: mkoeppe
  18582. * Added changes for the Macintosh contributed by Luigi
  18583. Ballabio <ballabio@mac.com>.
  18584. * Some "const" fixes in the code.
  18585. * [Guile]: Made the constant-wrapper functions much shorter.
  18586. 7/13/2001: mkoeppe
  18587. * [Guile]: Some "const" fixes for Guile version 1.3.4.
  18588. * Handle anonymous arguments with default values and static
  18589. array members of classes. Both bugs reported by Annalisa Terracina
  18590. <annalisa.terracina@datamat.it>; see the files
  18591. Examples/guile/test-suite/static-array-member.i and
  18592. anonymous-arg.i.
  18593. Version 1.3.6 (July 9, 2001)
  18594. =============================
  18595. 7/09/2001: cheetah (william fulton)
  18596. * GIFPlot examples: FOREGROUND and BACKGROUND definition missing
  18597. after TRANSPARENT #define fix in GIFPlot
  18598. 7/03/2001: beazley
  18599. Fixed up the version numbers so that the release is known
  18600. as 1.3.6. All future releases should have a similar
  18601. version format.
  18602. 7/02/2001: mkoeppe
  18603. * [Python]: Prevent the problem of self.thisown not being
  18604. defined if the C++ class constructor raised an exception.
  18605. Thanks to Luigi Ballabio <ballabio@mac.com>.
  18606. 6/29/2001: mkoeppe
  18607. * More portability fixes; fixed "gcc -Wall" warnings.
  18608. 6/29/2001: cheetah (william fulton)
  18609. * GIFPlot examples: TRANSPARENT #define multiple times on Solaris
  18610. (clashes with stream.h).
  18611. * Multiple definition bug fix for shadow classes. The perl and python
  18612. modules had workarounds which have been replaced with fixes in
  18613. the core. Many of the Language::cpp_xxxx functions now set a
  18614. flag which the derived classes can access through
  18615. is_multiple_definition() to see whether or not code should be
  18616. generated. The code below would have produced varying degrees
  18617. of incorrect shadow class code for the various modules:
  18618. class TestClass
  18619. {
  18620. public:
  18621. TestClass() {}
  18622. TestClass(int a) {}
  18623. ~TestClass() {}
  18624. unsigned long xyz(short k) {}
  18625. unsigned long xyz(int n) {}
  18626. static void static_func() {}
  18627. static void static_func(int a) {}
  18628. };
  18629. void delete_TestClass(int a);
  18630. 6/27/2001: mkoeppe
  18631. * [Perl] Another const-related portability fix.
  18632. 6/26/2001: cheetah (william fulton)
  18633. * [Java] Added in cpp_pragma() support with a host of new pragmas - see
  18634. jswig.html. These are designed for better mixing of Java and c++. It
  18635. enables the user to specify pure Java classes as bases and/or interfaces
  18636. for the wrapped c/c++.
  18637. * [Java] Old pragmas renamed. Warning given for the moment if used.
  18638. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  18639. 6/25/2001: mkoeppe
  18640. * Incorporated more build changes contributed by Wyss Clemens
  18641. <WYS@helbling.ch> for swig/ruby on cygwin.
  18642. 6/20/2001: cheetah (william fulton)
  18643. * Makefile mods so that 'make check' uses the swig options in the makefiles
  18644. * [Java] Removed Generating wrappers message
  18645. * [Java] NULL pointer bug fix
  18646. * [Java] Bug fix for Kaffe JVM
  18647. 6/20/2001: mkoeppe
  18648. * SWIG_TypeQuery from common.swg now returns a
  18649. swig_type_info* rather than a void*. This fixes a problem
  18650. when using pointer.i and C++, as illustrated by the new
  18651. test-suite example perl5/pointer-cxx.
  18652. * Portability fixes (const char *).
  18653. * Incorporated build changes contributed by Wyss Clemens
  18654. <WYS@helbling.ch>, which make swig runnable on cygwin.
  18655. 6/19/2001: cheetah (william fulton)
  18656. * [Java] Bug fix for SF bug #211144. This fix is a workaround
  18657. until fixed in the core.
  18658. 6/19/2001: mkoeppe
  18659. * [Guile]: Portability fixes for use with the Sun Forte
  18660. compilers.
  18661. * [Tcl]: Portability fix (const char *).
  18662. * [Tcl]: Configure now first tries to find a tclConfig.sh
  18663. file in order to find the Tcl include directory, library
  18664. location and library name.
  18665. * [Python]: Added a few possible library locations.
  18666. 6/18/2001: mkoeppe
  18667. * [Guile]: Don't call scm_c_export if nothing is to be
  18668. exported. Don't warn on %module if module has been set
  18669. already (this frequently occurs when %import is used).
  18670. 6/16/2001: mkoeppe
  18671. * [Guile]: New "passive" linkage, which is appropriate for
  18672. multi-module extensions without Guile module magic.
  18673. 6/15/2001: mkoeppe
  18674. * [Guile]: Fixed printing of smobs (space and angle were
  18675. missing).
  18676. * Properly generate type information for base classes
  18677. imported with the %import directive. Thanks to Marcelo
  18678. Matus <mmatus@acms.arizona.edu> for the report and the
  18679. patch; this closes SF bug #231619; see also
  18680. Examples/guile/test-suite/import*.
  18681. * [Guile]: Fix casting between class and base class; the
  18682. runtime type system had it the wrong way around; see
  18683. Examples/guile/test-suite/casts.i
  18684. * Make typemaps for SWIGPOINTER * with arg name take
  18685. precedence over those without arg name, to match normal
  18686. typemap precedence rules.
  18687. * Fixed the random-line-numbers problem reported as SF bug
  18688. #217310; thanks to Michael Scharf <scharf@users.sf.net>.
  18689. * [Guile]: Handle the %name and %rename directives.
  18690. * New syntax: %name and %rename now optionally take double
  18691. quotes around the scripting name. This is to allow scripting
  18692. names that aren't valid C identifiers.
  18693. 6/14/2001: beazley
  18694. Made a minor change to the way files are loaded in
  18695. order to get file/line number reporting correct in
  18696. the preprocessor.
  18697. 6/14/2001: mkoeppe
  18698. * The parser now understands the (non-standard) "long long"
  18699. types. It is up to the individual language modules to
  18700. provide typemaps if needed. Reported by Sam Steingold, SF
  18701. bug #429176.
  18702. * The parser now understands arguments like "const int *
  18703. const i". This fixes SF bug #215649.
  18704. * Fixed the Guile test-suite.
  18705. 6/13/2001: mkoeppe
  18706. Partial merge from the CVS trunk at tag
  18707. "mkoeppe-merge-1". This covers the following changes:
  18708. | 01/16/01: ttn
  18709. | Wrote table of contents for Doc/engineering.html. Added section
  18710. | on CVS tagging conventions. Added copyright to other docs.
  18711. | 9/25/00 : beazley
  18712. | Modified the preprocessor so that macro names can start with a '%'.
  18713. | This may allow new SWIG "directives" to be defined as macros instead
  18714. | of having to be hard-coded into the parser.
  18715. |
  18716. | *** Also a yet-to-be-documented quoting mechanism with backquotes
  18717. | *** has been implemented?
  18718. 6/13/2001: mkoeppe
  18719. * When configure does not find a language, don't use default
  18720. paths like /usr/local/include; this only causes build
  18721. problems.
  18722. * New directory: Examples/Guile/test-suite, where a few
  18723. bugs in 1.3a5 are demonstrated.
  18724. * Handle C++ methods that have both a "const" and a "throw"
  18725. directive (see Examples/Guile/test-suite/cplusplus-throw.i);
  18726. thanks to Scott B. Drummonds for the report and the fix.
  18727. * Handle C++ pointer-reference arguments (like "int *& arg")
  18728. (see Examples/Guile/test-suite/pointer-reference.i,
  18729. reported as SF bug #432224).
  18730. * [Ruby] Fixed typo in rubydec.swg; thanks to Lyle Johnson!
  18731. * Don't stop testing when one test fails.
  18732. * [Guile, MzScheme] Don't print "Generating wrappers...".
  18733. 6/12/2001: mkoeppe
  18734. [Guile] VECTORLENINPUT and LISTLENINPUT now have separate
  18735. list length variables. TYPEMAP_POINTER_INPUT_OUTPUT
  18736. attaches argument documentation involving SCM_TYPE to the
  18737. standard pointer typemaps. INOUT is now an alias for BOTH.
  18738. 6/12/2001: cheetah (william fulton)
  18739. Some Java documentation added.
  18740. [Java] Fixed bugs in import pragma and shadow pragma.
  18741. 6/12/2001: mkoeppe
  18742. Fix declarations of SWIG_define_class
  18743. (Lib/ruby/rubydec.swg) and SWIG_TypeQuery
  18744. (Lib/common.swg). Thanks to Lyle Johnson
  18745. <ljohnson@resgen.com> for the patches.
  18746. 6/11/2001: mkoeppe
  18747. [Guile] Use long instead of scm_bits_t; this makes the
  18748. generated wrapper code compatible with Guile 1.3.4
  18749. again. Thanks to Masaki Fukushima for pointing this out.
  18750. 6/11/2001: cheetah (william fulton)
  18751. The generic INSTALL file from autoconf added. Few changes to README file.
  18752. 6/11/2001: mkoeppe
  18753. Fixed typo in Makefile.in; thanks to Greg Troxel
  18754. <gdt@ir.bbn.com>.
  18755. 6/08/2001: cheetah (william fulton)
  18756. make check works again. Examples/GIFPlot configure generated by
  18757. top level autoconf now.
  18758. 6/08/2001: mkoeppe
  18759. Another build change: The new script autogen.sh runs
  18760. autoconf in the appropriate directories. The top-level
  18761. configure also configures in Examples/GIFPlot.
  18762. 6/07/2001: mkoeppe
  18763. Made the Makefile work with non-GNU make again.
  18764. 6/07/2001: cheetah (william fulton)
  18765. [Java] Class/struct members that are arrays of pointers to classes/structs -
  18766. Shadow class's get/set accessors now use Java classes instead of longs (pointers).
  18767. [Java] Shadow classes will now clean up memory if function return type
  18768. is a class/struct.
  18769. [Java] New example called reference based on the same example from other modules.
  18770. 6/06/2001: mkoeppe
  18771. New configure option --with-release-suffix allows for
  18772. attaching a suffix to the swig binary and the swig runtime
  18773. libraries. Minor changes to the build system. "swig
  18774. -swiglib" works again. If invoked with the new option
  18775. "-ldflags", SWIG prints a line of linker flags needed to
  18776. link with the runtime library of the selected language
  18777. module.
  18778. 6/06/2001: mkoeppe
  18779. [Guile] gswig_list_p is an int, not a SCM. This typo
  18780. caused warnings when compiling with a Guile configured with
  18781. strict C type checking. In INPUT and BOTH typemaps
  18782. generated by the SIMPLE_MAP macro, use the SCM_TO_C
  18783. function to convert from Guile to C (rather than C_TO_SCM).
  18784. Use scm_intprint to print pointers (rather than
  18785. sprintf). Allow using "-linkage" instead of "-Linkage".
  18786. 6/05/2001: cheetah (william fulton)
  18787. [Java] Mods for using inherited c++ classes from Java
  18788. [Java] New example called class based on the same example from other modules
  18789. 6/05/2001: cheetah (william fulton)
  18790. [Java] destructor (_delete()) was not aware of %name renaming
  18791. [Java] extends baseclass did not know about %name renaming
  18792. [Java] extends baseclass did extend even when the baseclass was not known to swig
  18793. [Java] sometimes enum-declarations occurred before the Java class declaration
  18794. [Java] unrelated enum initialisations no longer appear in Java class
  18795. [Java] if module ends in '_' correct JNI names are now produced
  18796. 6/04/2001: cheetah (william fulton)
  18797. [Java] Shadow class mods - Modified constructor replaces
  18798. newInstance(). _delete() now thread safe. getCPtr() replaces
  18799. _self. _selfClass() removed as now redundant.
  18800. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  18801. [Java] Not all output java files had SWIG banner. New banner.
  18802. [Java] Shadow class finalizers are output by default: Command
  18803. line option -finalize deprecated and replaced with -nofinalize.
  18804. *** POTENTIAL INCOMPATIBILITY FOR JAVA MODULE ***
  18805. 6/ 1/2001: mkoeppe
  18806. [Guile] Cast SCM_CAR() to scm_bits_t before shifting it.
  18807. This is required for compiling with a Guile configured with
  18808. strict C type checking.
  18809. 6/ 1/2001: mkoeppe
  18810. Added configure option "--with-swiglibdir".
  18811. 5/31/2001: mkoeppe
  18812. [Guile] Support multiple parallel lists or vectors in
  18813. the typemaps provided by list-vector.i. New typemaps file,
  18814. pointer-in-out.i.
  18815. 5/25/2001: cheetah (william fulton)
  18816. [Java] HTML update for examples.
  18817. 5/28/2001: mkoeppe
  18818. Minor changes to the build system. Added subdirectory for
  18819. Debian package control files.
  18820. 5/28/2001: mkoeppe
  18821. [Guile] Build a runtime library, libswigguile.
  18822. 5/28/2001: mkoeppe
  18823. [Guile] New typemap substitution $*descriptor. Use the {}
  18824. syntax, rather than the "" syntax for the standard
  18825. typemaps, in order to work around strange macro-expansion
  18826. behavior of the SWIG preprocessor. This introduces some
  18827. extra braces.
  18828. 5/27/2001: mkoeppe
  18829. [Guile] Handle pointer types with typemaps, rather than
  18830. hard-coded. New typemap substitutions $descriptor,
  18831. $basedescriptor; see documentation. Some clean-up in the
  18832. variable/constants wrapper generator code. New convenience
  18833. macro SWIG_Guile_MustGetPtr, which allows getting pointers
  18834. from smobs in a functional style. New typemap file
  18835. "list-vector.i", providing macros that define typemaps for
  18836. converting between C arrays and Scheme lists and vectors.
  18837. 5/25/2001: cheetah (william fulton)
  18838. [Java] STL string moved into its own typemap as it is c++ code and
  18839. it break any c code using the typemaps.i file.
  18840. - Fixes for wrappers around global variables - applies to primitive
  18841. types and user types (class/struct) and pointers to these.
  18842. - Structure member variables and class public member variables getters
  18843. and setters pass a pointer to the member as was in 1.3a3 and 1.1
  18844. (1.3a5 was passing by value)
  18845. - Parameters that were arrays and return types were incorrectly
  18846. being passed to create_function() as pointers.
  18847. - Fix for arrays of enums.
  18848. [Java] Updated java examples and added two more.
  18849. [Java] Java module updated from SWIG1.3a3 including code cleanup etc.
  18850. [Java] enum support added.
  18851. [Java] Array support implemented
  18852. [Java] Shadow classes improved - Java objects used rather than
  18853. longs holding the c pointer to the wrapped structure/c++class
  18854. 5/22/2001: mkoeppe
  18855. [Guile] Fixed extern "C" declarations in C++ mode. Thanks
  18856. to Greg Troxel <gdt@ir.bbn.com>.
  18857. 5/21/2001: mkoeppe
  18858. [Guile] New linkage "module" for creating Guile modules for
  18859. Guile versions >= 1.5.0.
  18860. 4/18/2001: mkoeppe
  18861. [MzScheme] Added typemaps for passing through Scheme_Object
  18862. pointers.
  18863. 4/9/2001 : mkoeppe
  18864. [MzScheme] Added typemaps for `bool'. Inclusion of headers
  18865. and support routines is now data-driven via mzscheme.i.
  18866. Headers come from the new file mzschemdec.swg. Don't abort
  18867. immediately when a type-handling error is reported. When
  18868. searching for typemaps for enums, fall back to using int,
  18869. like the Guile backend does. Support char constants. Emit
  18870. correct wrapper code for variables.
  18871. 3/12/2001: mkoeppe
  18872. [Guile] Fixed typemaps for char **OUTPUT, char **BOTH.
  18873. 3/2/2001 : mkoeppe
  18874. [Guile] Every wrapper function now gets a boolean variable
  18875. gswig_list_p which indicates whether multiple values are
  18876. present. The macros GUILE_APPEND_RESULT, GUILE_MAYBE_VALUES
  18877. and GUILE_MAYBE_VECTOR use this variable, rather than
  18878. checking whether the current return value is a list. This
  18879. allows for typemaps returning a list as a single value (a
  18880. list was erroneously converted into a vector or a
  18881. multiple-value object in this case).
  18882. 3/1/2001 : mkoeppe
  18883. [Guile] Added support for returning multiple values as
  18884. vectors, or passing them to a muliple-value
  18885. continuation. By default, multiple values still get
  18886. returned as a list.
  18887. 3/1/2001 : mkoeppe
  18888. [Guile] Added a "beforereturn" pragma. The value of this
  18889. pragma is inserted just before every return statement.
  18890. 3/1/2001 : mkoeppe
  18891. [Guile] Added support for Guile 1.4.1 procedure
  18892. documentation formats, see internals.html.
  18893. 2/26/2001: mkoeppe
  18894. [Guile] Made the wrapper code compile with C++ if the
  18895. "-c++" command-line switch is given. Thanks to
  18896. <monkeyiq@dingoblue.net.au>.
  18897. 2/26/2001: mkoeppe
  18898. [Guile] Now two type tables, swig_types and
  18899. swig_types_initial, are used, as all other SWIG language
  18900. modules do. This removes the need for the tricky
  18901. construction used before that the broken Redhat 7.0 gcc
  18902. doesn't parse. Reported by <monkeyiq@dingoblue.net.au>.
  18903. 2/26/2001: mkoeppe
  18904. [Guile] Fixed typemaps for char *OUTPUT, char *BOTH; a bad
  18905. free() would be emitted. Added typemap for SCM.
  18906. Version 1.3 Alpha 5
  18907. ===================
  18908. 9/19/00 : beazley
  18909. [Python] Python module generates more efficient code for
  18910. creating the return value of a wrapper function. Modification
  18911. suggested by Jon Travis.
  18912. 9/19/00 : beazley
  18913. Library files specified with the -l option are now included at the
  18914. end of the interface file (reverting to the old behavior).
  18915. 9/19/00 : beazley
  18916. Fixed some problems with enum handling. enums are now manipulated as
  18917. 'int', but cast into the enum type when values are passed to the
  18918. corresponding C function.
  18919. 9/19/00 : mkoeppe
  18920. [Guile] Removed "-with-smobs" command-line option, as this is the
  18921. default now. Added "-emit-setters" command-line option,
  18922. which turns on generating procedures-with-setters; see
  18923. internals.html.
  18924. 9/18/00 : mkoeppe
  18925. Incorporated patch #101430, fixing bugs in the Guile module:
  18926. 1. Some arguments were erroneously taken as *optional* arguments when
  18927. ignored arguments were present.
  18928. 2. Guile 1.3.4 was not supported since functions introduced in Guile
  18929. 1.4 were used.
  18930. 3. Added handling of `const char *'.
  18931. 9/17/00 : beazley
  18932. Fixed problem with failed assertion and large files.
  18933. 9/17/00 : beazley
  18934. Fixed problem with the '%' character appearing in added methods
  18935. and function bodies. Preprocessor bug.
  18936. Version 1.3 Alpha 4 (September 4, 2000)
  18937. =======================================
  18938. 9/3/00 : ttn
  18939. Added instructions for maintainers in Examples/README on how
  18940. to make examples also be useful in the testing framework.
  18941. Also, "make check" now uses ./Lib by via env var `SWIG_LIB'.
  18942. This is overridable like so:
  18943. make chk-swiglib=/my/experimental/swig/Lib check
  18944. 9/3/00 : beazley
  18945. Added $typemap variable to typemaps. This gets replaced with
  18946. a string indicating the typemap that is applied. Feature
  18947. request from rsalz.
  18948. 9/3/00 : beazley
  18949. Experimental optimization to code generation for virtual
  18950. member functions. If you have two classes like this:
  18951. class A() {
  18952. virtual void foo();
  18953. }
  18954. class B() : public A {
  18955. virtual void foo();
  18956. }
  18957. Swig now will generate a single wrapper function for this
  18958. A_foo(A *a) {
  18959. a->foo();
  18960. }
  18961. and use it as the implementation of both A_foo() and B_foo().
  18962. This optimization only takes place if both methods are declared
  18963. as virtual and both take identical parameters.
  18964. *** EXPERIMENTAL FEATURE ***
  18965. 9/3/00 : beazley
  18966. Restored the "memberin" typemap for setting structure members.
  18967. Unlike the old version, the new version is expanded inline in the
  18968. wrapper function allowing access to scripting language
  18969. internals (a sometimes requested feature). The "memberout" typemap
  18970. is gone. Use the "out" typemaps instead.
  18971. *** POTENTIAL INCOMPATIBILITY ***
  18972. 9/3/00 : beazley
  18973. Attribute set methods no longer return the value of a member.
  18974. For example:
  18975. struct Foo {
  18976. int x;
  18977. ...
  18978. }
  18979. now gets set as follows:
  18980. void Foo_x_set(Foo *f, int x) {
  18981. f->x = x;
  18982. }
  18983. In SWIG1.1 it used to be this:
  18984. int Foo_x_set(Foo *f, int x) {
  18985. return (f->x = x);
  18986. }
  18987. This has been changed due to the complexity created by trying
  18988. to do this with more exotic datatypes such as arrays. It also
  18989. complicates inlining and handling of the "memberin" typemap.
  18990. *** POTENTIAL INCOMPATIBILITY ***
  18991. 9/2/00 : beazley
  18992. Removed the ptrcast() and ptrmap() functions from the
  18993. pointer.i library file. Old implementation is incompatible
  18994. with new type system.
  18995. *** POTENTIAL INCOMPATIBILITY ***
  18996. 9/2/00 : beazley
  18997. New runtime function SWIG_TypeQuery(const char *name) added.
  18998. This function can be used to extract the type info structure
  18999. that is used for type-checking. It works with either the
  19000. nice C name or mangled version of a datatype. For example:
  19001. swig_type_info *ty = Swig_TypeQuery("int *");
  19002. swig_type_info *ty = Swig_TypeQuery("_p_int");
  19003. This is an advanced feature that has been added to support some
  19004. exotic extension modules that need to directly manipulate
  19005. scripting language objects.
  19006. *** NEW FEATURE ***
  19007. 9/2/00 : beazley
  19008. New directive %types() added. This is used to
  19009. explicitly list datatypes that should be included in
  19010. the runtime type-checking code. Normally it is never
  19011. necessary to use this but sometimes advanced extensions
  19012. (such as the pointer.i library) may need to manually
  19013. add types to the type-checker.
  19014. *** NEW FEATURE ***
  19015. 8/31/00 : beazley
  19016. Improved handling of string array variables. For example,
  19017. a global variable of the form "char name[64]" is automatically
  19018. managed as a 64 character string. Previously this didn't
  19019. work at all or required the use of a special typemap.
  19020. *** NEW FEATURE (Tcl, Perl, Python) ***
  19021. 8/31/00 : ttn
  19022. Added Makefile target `check-c++-examples', which uses new
  19023. files under Examples/C++ contributed by Tal Shalif. Now "make
  19024. check" also does "make check-c++-examples". Also, expanded
  19025. actions in `check-gifplot-example' and `check-aliveness'.
  19026. 8/30/00 : mkoeppe
  19027. Major clean-up in the Guile module. Added typemap-driven
  19028. documentation system. Changed to handle more than 10
  19029. args. Updated and extended examples.
  19030. *** NEW FEATURE ***
  19031. 8/29/00 : beazley
  19032. Added new %insert directive that inserts the contents of a file
  19033. into a portion of the output wrapper file. This is only intended
  19034. for use by writers of language modules. Works as follows:
  19035. %insert(headers) "file.swg";
  19036. %insert(runtime) "file.swg";
  19037. %insert(wrappers) "file.swg";
  19038. %insert(init) "file.swg";
  19039. *** NEW FEATURE ***
  19040. 8/29/00 : beazley
  19041. Added new %runtime directive which includes code into the runtime
  19042. portion of the wrapper code. For example:
  19043. %runtime %{
  19044. ... some internal runtime code ...
  19045. %}
  19046. There is no practical reason for ordinary users to use this
  19047. feature (almost everything can be done using %{ ... %}
  19048. instead). However, writers of language modules may want to
  19049. use this in language configuration files.
  19050. *** NEW FEATURE ***
  19051. 8/28/00 : beazley
  19052. Typemaps can now be specified using string literals like
  19053. this:
  19054. %typemap(in) int "$target = SvIV($source);"
  19055. When code is specified like this, it is *NOT* enclosed
  19056. inside a local scope (as with older typemap declarations).
  19057. Note: character escape sequences are interpreted in the
  19058. code string so if you want to include a quote or some
  19059. other special character, make sure you use a (\).
  19060. *** NEW FEATURE ***
  19061. 8/27/00 : beazley
  19062. Typemaps have been modified to follow typedef declarations.
  19063. For example, if you have this:
  19064. typedef int Number;
  19065. %typemap(in) int {
  19066. ... get an integer ...
  19067. }
  19068. void foo(Number a);
  19069. The typemap for 'int' will be applied to the argument 'Number a'.
  19070. Of course, if you specify a typemap for 'Number' it will take
  19071. precedence (nor will it ever be applied to an 'int').
  19072. *** POTENTIAL INCOMPATIBILITY ***
  19073. 8/27/00 : beazley
  19074. Default typemap specification has changed. In older
  19075. versions of swig, you could do this:
  19076. %typemap(in) int SWIG_DEFAULT_TYPE {
  19077. ...
  19078. }
  19079. To specify the default handling of a datatype. Now that
  19080. SWIG follows typedef declarations, this is unnecessary.
  19081. Simply specifying a typemap for 'int' will work for all
  19082. variations of integers that are typedef'd to 'int'.
  19083. Caveat, specifying the default behavior for pointers,
  19084. references, arrays, and user defined types is a little
  19085. different. This must be done as follows:
  19086. %typemap() SWIGPOINTER * {
  19087. ... a pointer ...
  19088. }
  19089. %typemap() SWIGREFERENCE & {
  19090. ... a reference ...
  19091. }
  19092. %typemap() SWIGARRAY [] {
  19093. ... an array ...
  19094. }
  19095. %typemap() SWIGTYPE {
  19096. ... a user-defined type (by value) ...
  19097. }
  19098. *** POTENTIAL INCOMPATIBILITY ***
  19099. 8/15/00 : dustin
  19100. The file swig-1.3a1-1.spec has been added to the Tools directory.
  19101. It can be used to build a redhat package for SWIG, although it
  19102. will need to be updated for the next public release.
  19103. 8/15/00 : beazley
  19104. Typemaps have been completely rewritten. Eventually they may be
  19105. replaced with something better, but for now they stay. However,
  19106. there are a number of a significant changes that may trip some
  19107. people up:
  19108. 1. Typemap scoping is currently broken. Because of this, the
  19109. following code won't work.
  19110. %typemap(in) blah * {
  19111. ...
  19112. }
  19113. class Foo {
  19114. ...
  19115. int bar(blah *x);
  19116. }
  19117. %typemap(in) blah *; /* Clear typemap */
  19118. (this breaks because the code for the class Foo is actually
  19119. generated after the entire interface file has been processed).
  19120. This is only a temporary bug.
  19121. 2. In SWIG1.1, the %apply directive worked by performing a
  19122. very complex type-aliasing procedure. From this point on,
  19123. %apply is simply a generalized typemap copy operation.
  19124. For example,
  19125. %apply double *OUTPUT { double *x, double *y };
  19126. Copies *ALL* currently defined typemaps for 'double *OUTPUT' and
  19127. copies them to 'double *x' and 'double *y'.
  19128. Most people probably won't even notice this change in
  19129. %apply. However, where it will break things is in code like
  19130. this:
  19131. %apply double *OUTPUT { double *x };
  19132. %typemap(in) double *OUTPUT {
  19133. ... whatever ...
  19134. }
  19135. void foo(double *x);
  19136. In SWIG1.1, you will find that 'foo' uses the 'double *OUTPUT' rule
  19137. even though it was defined after the %apply directive (this is
  19138. the weird aliasing scheme at work). In SWIG1.3 and later,
  19139. the 'double *OUTPUT' rule is ignored because it is defined
  19140. after the %apply directive.
  19141. 3. The %clear directive has been modified to erase all currently
  19142. defined typemaps for a particular type. This differs from
  19143. SWIG1.1 where %clear only removed rules that were added using
  19144. the %apply directive.
  19145. 4. Typemap matching is now performed using *exact* types.
  19146. This means that things like this
  19147. %typemap(in) char * { }
  19148. %typemap(in) const char * { }
  19149. are different typemaps. A similar rule applies for pointers,
  19150. arrays, and references. For example:
  19151. %typemap(in) double * { }
  19152. used to apply to 'double &', 'double []', Now, it only applies
  19153. to 'double *'. If you want a 'double &', you'll need to handle
  19154. that separately.
  19155. 5. Array matching has been simplfied. In SWIG1.1, array matching
  19156. was performed by trying various combinations of dimensions.
  19157. For example, 'double a[10][20]' was matched as follows:
  19158. double [10][20]
  19159. double [ANY][20]
  19160. double [10][ANY]
  19161. double [ANY][ANY]
  19162. In SWIG1.3, only the following matches are attempted:
  19163. double [10][20]
  19164. double [ANY][ANY]
  19165. On the positive side, typemap matching is now *significantly* faster
  19166. than before.
  19167. *** POTENTIAL INCOMPATIBILITY ***
  19168. 8/15/00 : beazley
  19169. Secret developer feature. Since datatypes are now represented as
  19170. strings internally, you can bypass limitations of the parser and
  19171. create a wild datatype by simply enclosing the raw string encoding
  19172. in backticks (``) and sticking it in the interface file anywhere a
  19173. type is expected. For example, `a(20).a(10).p.f(int,int)`. This
  19174. feature is only intended for testing (i.e., you want to see what
  19175. happens to your language module if it gets a reference to a pointer
  19176. to an array of pointers to functions or something).
  19177. *** SICK HACK ***
  19178. 8/14/00 : beazley
  19179. Completely new type-system added to the implementation.
  19180. More details later.
  19181. 8/11/00 : beazley
  19182. Cleaned up some of the I/O handling. SWIG no longer generates
  19183. any temporary files such as _wrap.wrap, _wrap.ii, _wrap.init.
  19184. Instead, these "files" are kept around in memory as strings
  19185. (although this is transparent to language modules).
  19186. 8/4/00 : ttn
  19187. Added Makefile target "check" and variants.
  19188. This can be used like "make check" or, to explicitly skip a
  19189. language LANG: "make skip-LANG=true check". LANG is skipped
  19190. automatically if ./configure determines that LANG support is
  19191. insufficient.
  19192. Currently, the check is limited to doing the equivalent of
  19193. "make all" in some of the Examples directories. This should
  19194. be expanded both horizontally (different types of tests) and
  19195. vertically (after "make all" in an Examples subdir succeeds,
  19196. do some additional tests with the resulting interpreter, etc).
  19197. 8/4/00 : ttn
  19198. Added Makefile target "distclean", which deletes all the
  19199. files ./configure creates, including config.status and friends.
  19200. 8/3/00 : harcoh
  19201. java changes??? [todo: document changes]
  19202. 7/23/00 : beazley
  19203. Typemaps have been modified to key off of the real datatypes
  19204. used in the interface file. This means that typemaps for
  19205. "const char *" and "char *" will be difference as will typemaps
  19206. for "Vector" and "Vector *."
  19207. *** POTENTIAL INCOMPATIBILITY ***
  19208. This is likely to break interfaces that rely on the odd type
  19209. handling behavior of typemaps in SWIG1.1--especially with
  19210. respect to interfaces involving pass-by-value.
  19211. 7/23/00 : beazley
  19212. New %constant directive. This directive can be used to
  19213. create true constants in the target scripting language.
  19214. It's most simple form is something like this:
  19215. %constant FOO 42;
  19216. In this case, the type is inferred from the syntax of the
  19217. value (in reality, all #define macros are translated into
  19218. directives of this form).
  19219. An expanded version is as follows:
  19220. %constant(Foo *) FOO = &FooObj;
  19221. In this case, an explicit type can be specified. This
  19222. latter form may be useful for creating constants that
  19223. used to be specified as
  19224. const Foo *FOO = &FooObj;
  19225. (which are now treated as variables).
  19226. *** EXPERIMENTAL FEATURE *** The syntax may change in
  19227. the final release.
  19228. 7/23/00 : beazley
  19229. Modified the parser so that variable declarations of the form
  19230. "const type *a" are handled as variables, not constants.
  19231. Note: SWIG1.1 handled this case erroneously because
  19232. const char *a is a pointer variable that can be reassigned.
  19233. *** POTENTIAL INCOMPATIBILITY ***
  19234. Note: just because this is the "right" way to do things,
  19235. doesn't mean it's the most appropriate interpretation.
  19236. I suspect that many C programmers might use 'const char *'
  19237. with the intent of creating a constant, without realizing
  19238. that they've created a reassignable global variable.
  19239. 7/23/00 : beazley
  19240. The C/C++ wrapping layer has been completely redesigned and
  19241. reimplemented. This change should iron out a few rough
  19242. spots with the handling of datatypes. In addition, the
  19243. wrapper code is somewhat cleaner.
  19244. *** POTENTIAL INCOMPATIBILITY ***
  19245. This change may break interfaces that involve
  19246. subtle corner-cases with typemaps and the %addmethods
  19247. directive since some of these features had somewhat
  19248. type handling behavior in SWIG1.1.
  19249. 7/23/00 : beazley
  19250. The "memberin" and "memberout" typemaps are gone for the
  19251. moment, but they might return as soon as I figure out
  19252. how to integrate them with some of the streamlined C wrapper
  19253. functions.
  19254. *** POTENTIAL INCOMPATIBILITY ***
  19255. 7/22/00 : beazley
  19256. A variety of old type handling functions such as print_type(),
  19257. print_full(), print_mangle(), etc... are gone and have been
  19258. replaced with a smaller set of functions. See the file
  19259. Doc/internals.html for details. This will break all third
  19260. party language modules.
  19261. *** POTENTIAL INCOMPATIBILITY ***
  19262. 7/20/00 : beazley
  19263. Deprecated the %val and %out directives. These directives
  19264. shouldn't really be necessary since typemaps can be used
  19265. to achieve similar results. This also cleans up the
  19266. handling of types and parameters quite a bit.
  19267. *** POTENTIAL INCOMPATIBILITY ***
  19268. 7/20/00 : ttn
  19269. Fixed unspecified-module bug in Guile support and removed
  19270. more non-"with-smobs" functionality using patches submitted
  19271. by Matthias Koeppe.
  19272. Re-enable recognition of "-with-smobs" (with no effect since
  19273. we use smobs by default now) for the time being. After the
  19274. 1.3a4 release, this option will signal an error.
  19275. 7/17/00 : ttn
  19276. Fixed NULL-input bug in parameter list handling.
  19277. Reported by Matthias Koeppe.
  19278. 7/12/00 : beazley
  19279. Fixed memory leak in Python type-checking code. Reported by
  19280. Keith Davidson. Bug #109379.
  19281. 7/10/00 : beazley
  19282. Changed internal data structures related to function parameters.
  19283. 7/10/00 : beazley
  19284. Fixed some bugs related to the handling of the %name() directive
  19285. and classes in the Tcl module. Problem reported by James Bailey.
  19286. 7/10/00 : beazley
  19287. Fixed parsing and enum handling problems with character constants.
  19288. Reported by Greg Kochanski.
  19289. 7/10/00 : beazley
  19290. Removed WrapperFunction class from the core and updated the language
  19291. module. This will break third party modules.
  19292. *** POTENTIAL INCOMPATIBILITY ***
  19293. 7/9/00 : beazley
  19294. Implementation of SWIG no longer makes use of C++ operator overloading.
  19295. This will almost certainly break *all* third party language modules
  19296. that are not part of the main SWIG CVS tree. Sorry.
  19297. *** POTENTIAL INCOMPATIBILITY ***
  19298. 7/8/00 : beazley
  19299. Removed the experimental and undocumented "build" typemap that
  19300. was intended to work with multiple arguments. Simply too weird
  19301. to keep around. Besides, a better replacement is in the works.
  19302. 7/6/00 : ttn
  19303. Removed non-"with-smobs" functionality (Guile support), i.e.,
  19304. "-with-smobs" is now the default and no longer needs to be
  19305. specified on the command-line.
  19306. 7/5/00 : ttn
  19307. Incorporated Ruby support contributed by Masaki Fukushima.
  19308. 6/28/00 : ttn
  19309. Applied more-than-10-args bugfix patch contributed
  19310. by Matthias Koeppe.
  19311. 6/27/00 : beazley
  19312. Rewrote some of the string handling and eliminated the C++
  19313. implementation (which is now just a wrapper).
  19314. 6/27/00 : ttn
  19315. Added Doc/index.html and Doc/internals.html. The target
  19316. audience for the latter is new SWIG developers.
  19317. Version 1.3 Alpha 3 (June 18, 2000)
  19318. ===================================
  19319. 6/18/00 : beazley
  19320. Removed the naming.cxx, hash.cxx, and symbol.cxx files from
  19321. the SWIG1.1 directory. Continued to migrate things away
  19322. from the C++ base (although there's still a lot of work to do).
  19323. 6/17/00 : beazley
  19324. Added a few more examples to the Examples directory. Still
  19325. need to do a lot of work on this.
  19326. 6/16/00 : beazley
  19327. Added -includeall to follow all #include statements in the
  19328. preprocessor.
  19329. 6/15/00 : beazley
  19330. Tried to fix as many C++ warnings as possible when compiling
  19331. with the Sun Workshop C++ compiler. Unfortunately, this means
  19332. that there are a lot of statements that contain string literals
  19333. of the form (char*)"Blah".
  19334. 6/15/00: beazley
  19335. A variety of cleanup and performance optimization in the
  19336. low-level DOH library. This seems to result in a speedup
  19337. of 50-100% for preprocessing and other related tasks.
  19338. 5/10/00 : ttn
  19339. Applied variable-wrapping bugfix patch contributed
  19340. by Matthias Koeppe.
  19341. 4/17/00 : ttn
  19342. Updated MzScheme support contributed by Oleg Tolmatcev.
  19343. We now use a `Scheme_Type'-based structure to wrap pointers.
  19344. 4/11/00 : ttn
  19345. Incorporated further Guile-support patch by Matthias Koeppe.
  19346. Typemaps previously deleted have been re-added. There is now
  19347. exception handling (see Doc/engineering.html). `SWIG_init' is now
  19348. declared extern only for simple linkage. Some bugs were fixed.
  19349. 4/06/00 : ttn
  19350. Incorporated MzScheme support contributed by Oleg Tolmatcev.
  19351. This includes new directories Lib/mzscheme and Examples/mzscheme.
  19352. 4/03/00 : ttn
  19353. Added Examples/guile and children. This is an adaptation of
  19354. the same-named directory from the SWIG-1.1p5 distribution.
  19355. Added Guile-specific section to Doc/engineering.html.
  19356. 4/02/00 : ttn
  19357. Incorporated new guilemain.i by Martin Froehlich.
  19358. Incorporated Guile-support rewrite patch by Matthias Koeppe.
  19359. The command line option "-with-smobs" enables implementation of
  19360. pointer type handling using smobs, the canonical mechanism for
  19361. defining new types in Guile. Previous implementation (using
  19362. strings) is at the moment still supported but deprecated. At
  19363. some point, "-with-smobs" will be the default and no longer
  19364. required.
  19365. 3/13/00 : beazley
  19366. Added purify patches submitted by Ram Bhamidipaty.
  19367. 3/02/00 : ttn
  19368. Added support for different Guile "linkage" schemes.
  19369. Currently, "-Linkage hobbit" works.
  19370. Version 1.3 Alpha 2 (March 1, 2000)
  19371. ===================================
  19372. 2/29/00 : beazley
  19373. Made SWIG ignore the 'mutable' keyword.
  19374. 2/29/00 : beazley
  19375. Incorporated some patches to the Perl5 module related to
  19376. the -hide option and the destruction of objects.
  19377. Patch submitted by Karl Forner.
  19378. 2/27/00 : ttn
  19379. Incorporated Guile support contributed by Matthias Koeppe.
  19380. This includes a cpp macro in Lib/guile/guile.swg and the
  19381. entire file Lib/guile/typemaps.i.
  19382. 2/25/00 : ttn
  19383. Modified configure.in and Makefile.in files to support
  19384. non-local build (useful in multi-arch environments).
  19385. 2/24/00 : ttn
  19386. Incorporated Guile support contributed by Clark McGrew.
  19387. This works with Guile 1.3, but since it depends heavily
  19388. on the gh_ interface, it should work for all later versions.
  19389. It has not been tested with versions before 1.3.
  19390. WARNING: Code is unstable due to experimentation by ttn.
  19391. 2/16/00 : beazley
  19392. A variety of performance improvements to the Python shadow
  19393. class code generation. Many of these result in substantial
  19394. runtime performance gains. However, these have come at
  19395. a cost of requiring the use of Python 1.5.2. For older
  19396. versions, use 'swig -noopt -python' to turn off these
  19397. optimization features.
  19398. Version 1.3 Alpha 1 (February 11, 2000)
  19399. =======================================
  19400. 2/11/00 : Added 'void' to prototype of Python module initializer.
  19401. Reported by Mark Howson (1/20/00).
  19402. 2/11/00 : beazley
  19403. Modified the Python shadow class code to discard ownership of an
  19404. object whenever it is assigned to a member of another object.
  19405. This problem has been around for awhile, but was most recently
  19406. reported by Burkhard Kloss (12/30/99).
  19407. 2/11/00 : beazley
  19408. Added braces around macros in the exception.i library. Reported
  19409. by Buck Hodges (12/19/99)
  19410. 2/11/00 : beazley
  19411. Fixed bug in the constraints.i library. Reported by Buck
  19412. Hodges (12/14/99)
  19413. 2/11/00 : beazley
  19414. The %native directive now generates Tcl8 object-style command calls.
  19415. A full solution for Tcl7 and Tcl8 is still needed. Patch suggested
  19416. by Mike Weiblen (11/29/99)
  19417. 2/11/00 : beazley
  19418. Modified the typemap code to include the $ndim variable for arrays.
  19419. Patch provided by Michel Sanner (11/12/99).
  19420. 2/11/00 : beazley
  19421. Modified the Python module to raise a Runtime error if an attempt
  19422. is made to set a read-only member of a shadow class. Reported by
  19423. Michel Sanner (11/5/99).
  19424. 2/10/00 : The documentation system has been removed. However, it is likely
  19425. to return at some point in the future.
  19426. 2/1/00 : Added a number of performance enhancements to the Python shadow
  19427. classing and type-checking code. Contributed by Vadim Chugunov.
  19428. 1. Remove _kwargs argument from the shadow wrappers when -keyword
  19429. option is not specified. This saves us a construction of keyword
  19430. dictionary on each method call.
  19431. def method1(self, *_args, **_kwargs):
  19432. val = apply(test2c.PyClass1_method1, (self,) + _args, _kwargs)
  19433. return val
  19434. becomes
  19435. def method1(self, *_args):
  19436. val = apply(test2c.PyClass1_method1, (self,) + _args)
  19437. return val
  19438. 2. Incorporate self into the _args tuple. This saves at least one tuple
  19439. allocation per method call.
  19440. def method1(self, *_args):
  19441. val = apply(test2c.PyClass1_method1, (self,) + _args)
  19442. return val
  19443. becomes
  19444. def method1(*_args):
  19445. val = apply(test2c.PyClass1_method1, _args)
  19446. return val
  19447. 3. Remove *Ptr classes.
  19448. Assume that we are SWIGging a c++ class CppClass.
  19449. Currently SWIG will generate both CppClassPtr class
  19450. that hosts all methods and also CppClass that is derived
  19451. from the former and contains just the constructor.
  19452. When CppClass method is called, the interpreter will try
  19453. to find it in the CppClass's dictionary first, and only then
  19454. check the base class.
  19455. CppClassPtr functionality may be emulated with:
  19456. import new
  19457. _new_instance = new.instance
  19458. def CppClassPtr(this):
  19459. return _new_instance(CppClass, {"this":this,"thisown":0})
  19460. This saves us one dictionary lookup per call.
  19461. <DB>The new module was first added in Python-1.5.2 so it
  19462. won't work with older versions. I've implemented an
  19463. alternative that achieves the same thing</DB>
  19464. 4. Use CObjects instead of strings for pointers.
  19465. Dave: This enhancements result in speedups of up to 50% in some
  19466. of the preliminary tests I ran.
  19467. 2/1/00 : Upgraded the Python module to use a new type-checking scheme that
  19468. is more memory efficient, provides better performance, and
  19469. is less error prone. Unfortunately, it will break all code that
  19470. depends on the SWIG_GetPtr() function call in typemaps.
  19471. These functions should be changed as follows:
  19472. if (SWIG_GetPtr(string,&ptr,"_Foo_p")) {
  19473. return NULL;
  19474. }
  19475. becomes
  19476. if (SWIG_ConvertPtr(pyobj, &ptr, SWIG_TYPE_Foo_p) == -1) {
  19477. return NULL;
  19478. }
  19479. Note: In the new implementation SWIG_TYPE_Foo_p is no longer
  19480. a type-signature string, but rather an index into a type
  19481. encoding table that contains type information.
  19482. *** POTENTIAL INCOMPATIBILITY ***
  19483. 1/30/00 : loic
  19484. Conditionally compile experimental code with --enable-experiment
  19485. configure flag.
  19486. Fix .cvsignore to ignore configure & yacc generated files
  19487. 1/28/00 : loic
  19488. Apply automake everywhere
  19489. Keep configure scripts so that people are not *forced* to autoconf
  19490. Keep sources generated by yacc so that compilation without yacc
  19491. is possible.
  19492. Source/LParse/cscanner.c: change lyacc.h into parser.h to please
  19493. default yacc generation rules.
  19494. Use AC_CONFIG_SUBDIRS in configure.in instead of hand made script.
  19495. Update all relevant .cvsignore to include .deps
  19496. Fixed missing ; line 136 Source/Swig/swig.h
  19497. 1/13/00 : beazley
  19498. Fixed a number of minor end-of-file parsing problems in the
  19499. preprocessor.
  19500. 1/13/00 : beazley
  19501. Added -freeze option that forces SWIG to freeze upon exit.
  19502. This is only used as a debugging tool so that I can more
  19503. easily examine SWIG's memory footprint.
  19504. 1/13/00 : beazley
  19505. Added patch to guile module for supporting optional arguments
  19506. Patch contributed by Dieter Baron.
  19507. 1/13/00 : loic
  19508. Added .cvsignore, Examples/.cvsignore, Source/DOH/Doh/.cvsignore
  19509. Source/SWIG1.1/main.cxx: Fixed -I handling bug
  19510. Source/Modules1.1/java.cxx: fixed char* -> const char* warnings that are
  19511. errors when compiling with gcc-2.95.2
  19512. Source/SWIG1.1/main.cxx: cast const char* to char* for String_replace
  19513. token and rep should really be const.
  19514. 1/12/00 : beazley
  19515. Added Harco's Java modules.
  19516. 1/12/00 : beazley
  19517. Revoked the %ifdef, %ifndef, %endif, %if, %elif, and %else
  19518. directives. These are no longer needed as SWIG now has a real
  19519. preprocessor.
  19520. *** POTENTIAL INCOMPATIBILITY ***
  19521. 1/12/00 : beazley
  19522. Moved the documentation modules from the SWIG directory
  19523. to the Modules directory (where they really should have been
  19524. to begin with).
  19525. 1/12/00 : beazley
  19526. Removed the -stat option for printing statistics. The
  19527. statistics reporting was inadequate and mostly broken
  19528. anyway.
  19529. *** POTENTIAL INCOMPATIBILITY ***
  19530. 1/12/00 : beazley
  19531. Removed the -t option for reading a typemap file. More
  19532. trouble than it's worth. Just include typemaps at the top
  19533. of the interface file.
  19534. *** POTENTIAL INCOMPATIBILITY ***
  19535. 1/12/00 : beazley
  19536. Removed the %checkout directive.
  19537. *** POTENTIAL INCOMPATIBILITY ***
  19538. 1/12/00 : beazley
  19539. Removed the -ci option for file checkin. Too problematic
  19540. to implement. Probably better to just put your SWIG library
  19541. under CVS instead.
  19542. *** POTENTIAL INCOMPATIBILITY ***.
  19543. 1/11/00 : beazley
  19544. Deleted the LATEX module. Sorry... Didn't know anyone
  19545. who was using it. Besides, I'm looking to simplify
  19546. the documentation system.
  19547. *** POTENTIAL INCOMPATIBILITY ***
  19548. 1/11/00 : beazley
  19549. Modified the ASCII documentation module to use a .txt
  19550. suffix for its output file instead of .doc.
  19551. 1/11/00 : beazley
  19552. Added the long-lost SWIG preprocessor back to the system.
  19553. It should be enabled by default. Raw preprocessed output
  19554. can be viewed using swig -E file.i.
  19555. *** NEW FEATURE ***
  19556. 1/11/00 : beazley and djmitche
  19557. Completely reorganized the SWIG directory structure. The
  19558. basic organization is now:
  19559. Source/ SWIG source code
  19560. Lib/ SWIG library files (swig_lib)
  19561. Doc/ Documentation
  19562. Examples/ Examples
  19563. More directories will be added as needed.
  19564. 12/08/99: Loic Dachary (loic@senga.org)
  19565. Enhanced package handling for perl5 and c++.
  19566. With new option -hide Foo::Bar, every perl5 object (Frob) is
  19567. qualified by Foo::Bar::Frob. The package name is solely used
  19568. to encapsulate C/C++ wrappers output in <module>_wrap.c and the
  19569. corresponding perl package in <module>.pm. Note that a package
  19570. name may contain :: (Frob::Nitz) and will be relative to the
  19571. package name provided by -hide (Foo::Bar::Frob::Nitz).
  19572. In *_wrap.c, SWIG_init macro is used. Was previously defined
  19573. but not used and simplifies code.
  19574. Added typemap(perl5,perl5in) and typemap(perl5,perl5out) that
  19575. do the equivalent of typemap(perl5,in) and typemap(perl5,out)
  19576. but contain perl code and applies to wrappers generated by
  19577. -shadow.
  19578. Lacking proper regression tests I used
  19579. Examples/perl5/{c++,constraint,defarg,except,
  19580. graph/graph[1234],multinherit,nested,shadow,simple,tree,
  19581. typemaps/{argv,argv2,arraymember,database,file,ignore,integer,
  19582. output,passref,reference,return}}/. I ran swig with and without
  19583. the patches, diff the generatedsources, run the .pl files
  19584. and checked that the results are identical. In all those examples
  19585. I had no error.
  19586. 11/21/99: Modified the Tcl module to provide full variable linking capabilities
  19587. to all datatypes. In previous versions, a pair of accessor functions
  19588. were created for datatypes incompatible with the Tcl_LinkVar() function.
  19589. Now, we simply use variable traces to support everything. This may
  19590. break scripts that rely upon the older behavior.
  19591. *** POTENTIAL INCOMPATIBILITY ***
  19592. 11/21/99: Added slight tweak to wrapper generator to collect local variables
  19593. of similar type. Produces somewhat more compact wrapper code.
  19594. 11/20/99: Modified the Tcl module to use SWIG_GetArgs() to parse
  19595. arguments. This is a technique borrowed from Python in which
  19596. arguments are converted using a format string convention similiar
  19597. to fprintf(). This results in a *substantial* reduction in the
  19598. size of the resulting wrapper code with only a modest runtime overhead
  19599. in going through the extra conversion function.
  19600. 11/13/99: Completely rewrote the class/structure generation code for the
  19601. Tcl module. Now, a small set of runtime functions are used
  19602. to implement the functionality for all classes (instead of a
  19603. massive amount of runtime code being generated for each class).
  19604. Class specific information is simply encoded in a series of
  19605. static tables. This results in a *HUGE* reduction in wrapper
  19606. code size--especially for C++.
  19607. 11/13/99: Removed the -tcl (Tcl 7.x) module. Tcl 8.0 is now several
  19608. years old and the defacto standard--no real reason to keep
  19609. supporting the old version at this point.
  19610. 11/13/99: Cleaned up -c option for Python module. The pyexp.swg file
  19611. is now gone.
  19612. 11/13/99: Fixed external declarations to work better with static linking
  19613. on Windows. Static linking should now be possible by defining
  19614. the -DSTATIC_LINK option on the command line. Patch contributed
  19615. by Alberto Fonseca.
  19616. 11/5/99 : Fixed an obscure code generation bug related to the generation
  19617. of default constructors. Bug reported by Brad Clements.
  19618. 11/5/99 : Fixed a few memory problems found by purify.
  19619. 11/5/99 : Officially deprecated the -htcl, -htk, and -plugin options
  19620. from the Tcl and Tcl8 modules.
  19621. 10/26/99: Removed unused variable from python/typemaps.i. Patch
  19622. contributed by Keith Davidson.
  19623. 8/16/99 : Added _WIN32 symbol to libraries to better support Windows.
  19624. 8/16/99 : Deprecated the Perl4 module. It is no longer included in the
  19625. distribution and no longer supported. In the entire 3 years SWIG
  19626. has been around I never received a single comment about it so I'm
  19627. assuming no one will miss it...
  19628. 8/16/99 : Modified the type-checking code to register type mappings using a
  19629. table instead of repeated calls to SWIG_RegisterMapping(). This
  19630. reduces the size of the module initialization function somewhat.
  19631. 8/15/99 : Cleaned up the pointer type-checking code in the Tcl module.
  19632. 8/15/99 : Many changes to the libraries to support runtime libraries.
  19633. 8/13/99 : Eliminated C++ compiler warning messages about extern "C" linkage.
  19634. 8/13/99 : Some cleanup of Python .swg files to better support runtime libraries
  19635. on Windows.
  19636. 8/13/99 : Modified the %pragma directive to attach pragmas declared inside
  19637. a class definition to the class itself. For example:
  19638. class foo {
  19639. ...
  19640. %pragma(python) addtomethod = "insert:print `hello world'"
  19641. ...
  19642. }
  19643. Most people don't need to worry about how this works. For people
  19644. writing backend modules, class-based pragmas work like this:
  19645. lang->cpp_open_class() // Open a class
  19646. lang->cpp_pragma() // Supply pragmas
  19647. ... // Emit members
  19648. lang->cpp_close_class() // Close the class
  19649. All of the pragmas are passed first since they might be used to
  19650. affect the code generation of other members. Please see
  19651. the Python module for an example. Patches contributed
  19652. by Robin Dunn.
  19653. 8/13/99 : Patch to Python shadow classes to eliminate ignored
  19654. exception errors in destructors. Patch contributed
  19655. by Robin Dunn.
  19656. 8/11/99 : Minor patch to swig_lib/python/swigptr.swg (added SWIGSTATIC
  19657. declaration). Patch contributed by Lyle Johnson.
  19658. 8/11/99 : Added FIRSTKEY/NEXTKEY methods to Perl5 shadow classes
  19659. Patch contributed by Dennis Marsa.
  19660. 8/11/99 : Modified Python module so that NULL pointers are returned
  19661. and passed as 'None.' Patch contributed by Tal Shalif.
  19662. 8/10/99 : Fixed missing 'int' specifiers in various places.
  19663. 8/10/99 : Added Windows makefile for Runtime libraries. Contributed
  19664. by Bob Techentin.
  19665. 8/10/99 : Fixed minor problem in Python runtime makefile introduced
  19666. by keyword arguments.
  19667. 8/8/99 : Changed $target of perl5(out) typemap from ST(0) to
  19668. ST(argvi). Patch contributed by Geoffrey Hort.
  19669. 8/8/99 : Fixed bug in typemap checking related to the ANY keyword
  19670. in arrays and ignored arguments. Error reported by
  19671. Geoffrey Hort.
  19672. 8/8/99 : %enabledoc and %disabledoc directives can now be used
  19673. inside class/structure definitions. However, no check
  19674. is made to see if they are balanced (i.e., a %disabledoc
  19675. directive inside a class does not have to have a matching
  19676. %enabledoc in the same class).
  19677. 8/8/99 : Keyword argument handling is now supported in the Python
  19678. module. For example:
  19679. int foo(char *bar, int spam, double x);
  19680. Can be called from Python as
  19681. foo(x = 3.4, bar="hello", spam=42)
  19682. To enable this feature, run SWIG with the '-keyword' command
  19683. line option. Mixing keyword and default arguments
  19684. should work as well. Unnamed arguments are assigned names
  19685. such as "arg1", "arg2", etc...
  19686. *** POTENTIAL INCOMPATIBILITY ***
  19687. Functions with duplicate argument names such as
  19688. bar(int *OUTPUT, int *OUTPUT) will likely cause problematic
  19689. wrapper code to be generated. To fix this, use different
  19690. names or use %apply to map typemaps to alternate names.
  19691. 8/8/99 : Handling of the 'this' pointer has been changed in Python shadow
  19692. classes. Previously, dereferencing of '.this' occurred in the
  19693. Python shadow class itself. Now, this step occurs in the C
  19694. wrappers using the following function:
  19695. SWIG_GetPtrObj(PyObject *, void **ptr, char *type)
  19696. This function can accept either a string containing a pointer
  19697. or a shadow class instance with a '.this' attribute of
  19698. appropriate type. This change allows the following:
  19699. 1. The real shadow class instance for an object is
  19700. passed to the C wrappers where it can be examined/modified
  19701. by typemaps.
  19702. 2. Handling of default/keyword arguments is now greatly
  19703. simplified.
  19704. 3. The Python wrapper code is much more simple.
  19705. Plus, it eliminated more than 300 lines of C++ code in the
  19706. Python module.
  19707. *** CAVEAT : This requires the abstract object interface.
  19708. It should work with Python 1.4, but probably nothing older
  19709. than that.
  19710. 8/8/99 : Fixed handling of "const" and pointers in classes. In particular,
  19711. declarations such as
  19712. class foo {
  19713. ...
  19714. const char *msg;
  19715. const int *iptr;
  19716. }
  19717. are handled as assignable variables as opposed to constant
  19718. values (this is the correct behavior in C/C++). Note:
  19719. declarations such as "char *const msg" are still unsupported.
  19720. Constants declared at the global level using const are also
  19721. broken (because I have a number of interfaces that rely upon
  19722. this behavior).
  19723. *** POTENTIAL INCOMPATIBILITY *** This may break interfaces that
  19724. mistakenly treat 'const char *' types as constant values.
  19725. 8/8/99 : Modified the parser to support bit-fields. For example:
  19726. typedef struct {
  19727. unsigned int is_keyword : 1;
  19728. unsigned int is_extern : 1;
  19729. unsigned int is_static : 1;
  19730. } flags;
  19731. Bit-fields can only be applied to integer types and their
  19732. are other restrictions. SWIG performs no such type-checking
  19733. (although the C compiler will catch problems when it tries to
  19734. compile the wrapper code).
  19735. 8/8/99 : Removed trailing space of $basetype substitution in typemaps.
  19736. This is to allow things like this:
  19737. %typemap(python, argout) spam** OUTPUT{
  19738. ...
  19739. char* a = "$basetype_p";
  19740. ...
  19741. }
  19742. (Patch suggested by Nathan Dunfield).
  19743. 6/22/99 : Made a very slight tweak to the Perl5 shadow class
  19744. code that allows typemaps to alter the return type
  19745. of objects (to support polymorphic types). Patch
  19746. contributed by Drake Diedrich.
  19747. 4/8/99 : Fixed null pointer handling bug in Perl module.
  19748. Patch contributed by Junio Hamano.
  19749. 3/17/99 : Fixed bug in perl5ptr.swg for ActiveState Perl.
  19750. Patch contributed by Greg Anderson.
  19751. 2/27/99 : Eliminated segmentation fault when Swig runs on
  19752. empty files.
  19753. 2/27/99 : Added patch to Guile module to eliminate unused
  19754. variables. Contributed by Mike Simons.
  19755. 2/27/99 : Fixed problem with %addmethods returning references.
  19756. 2/27/99 : Fixed Runtime/Makefile. Patch contributed by
  19757. Mike Romberg.
  19758. 2/27/99 : Incorporated patches to the type-checker.
  19759. 2/27/99 : Fixed problem with -exportall switch and shadow classes
  19760. in Perl5 module. Patch contributed by Dennis Marsa.
  19761. 2/27/99 : Modified Perl5 module to recognize 'undef' as a NULL char *.
  19762. Patch contributed by Junio Hamano.
  19763. 2/27/99 : Fixed the Perl5 module to support the newer versions of
  19764. ActiveState Perl for Win32.
  19765. 2/27/99 : Fixed the include order of files specified with the
  19766. -I option.
  19767. 2/5/98- : Dave finishes his dissertation, goes job hunting, moves to
  19768. 2/5/99 Chicago and generally thrashes about.
  19769. Version 1.1 Patch 5 (February 5, 1998)
  19770. ======================================
  19771. 2/4/98 : Fixed a bug in the configure script when different package
  19772. locations are specified (--with-tclincl, etc...).
  19773. 2/2/98 : Fixed name-clash bug related to the switch to C macros for accessor
  19774. functions. The new scheme did not work correctly for objects
  19775. with members such as 'obj', 'val', etc... Fixed the bug by
  19776. appending the word 'swig' to macro argument names. Patch
  19777. contributed by Rudy Albachten.
  19778. 2/2/98 : Slight fix to the Perl5 module to eliminate warning messages
  19779. about 'varname used only once : possible typo'. Fix
  19780. contributed by Rudy Albachten.
  19781. 1/9/98 : Fixed a bug in the Perl 5 module related to the creation of
  19782. constants and shadow classes.
  19783. 1/9/98 : Fixed linking bug with Python 1.5 embed.i library file.
  19784. Version 1.1 Patch 4 (January 4, 1998)
  19785. =====================================
  19786. 1/4/98 : Changed structured of the Examples directory to be more friendly
  19787. to Borland C++.
  19788. 1/4/98 : Added the function Makefile.win.bc for compiling the examples
  19789. under Borland 5.2.
  19790. 1/4/98 : Slight change to the perl5 module and C++ compilation. The
  19791. <math.h> library is now included before any Perl headers
  19792. because Perl the extern "C" linkage of math.h screws alot
  19793. of things up (especially on Windows).
  19794. 1/2/98 : Change to the Python module that reduces the number of constants
  19795. created by C++ classes, inheritance, and shadow classes. This
  19796. modification may introduce a few slight incompatibilities if
  19797. you attempt to use the non-shadow class interface with shadow
  19798. classes enabled. Patch contributed by Mike Romberg.
  19799. 1/2/98 : Support for Tcl 8.0 namespaces has been added. This *replaces*
  19800. the original SWIG mechanism that assumed [incr Tcl] namespaces.
  19801. To use namespaces, simply run SWIG with the following options
  19802. swig -tcl -namespace foo.i
  19803. This places everything in a namespace that matches
  19804. the module name
  19805. swig -tcl -namespace -prefix bar foo.i
  19806. This places everything in the namespace 'bar'
  19807. The use of namespaces is new in Tcl 8.0. However, the wrapper code
  19808. generated by SWIG will still work with all versions of Tcl newer
  19809. than and including Tcl 7.3/Tk3.6 even if the -namespace option is
  19810. used.
  19811. *** POTENTIAL INCOMPATIBILITY ***
  19812. This change may break existing applications that relied on the
  19813. -prefix and -namespace options.
  19814. 1/2/98 : Added the following constants to the Tcl wrapper code
  19815. SWIG_name - Name of the SWIG module
  19816. SWIG_prefix - Prefix/namespace appended to command names
  19817. SWIG_namespace - Name of the namespace
  19818. SWIG library writers can use these to their advantages.
  19819. 1/2/98 : Fixed a bug in the Tcl8 module related to the creation of
  19820. pointer constants (the function SWIG_MakePtr was missing from
  19821. the wrapper code).
  19822. 1/2/98 : Added the consthash.i library file to the Tcl and Tcl8 modules.
  19823. 1/1/98 : Changed and cleaned up the Python typemaps.i file. The following
  19824. significant changes were made :
  19825. 1. The OUTPUT typemap now returns Python tuples instead of
  19826. lists. Lists can be returned as before by using the
  19827. L_OUTPUT type. If compatibility with older versions
  19828. is needed, run SWIG with the -DOUTPUT_LIST option.
  19829. 2. The BOTH typemap has been renamed to INOUT. For backwards
  19830. compatibility, the "BOTH" method still exists however.
  19831. 3. Output typemaps now generate less code than before.
  19832. Changes to typemaps.i may break existing Python scripts that assume
  19833. output in the form of a list.
  19834. *** POTENTIAL INCOMPATIBILITY ***
  19835. 12/31/97: Fixed long overdue problems with the testing scripts and certain
  19836. makefiles that required the use of the bash shell. Everything should
  19837. work properly with the standard Bourne shell (sh) now.
  19838. 12/31/97: Modified typemaps to allow $basetype as a valid local variable.
  19839. This allows for all sorts of bizarre hackish typemaps that
  19840. do cool things. Patch contributed by Dominique Dumont.
  19841. 12/31/97: Switched accessor functions generated for member data to
  19842. C preprocessor macros (except in cases involving typemaps
  19843. or char *).
  19844. 12/31/97: Fixed a bug related to C++ member data involving references.
  19845. 12/31/97: Changed accessor functions for C++ member functions to
  19846. preprocessor macros. This cleans up the wrapper code
  19847. and results in fewer function definitions.
  19848. 12/31/97: Changed the default C constructor to use calloc() instead
  19849. of malloc()
  19850. 12/30/97: Changed the creation of constants in the Perl5 module.
  19851. For all practical purposes, they should work in exactly the
  19852. same way as before except that they now require much less
  19853. wrapper code. Modules containing large numbers of
  19854. constants may see greater than a 50% reduction in wrapper
  19855. code size.
  19856. 12/30/97: Modified the Python module to be more intelligent about the
  19857. creation of constants. SWIG no longer generates redundant
  19858. global variables and the size of the module initialization
  19859. function should be reduced. (Many thanks to Jim Fulton).
  19860. 12/29/97: Fixed a bug in C++ code generation related to member functions,
  19861. default arguments, and references.
  19862. 12/29/97: Fixed configure script and a few makefiles to support Python 1.5
  19863. 12/29/97: Added 'embed15.i' library file. This file should be used to
  19864. statically link versions of Python 1.5. To make it the default,
  19865. simply copy 'swig_lib/python/embed15.i' to 'swig_lib/python/embed.i'
  19866. Version 1.1 Patch 3 (November 24, 1997)
  19867. ========================================
  19868. 11/23/97: Fixed a bug in the Perl5 module with shadow classes and
  19869. static class functions that return class instances.
  19870. Note : The fix for this bug requires a slight restructuring of
  19871. of the .pm files created by SWIG.
  19872. 11/23/97: Fixed a bug in the Tcl/Tcl8 modules related to variable linking
  19873. of character arrays. If you declared a global variable 'char foo[10]',
  19874. the generated wrapper code would either cause a segmentation fault
  19875. immediately upon loading or weird memory corruption elsewhere.
  19876. This should now be fixed although character arrays can only be
  19877. read-only.
  19878. 11/23/97: Fixed a bug with the %import directive that caused it to
  19879. fail if files were imported from directories other than
  19880. the current working directory.
  19881. 11/23/97: Fixed incorrect diagnostic message in the ASCII documentation
  19882. module.
  19883. 11/23/97: Changed the behavior of the -o option when used with shadow
  19884. classes. If -o was used to specify both the pathname and filename
  19885. of SWIG's output such as
  19886. swig -o /home/swig/wrapper.c -shadow -perl5 foo.i
  19887. The wrapper code would be placed the file specified with -o,
  19888. but the .pm file and documentation would be placed in the
  19889. directory where SWIG was run. Now, these files are placed
  19890. in the same directory as the file specified with the -o option.
  19891. This change is also needed for proper operation on the
  19892. Macintosh.
  19893. 11/23/97: Added a 'this()' method to Perl5 shadow classes. This can
  19894. be used to return the normal pointer value from a shadow
  19895. class that is represented as a tied hash. To use just
  19896. invoke as a method like this :
  19897. $l = new List; # Create an object
  19898. $ptr = $l->this(); # Get the normal pointer value
  19899. *** NEW FEATURE ***
  19900. 11/23/97: Fixed the Tcl 8 pointer.i library file (which was completely
  19901. broken in 1.1p2).
  19902. 11/23/97: Modified the Perl5 type-checker to fix a few problems
  19903. with global variables of pointer types and to allow
  19904. tied hashes to be used interchangably with normal
  19905. pointer values.
  19906. 11/23/97: Modified the typemap mechanism to allow output
  19907. typemaps of type 'void'. These were ignored previously,
  19908. but now if you specify,
  19909. %typemap(lang,out) void {
  19910. ... return a void ...
  19911. }
  19912. You can change or assign a return value to the function.
  19913. 11/23/97: Fixed processing of 'bool' datatypes in the Python module.
  19914. 11/23/97: Fixed minor parsing error with C++ initializers. For example,
  19915. class B : public A {
  19916. public:
  19917. B() : A() { ... };
  19918. ...
  19919. }
  19920. 11/23/97: Fixed the Tcl8 module so that C functions that call back into
  19921. Tcl don't corrupt the return result object (SWIG was gathering
  19922. the result object too early which leads to problems if subsequent
  19923. Tcl calls are made).
  19924. 11/23/97: Fixed a code generation bug in the Python module when two or
  19925. more output parameters were used as the first arguments of a
  19926. function. For example :
  19927. %include typemaps.i
  19928. void foo(double *OUTPUT, double *OUTPUT, double a);
  19929. Previously, doing this resulted in the creation of an
  19930. extraneous comma in the output, resulting in a C syntax error.
  19931. 11/22/97: Fixed a bug when template handling that was stripping whitespace
  19932. around nested templates. For example :
  19933. Foo<Bar<double> >
  19934. was getting munged into Foo<Bar>> which is a syntax error in
  19935. in the C++ compiler.
  19936. 11/22/97: Fixed bugs in the Borland C++ makefiles.
  19937. 11/22/97: Fixed memory corruption bug when processing integer
  19938. arguments in Tcl8 module.
  19939. 11/21/97: Fixed a bug in the Runtime/Makefile related to Tcl 8.
  19940. 11/21/97: Fixed a bug with the %new directive and Perl5 shadow classes.
  19941. No longer generates a perl syntax error.
  19942. 11/9/97 : Changed a strncpy() to strcpy() in the pointer type-checker.
  19943. This results in a substantial performance improvement in
  19944. type-checking.
  19945. 10/29/97: Fixed a bug in the code generation of default arguments and
  19946. user-defined types. For example :
  19947. void foo(Vector a, Vector b = d);
  19948. should now work properly.
  19949. Version 1.1 Patch 2 (September 4, 1997)
  19950. =======================================
  19951. 9/4/97 : Fixed problem with handling of virtual functions that
  19952. was introduced by some changes in the C++ module.
  19953. Version 1.1 Patch 1 (August 27, 1997)
  19954. =====================================
  19955. 8/26/97 : Fixed compilation and run-time bugs with Tcl 8.0 final.
  19956. 8/21/97 : Fixed code generation bug with arrays appearing as arguments
  19957. to C++ member functions. For example :
  19958. class Foo {
  19959. public:
  19960. void Bar(int a[20][20]);
  19961. };
  19962. There is still a bug using arrays with added methods
  19963. however.
  19964. 8/20/97 : Fixed a bug with generating the code for added methods
  19965. involving pass-by-value.
  19966. 8/19/97 : Modified the typemapper to substitute the '$arg' value
  19967. when declaring local variables. For example :
  19968. %typemap(in) double * (double temp_$arg) {
  19969. ... do something ...
  19970. }
  19971. When applied to a real function such as the following :
  19972. void foo(double *a, double *b, double *result);
  19973. three local variables will be created as follows :
  19974. double temp_a;
  19975. double temp_b;
  19976. double temp_result;
  19977. This can be used when writing multiple typemaps that need
  19978. to access the same local variables.
  19979. 7/27/97 : Fixed a variety of problems with the %apply directive and arrays.
  19980. The following types of declarations should now work :
  19981. %apply double [ANY] { Real [ANY] };
  19982. %apply double [4] { double [10] };
  19983. A generic version of apply like this :
  19984. %apply double { Real };
  19985. should now work--even if arrays involving doubles and Reals are
  19986. used later.
  19987. 7/27/97 : Changed warning message about "Array X has been converted to Y" to
  19988. only appear if running SWIG in verbose mode.
  19989. 7/27/97 : Added the variables $parmname and $basemangle to the typemap
  19990. generator. $parmname is the name of the parameter used
  19991. when the typemap was matched. It may be "" if no parameter
  19992. was used. $basemangle is a mangled version of the base
  19993. datatype. Sometimes used for array handling.
  19994. 7/27/97 : Changed the behavior of output arguments with Python shadow classes.
  19995. Originally, if a function returned an object 'Foo', the shadow class
  19996. mechanism would create code like this :
  19997. def return_foo():
  19998. val = FooPtr(shadowc.return_foo())
  19999. val.this = 1
  20000. return val
  20001. The problem with this is that typemaps allow a user to redefine
  20002. the output behavior of a function--as a result, we can no longer
  20003. make any assumptions about the return type being a pointer or
  20004. even being a single value for that matter (it could be a list,
  20005. tuple, etc...). If SWIG detects the use of output typemaps
  20006. (either "out" or "argout") it returns the result unmodified like
  20007. this :
  20008. def return_foo():
  20009. val = shadowc.return_foo()
  20010. return val
  20011. In this case, it is up to the user to figure out what to do
  20012. with the return value (including the possibility of converting it
  20013. into a Python class).
  20014. 7/26/97 : Fixed a parsing problem with types like 'unsigned long int',
  20015. 'unsigned short int', etc...
  20016. 7/24/97 : Minor bug fix to Tcl 8 module to parse enums properly. Also
  20017. fixed a memory corruption problem in the type-checker.
  20018. (patch contributed by Henry Rowley.
  20019. 7/24/97 : Added Python-tuple typemaps contributed by Robin Dunn.
  20020. 7/24/97 : Incorporated some changes to the Python module in support of
  20021. Mark Hammond's COM support. I'm not entirely sure they
  20022. work yet however. Needs documentation and testing.
  20023. 7/24/97 : Fixed code generation bugs when structures had array members
  20024. and typemaps were used. For example :
  20025. %typemap(memberin) double [20][20] {
  20026. ... get a double [20][20] ...
  20027. }
  20028. struct Foo {
  20029. double a[20][20];
  20030. }
  20031. Originally, this would generate a compiler-type error when
  20032. the wrapper code was compiled. Now, a helper function like
  20033. this is generated :
  20034. double *Foo_a_set(Foo *a, double val[20][20]) {
  20035. ... memberin typemap here ...
  20036. return (double *) val;
  20037. }
  20038. When writing typemaps, one can assume that the source variable
  20039. is an array of the *same* type as the structure member. This
  20040. may break some codes that managed to work around the array bug.
  20041. *** POTENTIAL INCOMPATIBILITY ***
  20042. 7/13/97 : Fixed bug in Perl5 module when using C global variables that
  20043. are pointers. When used in function calls and other operations,
  20044. the value of the pointer would be invalid---causing core
  20045. dumps and other problems. SWIG implements global variables
  20046. using Perl magic variables. As it turns out, the error
  20047. was caused by the fact that the pointer-extraction code
  20048. was somehow bypassing the procedure used to resolve magical
  20049. variables (hence, leaving the value undefined). To fix
  20050. the problem, SWIG now explicitly resolves magic before
  20051. extracting pointer values.
  20052. 7/12/97 : Eliminated the last remnants of free() and malloc() from
  20053. the SWIG compiler.
  20054. 7/12/97 : Fixed parsing problems with typemaps involving arrays and
  20055. temporary variables of arrays. Also made it possible for
  20056. SWIG to handle typemaps like this :
  20057. %typemap(in) double [ANY] (double temp[$dim0]) {
  20058. ... store data in temp[$dim0] ...
  20059. }
  20060. Not only does this typemap match any double [] array, it
  20061. creates a local variable with precisely the right dimensions.
  20062. (ie. $dim0 gets filled in with the real number of dimensions).
  20063. Of course, off the record, this will be a way to add more
  20064. functionality to the typemaps.i libraries.
  20065. 7/9/97 : Fixed some problems with Perl5, static linking, and shadow
  20066. classes. When statically linking multiple modules together, write
  20067. a top-level interface file like this when shadow classes are not
  20068. used :
  20069. %module swig, foo, bar, glob;
  20070. %include perlmain.i
  20071. When shadow classes are used, the module names have an extra 'c'
  20072. appended so it should read as :
  20073. %module swig, fooc, barc, globc;
  20074. %include perlmain.i
  20075. When linking multiple modules, consider using the SWIG runtime
  20076. library.
  20077. 7/8/97 : Incorporated fixed versions of the Borland C++ Makefiles.
  20078. 7/8/97 : First cut at trying to eliminate excessive compiler warnings.
  20079. As it turns out, alot of warnings go away if you just make
  20080. declarations like this
  20081. clientData = clientData;
  20082. in the resulting wrapper code. Most compilers should just
  20083. ignore this code (at least would can hope).
  20084. 7/8/97 : Fixed bizarre code generation bug with typemaps and C++ classes.
  20085. In some cases, typemaps containing printf formatting strings such as
  20086. %typemap(memberout) int * {
  20087. printf("%d",42);
  20088. }
  20089. Would generate completely bogus code with garbage replacing
  20090. the '%d'. Caused by one faulty use of printf (wasn't able to find
  20091. any other occurrences).
  20092. 7/7/97 : Fixed bug in Python shadow class generation with non-member
  20093. functions that are returning more than one value.
  20094. 7/7/97 : Incorporated modifications to make SWIG work with Guile 1.2.
  20095. Still need to test it out, but it is rumored to work.
  20096. 7/2/97 : Fixed some bugs related to output arguments and Python shadow
  20097. classes. If an output argument is detected, SWIG assumes
  20098. that the result is a list and handles it appropriately.
  20099. If the normal return type of an function is an object,
  20100. it will be converted into a shadow class as before, but
  20101. with the assumption that it is the first element of a
  20102. list. *** NOTE : This behavior has been subsequently changed ***
  20103. 6/29/97 : Changed EXPORT to SWIGEXPORT in all of the language modules.
  20104. Should provide better compatibility with Windows.
  20105. 6/29/97 : Modified Python shadow classes so that output arguments
  20106. work correctly (when typemaps are used).
  20107. Version 1.1 (June 24, 1997)
  20108. ===========================
  20109. 6/24/97 : Fixed Objective-C constructor bug when working with Perl5
  20110. shadow classes.
  20111. 6/23/97 : Fixed some parsing problems with Objective-C. Declarations
  20112. such as the following should work now :
  20113. - foo : (int) a with: (int) b;
  20114. 6/22/97 : Added SWIG Runtime library. This library contains
  20115. the SWIG pointer type-checker and support functions
  20116. that are normally included in every module. By using
  20117. the library, it is easier to work with multiple SWIG
  20118. generated modules.
  20119. 6/22/97 : Fixed minor bug in Perl5 module related to static linking
  20120. of multiple modules.
  20121. 6/22/97 : Fixed some bugs with the %import directive. When used with
  20122. Perl5 shadow classes, this generates a 'require' statement
  20123. to load in external modules.
  20124. 6/22/97 : Added -swiglib option. This prints out the location of the
  20125. SWIG library and exits. This option is only really useful to
  20126. configuration tools that are looking for SWIG and its library
  20127. location (e.g. autoconf, configure, etc...).
  20128. 6/21/97 : Fixed export bug with Perl5.004 on Windows-NT.
  20129. 6/20/97 : Minor change to code generation of class/structure members in
  20130. order to work better with typemaps. Should have no noticable
  20131. impact on existing SWIG modules.
  20132. 6/19/97 : Added -t option. This allows SWIG to load a typemap file before
  20133. processing any declarations. For example :
  20134. swig -t typemaps.i -python example.i
  20135. At most, only one typemap file can be specified in this manner.
  20136. *** NEW FEATURE ***
  20137. 6/18/97 : Need a Makefile fast? Type
  20138. swig [-tcl, -perl5, -python] -co Makefile
  20139. and you will get a Makefile specific to that target language.
  20140. You just need to modify it for your application and you're
  20141. ready to run.
  20142. 6/18/97 : Completed the -ci option. This option checks a file into the
  20143. SWIG library. It should be used in conjunction with a
  20144. language option. For example :
  20145. swig -tcl -ci foobar.i
  20146. Checks the file foobar.i into the Tcl part of the library.
  20147. In order to check a file into the general library (accessible
  20148. to all languages modules), do the following
  20149. swig -ci -o ../foobar.i foobar.i
  20150. (Admittedly this looks a little strange but is unavoidable).
  20151. The check-in option is primarily designed for SWIG maintenance
  20152. and library development. The command will fail if the user does
  20153. not have write permission to the SWIG library. Third party library
  20154. extensions can easily install themselves by simply providing
  20155. a shell script that uses 'swig -ci' to install the appropriate
  20156. library files. It is not necessary to know where the SWIG library
  20157. is located if you use this mechanism.
  20158. *** NEW FEATURE ***
  20159. 6/16/97 : Fixed a bug in shadow class generation when %name() was applied
  20160. to a class definition. Unfortunately, fixing the bug required
  20161. a change in the Language C API by adding an extra argument to
  20162. the Language::cpp_class_decl() function. This may break
  20163. SWIG C++ extensions.
  20164. *** POTENTIAL INCOMPATIBILITY ***
  20165. 6/15/97 : Added a warning message if no module name is specified with the
  20166. %module directive or -module option.
  20167. 6/15/97 : Fixed line number bug when reporting errors for undefined
  20168. base classes.
  20169. 6/15/97 : Added new %rename directive. This allows the forward declaration
  20170. of a renaming. For example :
  20171. %rename OldName NewName;
  20172. .... later ...
  20173. int OldName(int);
  20174. Unlike %name, %rename will rename any occurrence of the old name.
  20175. This applies to functions, variables, class members and so forth.
  20176. There is no way to disable %rename once set, but you can change the
  20177. name by redeclaring it to something else.
  20178. *** NEW FEATURE ***
  20179. 6/15/97 : Improved the implementation of the %name directive so that it
  20180. could be used with conditional compilation :
  20181. #ifdef SWIG
  20182. %name(NewName)
  20183. #endif
  20184. int OldName(int);
  20185. 6/15/97 : Added support for functions with no return datatype. In this case,
  20186. SWIG assumes a return type of 'int'.
  20187. 6/11/97 : Improved error reporting in the parser. It should be a little
  20188. less sensitive to errors that occur inside class definitions
  20189. now. Also reports errors for function pointers.
  20190. 6/11/97 : Made '$' a legal symbol in identifiers. This is to support
  20191. some Objective-C libraries. Some compilers (such as gcc) may also
  20192. allow identifiers to contain a $ in C/C++ code as well (this is
  20193. an obscure feature of C). When '$' appears in identifier, SWIG
  20194. remaps it to the string '_S_' when creating the scripting language
  20195. function. Thus a function 'foo$bar' would be called 'foo_S_bar'.
  20196. 6/11/97 : Fixed bug in Python shadow classes with __repr__ method. If
  20197. supplied by the user, it was ignored, but now it should work.
  20198. 6/9/97 : Fixed the Tcl 8.0 module to work with Tcl 8.0b1. SWIG is no
  20199. longer compatible with *any* alpha release of Tcl 8.0.
  20200. *** POTENTIAL INCOMPATIBILITY ***
  20201. 6/7/97 : Put a maximal error count in (currently set to 20). SWIG will bail out
  20202. if it generates more errors than this (useful for preventing SWIG
  20203. from printing 4000 syntax errors when it gets confused).
  20204. 6/7/97 : Fixed segmentation fault when parsing variable length arguments.
  20205. 6/7/97 : Minor change to Perl5 module. C++ static functions are now
  20206. put in the same package as their class when using shadow classes.
  20207. 6/7/97 : Centralized the naming of functions, members, wrappers etc... By
  20208. centralizing the naming scheme, it should be possible to make
  20209. some multi-file optimizations. Also, it should be possible to
  20210. change SWIG's naming scheme (perhaps a new feature to be added
  20211. later).
  20212. 6/2/97 : Added 'arginit' typemap. This can be used to assign initial values
  20213. to function arguments. Doing so makes it somewhat easier to detect
  20214. improper argument passing when working with other typemaps.
  20215. 6/2/97 : Fixed code generation bug when read-only variables were inherited
  20216. into other classes. Under inheritance, the variables would
  20217. become writable, but this has now been corrected.
  20218. 5/30/97 : An empty %name() directive is no longer allowed or supported.
  20219. This directive was originally used to strip the prefix
  20220. off of a class or structure. Unfortunately, this never really
  20221. seemed to work right and it complicated the C++ code generator
  20222. significantly. As far as I can tell no one uses it, so it
  20223. is now history. *** POTENTIAL INCOMPATIBILITY ***
  20224. 5/28/97 : Fixed a parsing bug with #define and C++ comments. Declarations
  20225. such as the following now work properly :
  20226. #define CONST 4 // A Comment
  20227. 5/28/97 : Made some performance improvements to the SWIG String class.
  20228. (only affects the SWIG compiler itself).
  20229. 5/28/97 : Modified the parser to skip template definitions and issue a
  20230. warning message.
  20231. 5/28/97 : Preliminary support for parameterized types added (ie. templates).
  20232. Types such as the following should pass through the SWIG compiler
  20233. void foo(vector<complex> *a, vector<double> *b);
  20234. When used, the entire name 'vector<complex>' becomes the name
  20235. of the datatype. Due to space limitations in datatype
  20236. representations, the name should not exceed 96 characters.
  20237. Note : This is only part of what is needed for template support.
  20238. Template class definitions are not yet supported by SWIG.
  20239. The template notation above may also be used when specifying
  20240. Objective-C protocol lists.
  20241. *** NEW FEATURE ***
  20242. 5/24/97 : First cut at Objective-C support added. As it turns out, almost
  20243. everything can be handled with only a few minor modifications to
  20244. the C++ module.
  20245. *** NEW FEATURE ***
  20246. 5/23/97 : Fixed repeated definition bug in multiple inheritance handling
  20247. when multiple base classes share a common base class (ie.
  20248. the evil diamond).
  20249. 5/21/97 : Fixed rather embarrassing typo that worked its way into the
  20250. Tests/Build directory.
  20251. 5/19/97 : Fixed code generation bug when using native methods and
  20252. shadow classes with Python and Perl5 modules.
  20253. 5/19/97 : Modified the %apply directive slightly so that it would work
  20254. with pointers a little better. For example :
  20255. %apply unsigned long { DWORD };
  20256. Applies *all* typemaps associated with "unsigned long" to
  20257. "DWORD". This now includes pointers to the two datatypes.
  20258. For example, a typemap applied to "unsigned long **" would
  20259. also be applied to any occurrence of "DWORD **" as well.
  20260. 5/19/97 : Fixed an ownership assignment bug in the Perl5 module when
  20261. class members were returning new objects belonging to
  20262. different classes.
  20263. 5/17/97 : Added a few more typemap variables.
  20264. $name - Name of function/variable/member
  20265. $basetype - Base datatype (type without pointers)
  20266. $argnum - Argument number
  20267. 5/16/97 : Fixed embarrassing underscore error in local variable
  20268. allocator.
  20269. 5/16/97 : Fixed namespace clash bug in parameterized typemaps
  20270. when creating arrays as new local variables.
  20271. 5/15/97 : Fixed some bugs with inheritance of added methods across
  20272. multiple files. SWIG now uses names of base classes
  20273. when generating such functions.
  20274. 5/14/97 : Finished support for default typemaps. Primarily used
  20275. internally, they can be used to match the basic
  20276. built-in datatypes used inside of SWIG. You can
  20277. specify them in interface files as well like this :
  20278. %typemap(tcl,in) int SWIG_DEFAULT_TYPE {
  20279. $target = atoi($target);
  20280. }
  20281. Unlike normal typemaps, this default map will get applied
  20282. to *all* integer datatypes encountered, including those
  20283. renamed with typedef, etc...
  20284. 5/13/97 : Fixed substring bug in type checker.
  20285. 5/12/97 : Fixed bug in parameterized typemaps when declaring local
  20286. variables of structures.
  20287. Version 1.1 Beta6 (May 9, 1997)
  20288. ===============================
  20289. 5/9/97 : Fixed bizarre NULL pointer handling bug in Perl5 module.
  20290. 5/8/97 : Fixed mysterious segmentation fault when running SWIG on an
  20291. empty file.
  20292. 5/7/97 : The code generator will now replace the special symbol "$cleanup"
  20293. with the cleanup code specified with the "freearg" typemap.
  20294. This change needed to properly manage memory and exceptions.
  20295. 5/5/97 : Added the 'typemaps.i' library file. This contains a
  20296. variety of common typemaps for input values, pointers,
  20297. and so on.
  20298. 5/5/97 : Changed behavior of "argout" typemap in Python module.
  20299. Old versions automatically turned the result into a
  20300. Python list. The new version does nothing, leaving the
  20301. implementation up to the user. This provides more flexibility
  20302. but may break older codes that rely on typemaps.
  20303. *** POTENTIAL INCOMPATIBILITY ***
  20304. 5/5/97 : Fixed bug in Python module related to the interaction of
  20305. "argout" and "ignore" typemaps.
  20306. 5/5/97 : Fixed bug in Python module that would generate incorrect code
  20307. if all function arguments are "ignored".
  20308. 5/4/97 : Added %apply and %clear directives. These form a higher level
  20309. interface to the typemap mechanism. In a nutshell, they
  20310. can be used to change the processing of various datatypes without
  20311. ever having to write a typemap. See the SWIG documentation
  20312. for more details. ** NEW FEATURE **
  20313. 5/4/97 : Added a local variable extension to the typemap handler.
  20314. For example :
  20315. %typemap(tcl,in) double *(double temp) {
  20316. temp = atof($source);
  20317. $target = &temp;
  20318. }
  20319. In this case, 'temp' is a local variable that exists
  20320. in the entire wrapper function (not just the typemap
  20321. code). This mechanism provides better support for
  20322. certain types of argument handling and also makes it
  20323. possible to write thread-safe typemaps. Any number
  20324. local variables can be declared by supplying a comma
  20325. separated list. Local variables are guaranteed to be
  20326. unique, even if the same typemap is applied many times
  20327. in a given function.
  20328. ** Not currently supported in Perl4 or Guile modules.
  20329. 5/2/97 : Fixed processing of %ifdef, %endif, %if, etc... (These are
  20330. SWIG equivalents of the C preprocessor directives that
  20331. can pass through the C preprocessor without modification).
  20332. 5/2/97 : Fixed major (but subtle) bug in the run-time type checker
  20333. related to searching and type-checking for C++ inheritance.
  20334. To make a long story short, if you had two classes named
  20335. "Foo" and "FooObject" the type checker would sometimes
  20336. get confused and be unable to locate "Foo" in an internal
  20337. table.
  20338. 5/2/97 : Fixed some bugs in the -co option.
  20339. 4/24/97 : Pointer library added to the SWIG library.
  20340. 4/19/97 : Added the %new directive. This is a "hint" that can be used
  20341. to tell SWIG that a function is returning a new object. For
  20342. example :
  20343. %new Foo *create_foo();
  20344. This tells SWIG that create_foo() is creating a new object
  20345. and returning a pointer to it. Many language modules may
  20346. choose to ignore the hint, but when working with shadow classes,
  20347. the %new is used to handle proper ownership of objects.
  20348. %new can also be used with dynamically allocated strings.
  20349. For example :
  20350. %new char *create_string();
  20351. When used, all of the language modules will automatically cleanup
  20352. the returned string--eliminating memory leaks.
  20353. ** NEW FEATURE **
  20354. 4/19/97 : Added a new typemap "newfree". This is used in conjunction with
  20355. the %new directive and can be used to change the method by which
  20356. a new object returned by a function is deleted.
  20357. 4/19/97 : The symbol "__cplusplus" is now defined in the SWIG interpreter
  20358. when running with the -c++ option.
  20359. 4/17/97 : Added support for static member functions when used inside the
  20360. %addmethods directive.
  20361. 4/15/97 : Added a special typemap symbol PREVIOUS that can be used to
  20362. restore a previous typemap. For example :
  20363. %typemap(tcl,in) int * = PREVIOUS;
  20364. This is primarily used in library files.
  20365. 4/13/97 : Added %pragma directive for Perl5 module. Two new pragmas are
  20366. available :
  20367. %pragma(perl5) code = "string"
  20368. %pragma(perl5) include = "file.pl"
  20369. Both insert code into the .pm file created by SWIG. This can
  20370. be used to automatically customize the .pm file created by SWIG.
  20371. 4/13/97 : Scanner modified to only recognize C++ keywords when the -c++
  20372. option has been specified. This provides support for C programs
  20373. that make use of these keywords for identifiers.
  20374. SWIG may need to be explicitly run with the -c++ option when
  20375. compiling C++ code (this was allowed, but not recommended in
  20376. previous versions). **POTENTIAL INCOMPATIBILITY**
  20377. 4/11/97 : Fixed a rather nasty bug in the Perl5 module related to using
  20378. variable linking with complex datatypes and pointers. On Unix,
  20379. code would work (somehow), but would cause an access violation
  20380. under Windows-NT. The fix should correct the problem,
  20381. but there may still be a problem using global variables of
  20382. complex datatypes in conjunction with shadow classes. Fortunately,
  20383. this sort of thing seems to be relatively rare (considering
  20384. that the bug has been around for more than a year - yikes!).
  20385. 4/11/97 : Fixed bizarre constant evaluation bug in Perl5 code generation
  20386. when running under Windows-NT.
  20387. 4/8/97 : Bug when using default arguments and C++ references fixed.
  20388. 4/8/97 : Fixed code generation bugs in Python and Perl5 modules related to
  20389. using class renaming (applying the %name directive to a class
  20390. definition) and shadow classes.
  20391. 4/7/97 : Fixed minor bugs in swigptr.swg, tcl8ptr.swg, and perl5ptr.swg to
  20392. prevent infinite loops when weird datatypes are passed.
  20393. 3/29/97 : 'Makefile.win' added. This is used to build most of the examples
  20394. in the Examples directory under Windows NT/95.
  20395. 3/27/97 : Fixes to SWIG's error return codes. SWIG now returns non-zero
  20396. exit codes for certain kinds of errors (which makes it more
  20397. friendly to makefiles). An overhaul of the error handling
  20398. is on the to-do list and will probably show up in a later release.
  20399. 3/25/97 : Bug fix. "freearg" and "argout" typemaps have been fixed in
  20400. the Perl5 module. In previous versions, function input parameters
  20401. and function output parameters shared the same memory space--causing
  20402. all sorts of nasty problems when trying to pass perl values by
  20403. reference. SWIG now internally makes a "copy" (which is really
  20404. just a pointer) of affected parameters and uses that. This
  20405. is done transparently so there is no noticable impact on any
  20406. SWIG generated modules. This change is probably only noticable
  20407. to expert users.
  20408. 3/25/97 : Added type-check to verbose and stat mode. SWIG will now generate a list
  20409. of all datatypes that were used but undefined (useful for tracking
  20410. down weird bugs). This is enabled with the -v option (which
  20411. is now officially known as "overly verbose" mode) or the -stat option.
  20412. 3/25/97 : Slight change to the parser to make include guards work correctly.
  20413. For example :
  20414. #ifndef INTERFACE_I
  20415. #define INTERFACE_I
  20416. %module foobar.i
  20417. ... declarations ...
  20418. #endif
  20419. 3/24/97 : %checkout directive added. This allows an interface file to
  20420. extract files from the SWIG library and place them in the
  20421. current directory. This can be used to extract scripts and
  20422. other helper code that might be associated with library files.
  20423. For example :
  20424. %checkout array.tcl
  20425. Will look for a file "array.tcl" in the library and copy it
  20426. to the current directory. If the file already exists in the
  20427. directory, this directive does nothing (it will not overwrite an
  20428. existing file). This only an experimental feature for now.
  20429. 3/24/97 : SWIG will now look in the SWIG Library for a file if it can't
  20430. find it in the current directory. As a result, it is easy to
  20431. make modules from SWIG library files. For example, if you
  20432. want to make a Python module from the SWIG timers library, just
  20433. type this in any directory :
  20434. swig -python timers.i
  20435. You will get the files timers_wrap.c and timers_wrap.doc in
  20436. the current directory that you can now compile. The file
  20437. remains in the SWIG library (although you can check it out
  20438. using the -co option). *** New Feature ***
  20439. 3/24/97 : -co option added to SWIG to allow easy access to the SWIG library.
  20440. When used, this instructs SWIG to check out a library file and
  20441. place it in the current directory. For example :
  20442. unix > swig -co array.i
  20443. array.i checked out from the SWIG library
  20444. unix >
  20445. Once in your directory you can customize the file to suit your
  20446. particular purposes. The checkout option makes it easy to
  20447. grab library files without knowing anything about the SWIG
  20448. installation, but it also makes it possible to start
  20449. including scripts, C code, and other miscellaneous files
  20450. in the library. For example, you could put a cool script
  20451. in the library and check it out whenever you wanted to use it.
  20452. *** New Feature ***
  20453. 3/24/97 : #pragma export directives added to Tcl output for compiling
  20454. shared libraries on the Mac.
  20455. 3/24/97 : Minor changes to wish.i and tclsh.i library files to provide
  20456. support for the Macintosh.
  20457. 3/19/97 : SWIG's policy towards NULL pointers has been relaxed. The
  20458. policy of requiring a special compiler directive -DALLOW_NULL
  20459. to use NULL pointers is no longer supported. While this may
  20460. seem "unsafe", it turns out that you can use a "check"
  20461. typemap to achieve some safety. For example :
  20462. %typemap(perl5,check) Node * {
  20463. if (!$target)
  20464. croak("NULL Pointers not allowed.");
  20465. }
  20466. This prevents any NULL value of a "Node *" pointer to be
  20467. passed to a function. (I think this is much cleaner
  20468. than the old -DALLOW_NULL hack anyways).
  20469. 3/19/97 : Fixed pointer handling errors in Perl5 module. Modules no
  20470. longer core dump when a Perl reference is inadvertently
  20471. passed in as a C pointer.
  20472. 3/18/97 : Added a "check" typemap. This can be used to check the
  20473. validity of function input values. For example :
  20474. %typemap(perl5,check) int posint {
  20475. if ($target < 0)
  20476. croak("Argument is not a positive integer");
  20477. }
  20478. 3/18/97 : Added an $arg variable to Tcl typemaps. This makes it easier
  20479. to return argument values by "reference".
  20480. 3/18/97 : Fixed a code generation bug when using C++ references and
  20481. the %addmethods directive.
  20482. 3/18/97 : Fixed a few glitches in the typemap module with respect to
  20483. chaining. For example :
  20484. %typemap(tcl,in) int {
  20485. $in // Inserts prexisting typemap
  20486. printf("Received a %d\n", $target);
  20487. }
  20488. This has been allowed for quite some time, but didn't work
  20489. if no existing typemap was defined. Now, it still doesn't
  20490. work if no existing typemap is defined, but it issues a
  20491. warning message. There is some support using default typemaps,
  20492. but none of the language modules take advantage of it. This
  20493. should be considered experimental at this time.
  20494. Version 1.1b5 Patch 1 (March 16, 1997)
  20495. ======================================
  20496. 3/16/97 : Fixed references bug with C++ code generation.
  20497. 3/16/97 : Fixed initialization bug in the documentation system that
  20498. was causing weird problems.
  20499. 3/16/97 : Fixed fatal bug with -c option in the Python module.
  20500. 3/13/97 : Fixed bug in the documentation system involving the %text directive
  20501. and sorting. In the old system, %text entries would float to the
  20502. top of a section because they were "nameless". Now they are
  20503. attached to the previous declaration and will stay in the proper
  20504. location relative to the previous entry.
  20505. Version 1.1b5 (March 12, 1997)
  20506. ==============================
  20507. 3/11/97 : Fixed compilation problems introduced by Tcl/Tk 8.0a2.
  20508. *** INCOMPATIBILITY *** SWIG no longer works with Tcl/Tk 8.0a1.
  20509. 3/10/97 : Fixed bug with ignored arguments and C++ member functions in
  20510. the Python module.
  20511. 3/9/97 : Parsing bugs with nested class definitions and privately
  20512. declared nested class definitions fixed.
  20513. 3/9/97 : Fixed a few minor code generation bugs with C++ classes and
  20514. constructors. In some cases, the resulting wrapper code
  20515. would not compile properly. SWIG now attempts to use
  20516. the default copy constructor instead.
  20517. 3/8/97 : Added a -l option to SWIG that allows additional SWIG library files
  20518. to be grabbed without having them specified in the interface file.
  20519. This makes it easier to keep the interface file clean and move certain
  20520. options into a Makefile. For example :
  20521. swig -tcl example.i # Build a normal Tcl extension
  20522. swig -tcl -lwish.i example.i # Build it as a wish extension
  20523. # by including the 'wish.i' file.
  20524. swig -python example.i # Build a dynamically loaded extension
  20525. swig -python -lembed.i example.i # Build a static extension
  20526. These kinds of options could previously be accomplished with
  20527. conditional compilation such as :
  20528. %module example
  20529. ...
  20530. #ifdef STATIC
  20531. %include embed.i
  20532. #endif
  20533. 3/8/97 : Incorporated changes to Guile module to use the new gh interface
  20534. in FSF Guile 1.0. The older gscm interface used in Cygnus
  20535. Guile releases is no longer supported by SWIG.
  20536. 3/8/97 : Cleaned up the Tcl Netscape plugin example. It should work with
  20537. version 1.1 of the plugin now.
  20538. 3/8/97 : Added better array support to the typemap module. The keyword
  20539. ANY can now be used to match any array dimension. For example :
  20540. %typemap(tcl,in) double [ANY] {
  20541. ... get an array ...
  20542. }
  20543. This will match any single-dimensional double array. The array
  20544. dimension is passed in the variables $dim0, $dim1, ... $dim9. For
  20545. example :
  20546. %typemap(tcl,in) double [ANY][ANY][ANY] {
  20547. printf("Received a double[%d][%d][%d]\n",$dim0,$dim1,$dim2);
  20548. }
  20549. Any typemap involving a specific array dimension will override any
  20550. specified with the ANY tag. Thus, a %typemap(tcl,in) double [5][4][ANY] {}
  20551. would override a double [ANY][ANY][ANY]. However, overuse of the ANY
  20552. tag in arrays of high-dimensions may not work as you expect due to
  20553. the pattern matching rule used. For example, which of the following
  20554. typemaps has precedence?
  20555. %typemap(in) double [ANY][5] {} // Avoid this!
  20556. %typemap(in) double [5][ANY] {}
  20557. 3/7/97 : Fixed a number of bugs related to multi-dimensional array handling.
  20558. Typedefs involving multi-dimensional arrays now works correctly.
  20559. For example :
  20560. typedef double MATRIX[4][4];
  20561. ...
  20562. extern double foo(MATRIX a);
  20563. Typecasting of pointers into multi-dimensional arrays is now
  20564. implemented properly when making C/C++ function calls.
  20565. 3/6/97 : Fixed potentially dangerous bug in the Tcl Object-oriented
  20566. interface. Well, actually, didn't fix it but issued a
  20567. Tcl error instead. The bug would manifest itself as follows:
  20568. % set l [List] # Create an object
  20569. ...
  20570. % set m [List -this $l] # Make $m into an object assuming $l
  20571. # contains a pointer.
  20572. # Since $m == $l, $l gets destroyed
  20573. # (since its the same command name)
  20574. % $m insert Foo
  20575. Segmentation fault # Note : the list no longer exists!
  20576. Now, an error will be generated instead of redefining the command.
  20577. As in :
  20578. % set l [List]
  20579. ...
  20580. % set m [List -this $l]
  20581. Object name already exists!
  20582. Use catch{} to ignore the error.
  20583. 3/3/97 : Better support for enums added. Datatypes of 'enum MyEnum'
  20584. and typedefs such as 'typedef enum MyEnum Foo;' now work.
  20585. 3/3/97 : Parser modified to ignore constructor initializers such as :
  20586. class Foo : public Bar {
  20587. int a,b;
  20588. public:
  20589. Foo(int i) : a(0), b(i), Bar(i,0) { };
  20590. };
  20591. 3/3/97 : Modified parser to ignore C++ exception specifications such as :
  20592. int foo(double) throw(X,Y);
  20593. 3/3/97 : Added %import directive. This works exactly like %extern
  20594. except it tells the language module that the declarations are
  20595. coming from a separate module. This is usually only
  20596. needed when working with shadow classes.
  20597. 3/2/97 : Changed pointer type-checker to be significantly more
  20598. efficient when working with derived datatypes. This
  20599. has been accomplished by storing type-mappings in sorted
  20600. order, using binary search schemes, and caching recently
  20601. used datatypes. For SWIG generated C++ modules that
  20602. make a large number of C function calls with derived types,
  20603. this could result in speedups of between 100 and 50000 percent.
  20604. However, due to the required sorting operation, module
  20605. loading time may increased slightly when there are lots of
  20606. datatypes.
  20607. 3/2/97 : Fixed some C++ compilation problems with Python
  20608. embed.i library files.
  20609. 2/27/97 : Slight change to C++ code generation to use copy constructors
  20610. when returning complex data type by value.
  20611. 2/26/97 : Fixed bug in Python module with -c option.
  20612. 2/26/97 : Slight tweak of parser to allow trailing comma in enumerations
  20613. such as
  20614. enum Value (ALE, STOUT, LAGER, };
  20615. 2/25/97 : Fixed code generation bug in Tcl module when using the
  20616. %name() directive on a classname.
  20617. 2/25/97 : Finished code-size optimization of C++ code generation with
  20618. inheritance of attributes. Inherited attributes now
  20619. only generate one set of wrapper functions that are re-used
  20620. in any derived classes. This could provide big code
  20621. size improvements in some scripting language interfaces.
  20622. 2/25/97 : Perl5 module modified to support both the Unix and Windows
  20623. versions. The windows version has been tested with the
  20624. Activeware port of Perl 5.003 running under Windows 95.
  20625. The C source generated by SWIG should compile without
  20626. modification under both versions of Perl, but is now
  20627. even more hideous than before.
  20628. 2/25/97 : Modified parser to allow scope resolution operation to
  20629. appear in expressions and default arguments as in :
  20630. void foo(int a = Bar::defvalue);
  20631. 2/25/97 : Fixed bug when resolving symbols inside C++ classes.
  20632. For example :
  20633. class Foo {
  20634. public:
  20635. enum Value {ALE, STOUT, LAGER};
  20636. ...
  20637. void defarg(Value v = STOUT);
  20638. };
  20639. 2/24/97 : Fixed bug with member functions returning void *.
  20640. 2/23/97 : Modified Python module to be better behaved under Windows
  20641. - Module initialization function is now properly exported.
  20642. It should not be necessary to explicitly export this function
  20643. yourself.
  20644. - Bizarre compilation problems when compiling the SWIG wrapper
  20645. code as ANSI C under Visual C++ 4.x fixed.
  20646. - Tested with both the stock Python-1.4 distribution and Pythonwin
  20647. running under Win95.
  20648. 2/19/97 : Fixed typedef handling bug in Perl5 shadow classes.
  20649. 2/19/97 : Added exception support. To use it, do the following :
  20650. %except(lang) {
  20651. ... try part of the exception ...
  20652. $function
  20653. ... catch part of exception ...
  20654. }
  20655. $function is a SWIG variable that will be replaced by the
  20656. actual C/C++ function call in a wrapper function. Thus,
  20657. a real exception specification might look like this :
  20658. %except(perl5) {
  20659. try {
  20660. $function
  20661. } catch (char *& sz) {
  20662. ... process an exception ...
  20663. } catch(...) {
  20664. croak("Unknown exception. Bailing out...");
  20665. }
  20666. }
  20667. 2/19/97 : Added support for managing generic code fragments (needed
  20668. for exceptions).
  20669. 2/19/97 : Fixed some really obscure typemap scoping bugs in the C++
  20670. handler.
  20671. 2/18/97 : Cleaned up perlmain.i file by removing some problematic,
  20672. but seemingly unnecessary declarations.
  20673. 2/18/97 : Optimized handling of member functions under inheritance.
  20674. SWIG can now use wrapper functions generated for a
  20675. base class instead of regenerating wrappers for
  20676. the same functions in a derived class. This could
  20677. make a drastic reduction in wrapper code size for C++
  20678. applications with deep inheritance hierarchies and
  20679. lots of functions.
  20680. 2/18/97 : Additional methods specified with %addmethods can now
  20681. be inherited along with normal C++ member functions.
  20682. 2/18/97 : Minor internal fixes to make SWIG's string handling a little
  20683. safer.
  20684. 2/16/97 : Moved some code generation of Tcl shadow classes to
  20685. library files.
  20686. 2/16/97 : Fixed documentation error of '-configure' method in
  20687. Tcl modules.
  20688. 2/16/97 : Modified Perl5 module slightly to allow typemaps
  20689. to use Perl references.
  20690. 2/12/97 : Fixed argument checking bug that was introduced by
  20691. default arguments (function calls with too many
  20692. arguments would still be executed). Functions now
  20693. must have the same number of arguments as C version
  20694. (with possibility of default/optional arguments
  20695. still supported).
  20696. 2/12/97 : Fixed default argument bug in Perl5 module when
  20697. generating wrapper functions involving default
  20698. arguments of complex datatypes.
  20699. 2/12/97 : Fixed typemap scoping problems. For example :
  20700. %typemap(tcl,in) double {
  20701. .. get a double ..
  20702. }
  20703. class Foo {
  20704. public:
  20705. double bar(double);
  20706. }
  20707. %typemap(tcl,in) double {
  20708. .. new get double ..
  20709. }
  20710. Would apply the second typemap to all functions in Foo
  20711. due to delayed generation of C++ wrapper code (clearly this
  20712. is not the desired effect). Problem has been fixed by
  20713. assigning unique numerical identifiers to every datatype in
  20714. an interface file and recording the "range of effect" of each
  20715. typemap.
  20716. 2/11/97 : Added support for "ignore" and "default" typemaps. Only use
  20717. if you absolutely know what you're doing.
  20718. 2/9/97 : Added automatic creation of constructors and destructors for
  20719. C structs and C++ classes that do not specify any sort of
  20720. constructor or destructor. This feature can be enabled by
  20721. running SWIG with the '-make_default' option or by inserting
  20722. the following pragma into an interface file :
  20723. %pragma make_default
  20724. The following pragma disables automatic constructor generation
  20725. %pragma no_default
  20726. 2/9/97 : Added -make_default option for producing default constructors
  20727. and destructors for classes without them.
  20728. 2/9/97 : Changed the syntax of the SWIG %pragma directive to
  20729. %pragma option=value or %pragma(lang) option=value.
  20730. This change makes the syntax a little more consistent
  20731. between general pragmas and language-specific pragmas.
  20732. The old syntax still works, but will probably be phased
  20733. out (a warning message is currently printed).
  20734. 2/9/97 : Improved Tcl support of global variables that are of
  20735. structures, classes, and unions.
  20736. 2/9/97 : Fixed C++ compilation problem in Python 'embed.i' library file.
  20737. 2/9/97 : Fixed missing return value in perlmain.i library file.
  20738. 2/9/97 : Fixed Python shadow classes to return an AttributeError when
  20739. undefined attributes are accessed (older versions returned
  20740. a NameError).
  20741. 2/9/97 : Fixed bug when %addmethods is used after a class definition whose
  20742. last section is protected or private.
  20743. 2/8/97 : Made slight changes in include file processing to support
  20744. the Macintosh.
  20745. 2/8/97 : Extended swigmain.cxx to provide a rudimentary Macintosh interface.
  20746. It's a really bad interface, but works until something better
  20747. is written.
  20748. 1/29/97 : Fixed type-casting bug introduced by 1.1b4 when setting/getting the
  20749. value of global variables involving complex data types.
  20750. 1/29/97 : Removed erroneous white space before an #endif in the code generated
  20751. by the Python module (was causing errors on DEC Alpha compilers).
  20752. 1/26/97 : Fixed errors when using default/optional arguments in Python shadow
  20753. shadow classes.
  20754. 1/23/97 : Fixed bug with nested %extern declarations.
  20755. 1/21/97 : Fixed problem with typedef involving const datatypes.
  20756. 1/21/97 : Somewhat obscure, but serious bug with having multiple levels
  20757. of typedefs fixed. For example :
  20758. typedef char *String;
  20759. typedef String Name;
  20760. Version 1.1 Beta4 (January 16, 1997)
  20761. ====================================
  20762. Note : SWIG 1.1b3 crashed and burned shortly after take off due
  20763. to a few major run-time problems that surfaced after release.
  20764. This release should fix most, if not all, of those problems.
  20765. 1/16/97 : Fixed major memory management bug on Linux
  20766. 1/14/97 : Fixed bug in functions returning constant C++ references.
  20767. 1/14/97 : Modified C++ module to handle datatypes better.
  20768. 1/14/97 : Modified parser to allow a *single* scope resolution
  20769. operator in datatypes. Ie : Foo::bar. SWIG doesn't
  20770. yet handle nested classes, so this should be
  20771. sufficient for now.
  20772. 1/14/97 : Modified parser to allow typedef inside a C++ class.
  20773. 1/14/97 : Fixed some problems related to datatypes defined inside
  20774. a C++ class. SWIG was not generating correct code,
  20775. but a new scoping mechanism and method for handling
  20776. datatypes inside a C++ class have been added.
  20777. 1/14/97 : Changed enumerations to use the value name instead
  20778. of any values that might have appeared in the interface
  20779. file. This makes the code a little more friendly to
  20780. C++ compilers.
  20781. 1/14/97 : Removed typedef bug that made all enumerations
  20782. equivalent to each other in the type checker (since
  20783. it generated alot of unnecessary code).
  20784. Version 1.1 Beta3 (January 9, 1997)
  20785. ===================================
  20786. Note : A *huge* number of changes related to ongoing modifications.
  20787. 1. Support for C++ multiple inheritance added.
  20788. 2. Typemaps added.
  20789. 3. Some support for nested structure definitions added.
  20790. 4. Default argument handling added.
  20791. 5. -c option added for building bare wrapper code modules.
  20792. 6. Rewrote Pointer type-checking to support multiple inheritance
  20793. correctly.
  20794. 7. Tcl 8.0 module added.
  20795. 8. Perl4 and Guile modules resurrected from the dead (well, they
  20796. at least work again).
  20797. 9. New Object Oriented Tcl interface added.
  20798. 10. Bug fixes to Perl5 shadow classes.
  20799. 11. Cleaned up many of the internal modules of the parser.
  20800. 12. Tons of examples and testing modules added.
  20801. 13. Fixed bugs related to use of "const" return values.
  20802. 14. Fixed bug with C++ member functions returning void *.
  20803. 15. Changed SWIG configuration script.
  20804. Version 1.1 Beta2 (December 3, 1996)
  20805. ====================================
  20806. 1. Completely rewrote the SWIG documentation system. The changes
  20807. involved are too numerous to mention. Basically, take everything
  20808. you knew about the old system, throw them out, and read the
  20809. file Doc/doc.ps.
  20810. 2. Limited support for #if defined() added.
  20811. 3. Type casts are now allowed in constant expressions. ie
  20812. #define A (int) 3
  20813. 4. Added support for typedef lists. For example :
  20814. typedef struct {
  20815. double x,y,z;
  20816. } Vector, *VectorPtr;
  20817. 5. New SWIG directives (related to documentation system)
  20818. %style
  20819. %localstyle
  20820. %subsection
  20821. %subsubsection
  20822. 6. Reorganized the C++ handling and made it a little easier to
  20823. work with internally.
  20824. 7. Fixed problem with inheriting data members in Python
  20825. shadow classes.
  20826. 8. Fixed symbol table problems with shadow classes in both
  20827. Python and Perl.
  20828. 9. Fixed annoying segmentation fault bug in wrapper code
  20829. generated for Perl5.
  20830. 10. Fixed bug with %addmethods directive. Now it can be placed
  20831. anywhere in a class.
  20832. 11. More test cases added to the SWIG self-test. Documentation
  20833. tests are now performed along with other things.
  20834. 12. Reorganized the SWIG library a little bit and set it up to
  20835. self-document itself using SWIG.
  20836. 13. Lots and lots of minor bug fixes (mostly obscure, but bugs
  20837. nonetheless).
  20838. Version 1.1 Beta1 (October 30, 1996)
  20839. ====================================
  20840. 1. Added new %extern directive for handling multiple files
  20841. 2. Perl5 shadow classes added
  20842. 3. Rewrote conditional compilation to work better
  20843. 4. Added 'bool' datatype
  20844. 5. %{,%} block is now optional.
  20845. 6. Fixed some bugs in the Python shadow class module
  20846. 7. Rewrote all of the SWIG tests to be more informative
  20847. (and less scary).
  20848. 8. Rewrote parameter list handling to be more memory
  20849. efficient and flexible.
  20850. 9. Changed parser to ignore 'static' declarations.
  20851. 10. Initializers are now ignored. For example :
  20852. struct FooBar a = {3,4,5};
  20853. 11. Somewhat better parsing of arrays (although it's
  20854. usually just a better error message now).
  20855. 12. Lot's of minor bug fixes.
  20856. Version 1.0 Final (August 31, 1996)
  20857. ===================================
  20858. 1. Fixed minor bug in C++ module
  20859. 2. Fixed minor bug in pointer type-checker when using
  20860. -DALLOW_NULL.
  20861. 3. Fixed configure script to work with Python 1.4beta3
  20862. 4. Changed configure script to allow compilation without
  20863. yacc or bison.
  20864. Version 1.0 Final (August 28, 1996)
  20865. ===================================
  20866. 1. Changed parser to support more C/C++ datatypes (well,
  20867. more variants). Types like "unsigned", "short int",
  20868. "long int", etc... now work.
  20869. 2. "unions" added to parser.
  20870. 3. Use of "typedef" as in :
  20871. typedef struct {
  20872. double x,y,z;
  20873. } Vector;
  20874. Now works correctly. The name of the typedef is used as
  20875. the structure name.
  20876. 4. Conditional compilation with #ifdef, #else, #endif, etc...
  20877. added.
  20878. 5. New %disabledoc, %enabledoc directives allow documentation
  20879. to selectively be disabled for certain parts of a wrapper
  20880. file.
  20881. 6. New Python module supports better variable linking, constants,
  20882. and shadow classes.
  20883. 7. Perl5 module improved with better compatibility with XS
  20884. and xsubpp. SWIG pointers and now created so that they
  20885. are compatible with xsubpp pointers.
  20886. 8. Support for [incr Tcl] namespaces added to Tcl module.
  20887. 9. %pragma directive added.
  20888. 10. %addmethods directive added.
  20889. 11. %native directive added to allow pre-existing wrapper functions
  20890. to be used.
  20891. 12. Wrote configure script for SWIG installation.
  20892. 13. Function pointers now allowed with typedef statements.
  20893. 14. %typedef modified to insert a corresponding C typedef into
  20894. the output file.
  20895. 15. Fixed some problems related to C++ references.
  20896. 16. New String and WrapperFunction classes add to make generating
  20897. wrapper code easier.
  20898. 17. Fixed command line option processing to eliminate core dumps
  20899. and to allow help messages.
  20900. 18. Lot's of minor bug fixes to almost all code modules
  20901. Version 1.0 Beta 3 (Patch 1) July 17, 1996
  20902. ==========================================
  20903. 1.0 Final is not quite ready yet, but this release fixes a
  20904. number of immediate problems :
  20905. 1. Compiler errors when using -strict 1 type checking have been fixed.
  20906. 2. Pointer type checker now recognizes pointers of the form
  20907. _0_Type correctly.
  20908. 3. A few minor fixes were made in the Makefile
  20909. Version 1.0 Beta 3 (June 14, 1996)
  20910. ==================================
  20911. There are lots of changes in this release :
  20912. 1. SWIG is now invoked using the "swig" command instead of "wrap".
  20913. Hey, swig sounds cooler.
  20914. 2. The SWIG_LIB environment variable can be set to change the
  20915. location where SWIG looks for library files.
  20916. 3. C++ support has been added. You should use the -c++ option
  20917. to enable it.
  20918. 4. The %init directive has been replaced by the %module directive.
  20919. %module constructs a valid name for the initialization function
  20920. for whatever target language you're using (actually this makes
  20921. SWIG files a little cleaner). The old %init directive still works.
  20922. 5. The syntax of the %name directive has been changed. Use of the
  20923. old one should generate a warning message, but may still work.
  20924. 6. To support Tcl/Tk on non-unix platforms, SWIG imports a file called
  20925. swigtcl.cfg from the $(SWIG_LIB)/tcl directory. I don't have access
  20926. to an NT machine, but this file is supposedly allows SWIG to
  20927. produce wrapper code that compiles on both UNIX and non UNIX machines.
  20928. If this doesn't work, you'll have to edit the file swigtcl.cfg. Please
  20929. let me know if this doesn't work so I can update the file as
  20930. necessary.
  20931. 7. The SWIG run-time typechecker has been improved. You can also
  20932. now redefine how it works by supplying a file called "swigptr.cfg"
  20933. in the same directory as your SWIG interface files. By default,
  20934. SWIG reads this file from $(SWIG_LIB)/config.
  20935. 8. The documentation system has been changed to support the following :
  20936. - Documentation order is printed in interface file order by
  20937. default. This can be overridden by putting an %alpha
  20938. directive in the beginning of the interface file.
  20939. - You can supply additional documentation text using
  20940. %text %{ put your text here %}
  20941. - A few minor bugs were fixed.
  20942. 9. A few improvements have been made to the handling of command line
  20943. options (but it's still not finished).
  20944. 10. Lots of minor bug fixes in most of the language modules have been
  20945. made.
  20946. 11. Filenames have been changed to 8.3 for compatibility with a SWIG
  20947. port to non-unix platforms (work in progress).
  20948. 12. C++ file suffix is now .cxx (for same reason).
  20949. 13. The documentation has been upgraded significantly and is now
  20950. around 100 pages. I added new examples and a section on
  20951. C++. The documentation now includes a Table of Contents.
  20952. 14. The SWIG Examples directory is still woefully sparse, but is
  20953. getting better.
  20954. Special notice about C++
  20955. ------------------------
  20956. This is the first version of SWIG to support C++ parsing. Currently
  20957. the C++ is far from complete, but seems to work for simple cases.
  20958. No work has been done to add special C++ processing to any of
  20959. the target languages. See the user manual for details about how
  20960. C++ is handled. If you find problems with the C++ implementation,
  20961. please let me know. Expect major improvements in this area.
  20962. Note : I have only successfully used SWIG and C++ with Tcl and
  20963. Python.
  20964. Notice about Version 1.0Final
  20965. -----------------------------
  20966. Version 1.0B3 is the last Beta release before version 1.0 Final is
  20967. released. I have frozen the list of features supported in version 1.0
  20968. and will only fix bugs as they show up. Work on SWIG version 2.0 is
  20969. already in progress, but is going to result in rather significant
  20970. changes to SWIG's internal structure (hopefully for the better). No
  20971. anticipated date for version 2.0 is set, but if you've got an idea,
  20972. let me know.
  20973. Version 1.0 Beta 2 (April 26, 1996)
  20974. ===================================
  20975. This release is identical to Beta1 except a few minor bugs are
  20976. fixed and the SWIG library has been updated to work with Tcl 7.5/Tk 4.1.
  20977. A tcl7.5 examples directory is now included.
  20978. - Fixed a bug in the Makefile that didn't install the libraries
  20979. correctly.
  20980. - SWIG Library files are now updated to work with Tcl 7.5 and Tk 4.1.
  20981. - Minor bug fixes in other modules.
  20982. Version 1.0 Beta 1 (April 10, 1996).
  20983. =====================================
  20984. This is the first "semi-official" release of SWIG. It has a
  20985. number of substantial improvements over the Alpha release. These
  20986. notes are in no particular order--hope I remembered everything....
  20987. 1. Tcl/Tk
  20988. SWIG is known to work with Tcl7.3, Tk3.6 and later versions.
  20989. I've also tested SWIG with expect-5.19.
  20990. Normally SWIG expects to use the header files "tcl.h" and "tk.h".
  20991. Newer versions of Tcl/Tk use version numbers. You can specify these
  20992. in SWIG as follows :
  20993. % wrap -htcl tcl7.4.h -htk tk4.0.h example.i
  20994. Of course, I prefer to simply set up symbolic links between "tcl.h" and
  20995. the most recent stable version on the machine.
  20996. 2. Perl4
  20997. This implementation has been based on Perl-4.035. SWIG's interface to
  20998. Perl4 is based on the documentation provided in the "Programming Perl"
  20999. book by Larry Wall, and files located in the "usub" directory of the
  21000. Perl4 distribution.
  21001. In order to compile with Perl4, you'll need to link with the uperl.o
  21002. file found in the Perl4 source directory. You may want to move this
  21003. file to a more convenient location.
  21004. 3. Perl5
  21005. This is a somewhat experimental implementation, but is alot less
  21006. buggy than the alpha release. SWIG operates independently of
  21007. the XS language and xsubpp supplied with Perl5. Currently SWIG
  21008. produces the necessary C code and .pm file needed to dynamically
  21009. load a module into Perl5.
  21010. To support Perl5's notion of modules and packages (as with xsubpp),
  21011. you can use the following command line options :
  21012. % wrap -perl5 -module MyModule -package MyPackage example.i
  21013. Note : In order for dynamic loading to be effective, you need to be
  21014. careful about naming. For a module named "MyModule", you'll need to
  21015. create a shared object file called "MyModule.so" using something like
  21016. % ld -shared my_obj.o -o MyModule.so
  21017. The use of the %init directive must match the module name since Perl5
  21018. calls a function "boot_ModuleName" in order to initialize things.
  21019. See the Examples directory for some examples of how to get things
  21020. to work.
  21021. 4. Python1.3
  21022. This is the first release supporting Python. The Python port is
  21023. experimental and may be rewritten. Variable linkage is done through
  21024. functions which is sort of a kludge. I also think it would be nice
  21025. to import SWIG pointers into Python as a new object (instead of strings).
  21026. Of course, this needs a little more work.
  21027. 5. Guile3
  21028. If you really want to live on the edge, pick up a copy of Guile-iii and
  21029. play around with this. This is highly experimental---especially since
  21030. I'm not sure what the official state of Guile is these days. This
  21031. implementation may change at any time should I suddenly figure out better
  21032. ways to do things.
  21033. 6. Extending SWIG
  21034. SWIG is written in C++ although I tend to think of the code as mostly
  21035. being ANSI C with a little inheritance thrown in. Each target language
  21036. is implemented as a C++ class that can be plugged into the system.
  21037. If you want to add your own modifications, see Appendix C of the user
  21038. manual. Then take a look at the "user" directory which contains some
  21039. code for building your own extenions.
  21040. 7. The SWIG library
  21041. The SWIG library is still incomplete. Some of the files mentioned in
  21042. the user manual are unavailable. These files will be made available
  21043. when they are ready. Subscribe to the SWIG mailing list for announcements
  21044. and updates.
  21045. 8. SWIG Documentation
  21046. I have sometimes experienced problems viewing the SWIG documentation in
  21047. some postscript viewers. However, the documentation seems to print
  21048. normally. I'm working on making much of the documentation online,
  21049. but this takes time.
  21050. Version 0.1 Alpha (February 9, 1996)
  21051. ====================================
  21052. 1. Run-time type-checking of SWIG pointers. Pointers are now represented
  21053. as strings with both numeric and encoded type information. This makes
  21054. it a little harder to shoot yourself in the foot (and it eliminates
  21055. some segmentation faults and other oddities).
  21056. 2. Python 1.3 now supported.
  21057. 3. #define and enum can be used to install constants.
  21058. 4. Completely rewrote the %include directive and made it alot more powerful.
  21059. 5. Restructured the SWIG library to make it work better.
  21060. 6. Various bug fixes to Tcl, Perl4, Perl5, and Guile implementations.
  21061. 7. Better implementation of %typedef directive.
  21062. 8. Made some changes to SWIG's class structure to make it easier to expand.
  21063. SWIG is now built into a library file that you can use to make your
  21064. own extenions.
  21065. 9. Made extensive changes to the documentation.
  21066. 10. Minor changes to the SWIG parser to make it use less memory.
  21067. Also took out some extraneous rules that were undocumented and
  21068. didn't work in the first place.
  21069. 11. The SWIG library files "tclsh", "wish", "expect", etc... in the first
  21070. release have been restructured and renamed to "tclsh.i", "wish.i",
  21071. and so on.