files.pas 44 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462
  1. {
  2. $Id$
  3. Copyright (c) 1996-98 by Florian Klaempfl
  4. This unit implements an extended file management and the first loading
  5. and searching of the modules (ppufiles)
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2 of the License, or
  9. (at your option) any later version.
  10. This program is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with this program; if not, write to the Free Software
  16. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17. ****************************************************************************
  18. }
  19. unit files;
  20. {$ifdef TP}
  21. {$V+}
  22. {$endif}
  23. interface
  24. uses
  25. globtype,
  26. cobjects,globals,ppu;
  27. const
  28. {$ifdef FPC}
  29. maxunits = 1024;
  30. InputFileBufSize=32*1024;
  31. linebufincrease=512;
  32. {$else}
  33. maxunits = 128;
  34. InputFileBufSize=1024;
  35. linebufincrease=64;
  36. {$endif}
  37. type
  38. {$ifdef FPC}
  39. tlongintarr = array[0..1000000] of longint;
  40. {$else}
  41. tlongintarr = array[0..16000] of longint;
  42. {$endif}
  43. plongintarr = ^tlongintarr;
  44. pinputfile = ^tinputfile;
  45. tinputfile = object
  46. path,name : pstring; { path and filename }
  47. next : pinputfile; { next file for reading }
  48. f : file; { current file handle }
  49. is_macro,
  50. endoffile, { still bytes left to read }
  51. closed : boolean; { is the file closed }
  52. buf : pchar; { buffer }
  53. bufstart, { buffer start position in the file }
  54. bufsize, { amount of bytes in the buffer }
  55. maxbufsize : longint; { size in memory for the buffer }
  56. saveinputpointer : pchar; { save fields for scanner variables }
  57. savelastlinepos,
  58. saveline_no : longint;
  59. linebuf : plongintarr; { line buffer to retrieve lines }
  60. maxlinebuf : longint;
  61. ref_count : longint; { to handle the browser refs }
  62. ref_index : longint;
  63. ref_next : pinputfile;
  64. constructor init(const fn:string);
  65. destructor done;
  66. procedure setpos(l:longint);
  67. procedure seekbuf(fpos:longint);
  68. procedure readbuf;
  69. function open:boolean;
  70. procedure close;
  71. procedure tempclose;
  72. function tempopen:boolean;
  73. procedure setmacro(p:pchar;len:longint);
  74. procedure setline(line,linepos:longint);
  75. function getlinestr(l:longint):string;
  76. end;
  77. pfilemanager = ^tfilemanager;
  78. tfilemanager = object
  79. files : pinputfile;
  80. last_ref_index : longint;
  81. cacheindex : longint;
  82. cacheinputfile : pinputfile;
  83. constructor init;
  84. destructor done;
  85. procedure register_file(f : pinputfile);
  86. procedure inverse_register_indexes;
  87. function get_file(l:longint) : pinputfile;
  88. function get_file_name(l :longint):string;
  89. function get_file_path(l :longint):string;
  90. end;
  91. type
  92. {$ifndef NEWMAP}
  93. tunitmap = array[0..maxunits-1] of pointer;
  94. punitmap = ^tunitmap;
  95. pmodule = ^tmodule;
  96. {$else NEWMAP}
  97. pmodule = ^tmodule;
  98. tunitmap = array[0..maxunits-1] of pmodule;
  99. punitmap = ^tunitmap;
  100. {$endif NEWMAP}
  101. tmodule = object(tlinkedlist_item)
  102. ppufile : pppufile; { the PPU file }
  103. crc,
  104. flags : longint; { the PPU flags }
  105. compiled, { unit is already compiled }
  106. do_assemble, { only assemble the object, don't recompile }
  107. do_compile, { need to compile the sources }
  108. sources_avail, { if all sources are reachable }
  109. is_unit,
  110. in_second_compile, { is this unit being compiled for the 2nd time? }
  111. in_implementation, { processing the implementation part? }
  112. in_global : boolean; { allow global settings }
  113. islibrary : boolean; { if it is a library (win32 dll) }
  114. map : punitmap; { mapping of all used units }
  115. unitcount : word; { local unit counter }
  116. unit_index : word; { global counter for browser }
  117. globalsymtable, { pointer to the local/static symtable of this unit }
  118. localsymtable : pointer; { pointer to the psymtable of this unit }
  119. scanner : pointer; { scanner object used }
  120. loaded_from : pmodule;
  121. uses_imports : boolean; { Set if the module imports from DLL's.}
  122. imports : plinkedlist;
  123. _exports : plinkedlist;
  124. sourcefiles : pfilemanager;
  125. resourcefiles,
  126. linksharedlibs,
  127. linkstaticlibs,
  128. linkunitfiles,
  129. linkofiles : tstringcontainer;
  130. used_units : tlinkedlist;
  131. path, { path where the module is find/created }
  132. outpath,
  133. modulename, { name of the module in uppercase }
  134. objfilename, { fullname of the objectfile }
  135. asmfilename, { fullname of the assemblerfile }
  136. ppufilename, { fullname of the ppufile }
  137. staticlibfilename, { fullname of the static libraryfile }
  138. sharedlibfilename, { fullname of the shared libraryfile }
  139. exefilename, { fullname of the exefile }
  140. asmprefix, { prefix for the smartlink asmfiles }
  141. mainsource : pstring; { name of the main sourcefile }
  142. constructor init(const s:string;_is_unit:boolean);
  143. destructor done;virtual;
  144. procedure reset;
  145. procedure setfilename(const fn:string;allowoutput:boolean);
  146. function openppu:boolean;
  147. function search_unit(const n : string;onlysource:boolean):boolean;
  148. end;
  149. pused_unit = ^tused_unit;
  150. tused_unit = object(tlinkedlist_item)
  151. unitid : word;
  152. name : pstring;
  153. checksum : longint;
  154. loaded : boolean;
  155. in_uses,
  156. in_interface,
  157. is_stab_written : boolean;
  158. u : pmodule;
  159. constructor init(_u : pmodule;intface:boolean);
  160. constructor init_to_load(const n:string;c:longint;intface:boolean);
  161. destructor done;virtual;
  162. end;
  163. var
  164. main_module : pmodule; { Main module of the program }
  165. current_module : pmodule; { Current module which is compiled }
  166. current_ppu : pppufile; { Current ppufile which is read }
  167. global_unit_count : word;
  168. usedunits : tlinkedlist; { Used units for this program }
  169. loaded_units : tlinkedlist; { All loaded units }
  170. function get_source_file(moduleindex,fileindex : word) : pinputfile;
  171. implementation
  172. uses
  173. dos,verbose,systems,
  174. symtable,scanner;
  175. {****************************************************************************
  176. TINPUTFILE
  177. ****************************************************************************}
  178. constructor tinputfile.init(const fn:string);
  179. var
  180. p:dirstr;
  181. n:namestr;
  182. e:extstr;
  183. begin
  184. FSplit(fn,p,n,e);
  185. name:=stringdup(n+e);
  186. path:=stringdup(p);
  187. next:=nil;
  188. { file info }
  189. is_macro:=false;
  190. endoffile:=false;
  191. closed:=true;
  192. buf:=nil;
  193. bufstart:=0;
  194. bufsize:=0;
  195. maxbufsize:=InputFileBufSize;
  196. { save fields }
  197. saveinputpointer:=nil;
  198. saveline_no:=0;
  199. savelastlinepos:=0;
  200. { indexing refs }
  201. ref_next:=nil;
  202. ref_count:=0;
  203. ref_index:=0;
  204. { line buffer }
  205. linebuf:=nil;
  206. maxlinebuf:=0;
  207. end;
  208. destructor tinputfile.done;
  209. begin
  210. if not closed then
  211. close;
  212. stringdispose(path);
  213. stringdispose(name);
  214. { free memory }
  215. if assigned(linebuf) then
  216. freemem(linebuf,maxlinebuf shl 2);
  217. end;
  218. procedure tinputfile.setpos(l:longint);
  219. begin
  220. bufstart:=l;
  221. end;
  222. procedure tinputfile.seekbuf(fpos:longint);
  223. begin
  224. if closed then
  225. exit;
  226. seek(f,fpos);
  227. bufstart:=fpos;
  228. bufsize:=0;
  229. end;
  230. procedure tinputfile.readbuf;
  231. {$ifdef TP}
  232. var
  233. w : word;
  234. {$endif}
  235. begin
  236. if is_macro then
  237. endoffile:=true;
  238. if closed then
  239. exit;
  240. inc(bufstart,bufsize);
  241. {$ifdef TP}
  242. blockread(f,buf^,maxbufsize-1,w);
  243. bufsize:=w;
  244. {$else}
  245. blockread(f,buf^,maxbufsize-1,bufsize);
  246. {$endif}
  247. buf[bufsize]:=#0;
  248. endoffile:=eof(f);
  249. end;
  250. function tinputfile.open:boolean;
  251. var
  252. ofm : byte;
  253. begin
  254. open:=false;
  255. if not closed then
  256. Close;
  257. ofm:=filemode;
  258. filemode:=0;
  259. Assign(f,path^+name^);
  260. {$I-}
  261. reset(f,1);
  262. {$I+}
  263. filemode:=ofm;
  264. if ioresult<>0 then
  265. exit;
  266. { file }
  267. endoffile:=false;
  268. closed:=false;
  269. Getmem(buf,MaxBufsize);
  270. bufstart:=0;
  271. bufsize:=0;
  272. open:=true;
  273. end;
  274. procedure tinputfile.close;
  275. var
  276. i : word;
  277. begin
  278. if is_macro then
  279. begin
  280. if assigned(buf) then
  281. Freemem(buf,maxbufsize);
  282. buf:=nil;
  283. {is_macro:=false;
  284. still needed for dispose in scanner PM }
  285. closed:=true;
  286. exit;
  287. end;
  288. if not closed then
  289. begin
  290. {$I-}
  291. system.close(f);
  292. {$I+}
  293. i:=ioresult;
  294. closed:=true;
  295. end;
  296. if assigned(buf) then
  297. begin
  298. Freemem(buf,maxbufsize);
  299. buf:=nil;
  300. end;
  301. bufstart:=0;
  302. end;
  303. procedure tinputfile.tempclose;
  304. var
  305. i : word;
  306. begin
  307. if is_macro then
  308. exit;
  309. if not closed then
  310. begin
  311. {$I-}
  312. system.close(f);
  313. {$I+}
  314. i:=ioresult;
  315. Freemem(buf,maxbufsize);
  316. buf:=nil;
  317. closed:=true;
  318. end;
  319. end;
  320. function tinputfile.tempopen:boolean;
  321. var
  322. ofm : byte;
  323. begin
  324. tempopen:=false;
  325. if is_macro then
  326. begin
  327. tempopen:=true;
  328. exit;
  329. end;
  330. if not closed then
  331. exit;
  332. ofm:=filemode;
  333. filemode:=0;
  334. Assign(f,path^+name^);
  335. {$I-}
  336. reset(f,1);
  337. {$I+}
  338. filemode:=ofm;
  339. if ioresult<>0 then
  340. exit;
  341. closed:=false;
  342. { get new mem }
  343. Getmem(buf,maxbufsize);
  344. { restore state }
  345. seek(f,BufStart);
  346. bufsize:=0;
  347. readbuf;
  348. tempopen:=true;
  349. end;
  350. procedure tinputfile.setmacro(p:pchar;len:longint);
  351. begin
  352. { create new buffer }
  353. getmem(buf,len+1);
  354. move(p^,buf^,len);
  355. buf[len]:=#0;
  356. { reset }
  357. bufstart:=0;
  358. bufsize:=len;
  359. maxbufsize:=len+1;
  360. is_macro:=true;
  361. endoffile:=true;
  362. closed:=true;
  363. end;
  364. procedure tinputfile.setline(line,linepos:longint);
  365. var
  366. oldlinebuf : plongintarr;
  367. begin
  368. if line<1 then
  369. exit;
  370. while (line>=maxlinebuf) do
  371. begin
  372. oldlinebuf:=linebuf;
  373. { create new linebuf and move old info }
  374. getmem(linebuf,(maxlinebuf+linebufincrease) shl 2);
  375. if assigned(oldlinebuf) then
  376. begin
  377. move(oldlinebuf^,linebuf^,maxlinebuf shl 2);
  378. freemem(oldlinebuf,maxlinebuf shl 2);
  379. end;
  380. fillchar(linebuf^[maxlinebuf],linebufincrease shl 2,0);
  381. inc(maxlinebuf,linebufincrease);
  382. end;
  383. linebuf^[line]:=linepos;
  384. end;
  385. function tinputfile.getlinestr(l:longint):string;
  386. var
  387. c : char;
  388. i,
  389. fpos : longint;
  390. p : pchar;
  391. begin
  392. getlinestr:='';
  393. if l<maxlinebuf then
  394. begin
  395. fpos:=linebuf^[l];
  396. { fpos is set negativ if the line was already written }
  397. { but we still know the correct value }
  398. if fpos<0 then
  399. fpos:=-fpos+1;
  400. if closed then
  401. open;
  402. { in current buf ? }
  403. if (fpos<bufstart) or (fpos>bufstart+bufsize) then
  404. begin
  405. seekbuf(fpos);
  406. readbuf;
  407. end;
  408. { the begin is in the buf now simply read until #13,#10 }
  409. i:=0;
  410. p:=@buf[fpos-bufstart];
  411. repeat
  412. c:=p^;
  413. if c=#0 then
  414. begin
  415. if endoffile then
  416. break;
  417. readbuf;
  418. p:=buf;
  419. c:=p^;
  420. end;
  421. if c in [#10,#13] then
  422. break;
  423. inc(i);
  424. getlinestr[i]:=c;
  425. inc(longint(p));
  426. until (i=255);
  427. {$ifndef TP}
  428. {$ifopt H+}
  429. setlength(getlinestr,i);
  430. {$else}
  431. getlinestr[0]:=chr(i);
  432. {$endif}
  433. {$else}
  434. getlinestr[0]:=chr(i);
  435. {$endif}
  436. end;
  437. end;
  438. {****************************************************************************
  439. TFILEMANAGER
  440. ****************************************************************************}
  441. constructor tfilemanager.init;
  442. begin
  443. files:=nil;
  444. last_ref_index:=0;
  445. cacheindex:=0;
  446. cacheinputfile:=nil;
  447. end;
  448. destructor tfilemanager.done;
  449. var
  450. hp : pinputfile;
  451. begin
  452. hp:=files;
  453. while assigned(hp) do
  454. begin
  455. files:=files^.ref_next;
  456. dispose(hp,done);
  457. hp:=files;
  458. end;
  459. last_ref_index:=0;
  460. end;
  461. procedure tfilemanager.register_file(f : pinputfile);
  462. begin
  463. inc(last_ref_index);
  464. f^.ref_next:=files;
  465. f^.ref_index:=last_ref_index;
  466. files:=f;
  467. { update cache }
  468. cacheindex:=last_ref_index;
  469. cacheinputfile:=f;
  470. {$ifdef FPC}
  471. {$ifdef heaptrc}
  472. writeln(stderr,f^.name^,' index ',current_module^.unit_index*100000+f^.ref_index);
  473. {$endif heaptrc}
  474. {$endif FPC}
  475. end;
  476. { this procedure is necessary after loading the
  477. sources files from a PPU file PM }
  478. procedure tfilemanager.inverse_register_indexes;
  479. var
  480. f : pinputfile;
  481. begin
  482. f:=files;
  483. while assigned(f) do
  484. begin
  485. f^.ref_index:=last_ref_index-f^.ref_index+1;
  486. f:=f^.ref_next;
  487. end;
  488. { reset cache }
  489. cacheindex:=0;
  490. cacheinputfile:=nil;
  491. end;
  492. function tfilemanager.get_file(l :longint) : pinputfile;
  493. var
  494. ff : pinputfile;
  495. begin
  496. { check cache }
  497. if (l=cacheindex) and assigned(cacheinputfile) then
  498. begin
  499. get_file:=cacheinputfile;
  500. exit;
  501. end;
  502. ff:=files;
  503. while assigned(ff) and (ff^.ref_index<>l) do
  504. ff:=ff^.ref_next;
  505. get_file:=ff;
  506. end;
  507. function tfilemanager.get_file_name(l :longint):string;
  508. var
  509. hp : pinputfile;
  510. begin
  511. hp:=get_file(l);
  512. if assigned(hp) then
  513. get_file_name:=hp^.name^
  514. else
  515. get_file_name:='';
  516. end;
  517. function tfilemanager.get_file_path(l :longint):string;
  518. var
  519. hp : pinputfile;
  520. begin
  521. hp:=get_file(l);
  522. if assigned(hp) then
  523. get_file_path:=hp^.path^
  524. else
  525. get_file_path:='';
  526. end;
  527. function get_source_file(moduleindex,fileindex : word) : pinputfile;
  528. var
  529. hp : pmodule;
  530. f : pinputfile;
  531. begin
  532. hp:=pmodule(loaded_units.first);
  533. while assigned(hp) and (hp^.unit_index<>moduleindex) do
  534. hp:=pmodule(hp^.next);
  535. get_source_file:=nil;
  536. if not assigned(hp) then
  537. exit;
  538. f:=pinputfile(hp^.sourcefiles^.files);
  539. while assigned(f) do
  540. begin
  541. if f^.ref_index=fileindex then
  542. begin
  543. get_source_file:=f;
  544. exit;
  545. end;
  546. f:=pinputfile(f^.ref_next);
  547. end;
  548. end;
  549. {****************************************************************************
  550. TMODULE
  551. ****************************************************************************}
  552. procedure tmodule.setfilename(const fn:string;allowoutput:boolean);
  553. var
  554. p : dirstr;
  555. n : NameStr;
  556. e : ExtStr;
  557. begin
  558. stringdispose(objfilename);
  559. stringdispose(asmfilename);
  560. stringdispose(ppufilename);
  561. stringdispose(staticlibfilename);
  562. stringdispose(sharedlibfilename);
  563. stringdispose(exefilename);
  564. stringdispose(outpath);
  565. stringdispose(path);
  566. { Create names }
  567. fsplit(fn,p,n,e);
  568. n:=FixFileName(n);
  569. { set path }
  570. path:=stringdup(FixPath(p,false));
  571. { obj,asm,ppu names }
  572. p:=path^;
  573. if AllowOutput then
  574. begin
  575. if (OutputUnitDir<>'') then
  576. p:=OutputUnitDir
  577. else
  578. if (OutputExeDir<>'') then
  579. p:=OutputExeDir;
  580. end;
  581. outpath:=stringdup(p);
  582. objfilename:=stringdup(p+n+target_info.objext);
  583. asmfilename:=stringdup(p+n+target_info.asmext);
  584. ppufilename:=stringdup(p+n+target_info.unitext);
  585. { lib and exe could be loaded with a file specified with -o }
  586. if AllowOutput and (OutputFile<>'') then
  587. n:=OutputFile;
  588. staticlibfilename:=stringdup(p+target_os.libprefix+n+target_os.staticlibext);
  589. if target_info.target=target_i386_WIN32 then
  590. sharedlibfilename:=stringdup(p+n+target_os.sharedlibext)
  591. else
  592. sharedlibfilename:=stringdup(p+target_os.libprefix+n+target_os.sharedlibext);
  593. { output dir of exe can be specified separatly }
  594. if AllowOutput and (OutputExeDir<>'') then
  595. p:=OutputExeDir
  596. else
  597. p:=path^;
  598. exefilename:=stringdup(p+n+target_info.exeext);
  599. end;
  600. function tmodule.openppu:boolean;
  601. var
  602. objfiletime,
  603. ppufiletime,
  604. asmfiletime : longint;
  605. begin
  606. openppu:=false;
  607. Message1(unit_t_ppu_loading,ppufilename^);
  608. { Get ppufile time (also check if the file exists) }
  609. ppufiletime:=getnamedfiletime(ppufilename^);
  610. if ppufiletime=-1 then
  611. exit;
  612. { Open the ppufile }
  613. Message1(unit_u_ppu_name,ppufilename^);
  614. ppufile:=new(pppufile,init(ppufilename^));
  615. ppufile^.change_endian:=source_os.endian<>target_os.endian;
  616. if not ppufile^.open then
  617. begin
  618. dispose(ppufile,done);
  619. Message(unit_u_ppu_file_too_short);
  620. exit;
  621. end;
  622. { check for a valid PPU file }
  623. if not ppufile^.CheckPPUId then
  624. begin
  625. dispose(ppufile,done);
  626. Message(unit_u_ppu_invalid_header);
  627. exit;
  628. end;
  629. { check for allowed PPU versions }
  630. if not (ppufile^.GetPPUVersion = 15) then
  631. begin
  632. dispose(ppufile,done);
  633. Message1(unit_u_ppu_invalid_version,tostr(ppufile^.GetPPUVersion));
  634. exit;
  635. end;
  636. { check the target processor }
  637. if ttargetcpu(ppufile^.header.cpu)<>target_cpu then
  638. begin
  639. dispose(ppufile,done);
  640. Message(unit_u_ppu_invalid_processor);
  641. exit;
  642. end;
  643. { check target }
  644. if ttarget(ppufile^.header.target)<>target_info.target then
  645. begin
  646. dispose(ppufile,done);
  647. Message(unit_u_ppu_invalid_target);
  648. exit;
  649. end;
  650. { Load values to be access easier }
  651. flags:=ppufile^.header.flags;
  652. crc:=ppufile^.header.checksum;
  653. { Show Debug info }
  654. Message1(unit_u_ppu_time,filetimestring(ppufiletime));
  655. Message1(unit_u_ppu_flags,tostr(flags));
  656. Message1(unit_u_ppu_crc,tostr(ppufile^.header.checksum));
  657. { check the object and assembler file to see if we need only to
  658. assemble, only if it's not in a library }
  659. do_compile:=false;
  660. if (flags and uf_in_library)=0 then
  661. begin
  662. if ((flags and uf_static_linked)<>0) or
  663. ((flags and uf_smartlink)<>0) then
  664. begin
  665. objfiletime:=getnamedfiletime(staticlibfilename^);
  666. Message2(unit_u_check_time,staticlibfilename^,filetimestring(objfiletime));
  667. if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
  668. begin
  669. Message(unit_u_recompile_staticlib_is_older);
  670. do_compile:=true;
  671. exit;
  672. end;
  673. end
  674. else
  675. if (flags and uf_shared_linked)<>0 then
  676. begin
  677. objfiletime:=getnamedfiletime(sharedlibfilename^);
  678. Message2(unit_u_check_time,sharedlibfilename^,filetimestring(objfiletime));
  679. if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
  680. begin
  681. Message(unit_u_recompile_sharedlib_is_older);
  682. do_compile:=true;
  683. exit;
  684. end;
  685. end
  686. else
  687. begin
  688. { the objectfile should be newer than the ppu file }
  689. objfiletime:=getnamedfiletime(objfilename^);
  690. Message2(unit_u_check_time,objfilename^,filetimestring(objfiletime));
  691. if (ppufiletime<0) or (objfiletime<0) or (ppufiletime>objfiletime) then
  692. begin
  693. { check if assembler file is older than ppu file }
  694. asmfileTime:=GetNamedFileTime(asmfilename^);
  695. Message2(unit_u_check_time,asmfilename^,filetimestring(asmfiletime));
  696. if (asmfiletime<0) or (ppufiletime>asmfiletime) then
  697. begin
  698. Message(unit_u_recompile_obj_and_asm_older);
  699. do_compile:=true;
  700. exit;
  701. end
  702. else
  703. begin
  704. Message(unit_u_recompile_obj_older_than_asm);
  705. if not(cs_asm_extern in aktglobalswitches) then
  706. begin
  707. do_compile:=true;
  708. exit;
  709. end;
  710. end;
  711. end;
  712. end;
  713. end;
  714. openppu:=true;
  715. end;
  716. function tmodule.search_unit(const n : string;onlysource:boolean):boolean;
  717. var
  718. ext : string[8];
  719. singlepathstring,
  720. unitPath,
  721. filename : string;
  722. found : boolean;
  723. start,i : longint;
  724. Function UnitExists(const ext:string):boolean;
  725. begin
  726. Message1(unit_t_unitsearch,Singlepathstring+filename+ext);
  727. UnitExists:=FileExists(Singlepathstring+FileName+ext);
  728. end;
  729. begin
  730. start:=1;
  731. filename:=FixFileName(n);
  732. unitpath:=UnitSearchPath;
  733. Found:=false;
  734. repeat
  735. { Create current path to check }
  736. i:=pos(';',unitpath);
  737. if i=0 then
  738. i:=length(unitpath)+1;
  739. singlepathstring:=FixPath(copy(unitpath,start,i-start),false);
  740. delete(unitpath,start,i-start+1);
  741. if not onlysource then
  742. begin
  743. { Check for PPL file }
  744. if not Found then
  745. begin
  746. Found:=UnitExists(target_info.unitlibext);
  747. if Found then
  748. Begin
  749. SetFileName(SinglePathString+FileName,false);
  750. Found:=OpenPPU;
  751. End;
  752. end;
  753. { Check for PPU file }
  754. if not Found then
  755. begin
  756. Found:=UnitExists(target_info.unitext);
  757. if Found then
  758. Begin
  759. SetFileName(SinglePathString+FileName,false);
  760. Found:=OpenPPU;
  761. End;
  762. end;
  763. end;
  764. { Check for Sources }
  765. if not Found then
  766. begin
  767. ppufile:=nil;
  768. do_compile:=true;
  769. {Check for .pp file}
  770. Found:=UnitExists(target_os.sourceext);
  771. if Found then
  772. Ext:=target_os.sourceext
  773. else
  774. begin
  775. {Check for .pas}
  776. Found:=UnitExists(target_os.pasext);
  777. if Found then
  778. Ext:=target_os.pasext;
  779. end;
  780. stringdispose(mainsource);
  781. if Found then
  782. begin
  783. sources_avail:=true;
  784. {Load Filenames when found}
  785. mainsource:=StringDup(SinglePathString+FileName+Ext);
  786. SetFileName(SinglePathString+FileName,false);
  787. end
  788. else
  789. sources_avail:=false;
  790. end;
  791. until Found or (unitpath='');
  792. search_unit:=Found;
  793. end;
  794. procedure tmodule.reset;
  795. begin
  796. if assigned(scanner) then
  797. pscannerfile(scanner)^.invalid:=true;
  798. if assigned(globalsymtable) then
  799. begin
  800. dispose(punitsymtable(globalsymtable),done);
  801. globalsymtable:=nil;
  802. end;
  803. if assigned(localsymtable) then
  804. begin
  805. dispose(punitsymtable(localsymtable),done);
  806. localsymtable:=nil;
  807. end;
  808. if assigned(map) then
  809. begin
  810. dispose(map);
  811. map:=nil;
  812. end;
  813. if assigned(ppufile) then
  814. begin
  815. dispose(ppufile,done);
  816. ppufile:=nil;
  817. end;
  818. sourcefiles^.done;
  819. sourcefiles^.init;
  820. imports^.done;
  821. imports^.init;
  822. _exports^.done;
  823. _exports^.init;
  824. used_units.done;
  825. used_units.init;
  826. resourcefiles.done;
  827. resourcefiles.init_no_double;
  828. linkunitfiles.done;
  829. linkunitfiles.init_no_double;
  830. linkofiles.done;
  831. linkofiles.init_no_double;
  832. linkstaticlibs.done;
  833. linkstaticlibs.init_no_double;
  834. linksharedlibs.done;
  835. linksharedlibs.init_no_double;
  836. uses_imports:=false;
  837. do_assemble:=false;
  838. do_compile:=false;
  839. { sources_avail:=true;
  840. should not be changed PM }
  841. compiled:=false;
  842. in_implementation:=false;
  843. in_global:=true;
  844. loaded_from:=nil;
  845. flags:=0;
  846. crc:=0;
  847. unitcount:=1;
  848. end;
  849. constructor tmodule.init(const s:string;_is_unit:boolean);
  850. var
  851. p : dirstr;
  852. n : namestr;
  853. e : extstr;
  854. begin
  855. FSplit(s,p,n,e);
  856. { Programs have the name program to don't conflict with dup id's }
  857. if _is_unit then
  858. modulename:=stringdup(Upper(n))
  859. else
  860. modulename:=stringdup('PROGRAM');
  861. mainsource:=stringdup(s);
  862. ppufilename:=nil;
  863. objfilename:=nil;
  864. asmfilename:=nil;
  865. staticlibfilename:=nil;
  866. sharedlibfilename:=nil;
  867. exefilename:=nil;
  868. outpath:=nil;
  869. { Dos has the famous 8.3 limit :( }
  870. {$ifdef tp}
  871. asmprefix:=stringdup(FixFileName('as'));
  872. {$else}
  873. {$ifdef go32v2}
  874. asmprefix:=stringdup(FixFileName('as'));
  875. {$else}
  876. {$ifdef OS2}
  877. {Allthough OS/2 supports long filenames I play it safe and
  878. use 8.3 filenames, because this allows the compiler to run
  879. on a FAT partition. (DM)}
  880. asmprefix:=stringdup(FixFileName('as'));
  881. {$else}
  882. asmprefix:=stringdup(FixFileName(n));
  883. {$endif}
  884. {$endif}
  885. {$endif tp}
  886. path:=nil;
  887. setfilename(p+n,true);
  888. used_units.init;
  889. new(sourcefiles,init);
  890. resourcefiles.init_no_double;
  891. linkunitfiles.init_no_double;
  892. linkofiles.init_no_double;
  893. linkstaticlibs.init_no_double;
  894. linksharedlibs.init_no_double;
  895. ppufile:=nil;
  896. scanner:=nil;
  897. map:=nil;
  898. globalsymtable:=nil;
  899. localsymtable:=nil;
  900. loaded_from:=nil;
  901. flags:=0;
  902. crc:=0;
  903. unitcount:=1;
  904. inc(global_unit_count);
  905. unit_index:=global_unit_count;
  906. do_assemble:=false;
  907. do_compile:=false;
  908. sources_avail:=true;
  909. compiled:=false;
  910. in_second_compile:=false;
  911. in_implementation:=false;
  912. in_global:=true;
  913. is_unit:=_is_unit;
  914. islibrary:=false;
  915. uses_imports:=false;
  916. imports:=new(plinkedlist,init);
  917. _exports:=new(plinkedlist,init);
  918. { search the PPU file if it is an unit }
  919. if is_unit then
  920. begin
  921. if (not search_unit(modulename^,false)) and (length(modulename^)>8) then
  922. search_unit(copy(modulename^,1,8),false);
  923. end;
  924. end;
  925. destructor tmodule.done;
  926. begin
  927. if assigned(map) then
  928. dispose(map);
  929. if assigned(ppufile) then
  930. dispose(ppufile,done);
  931. ppufile:=nil;
  932. if assigned(imports) then
  933. dispose(imports,done);
  934. imports:=nil;
  935. if assigned(_exports) then
  936. dispose(_exports,done);
  937. _exports:=nil;
  938. if assigned(scanner) then
  939. pscannerfile(scanner)^.invalid:=true;
  940. if assigned(sourcefiles) then
  941. dispose(sourcefiles,done);
  942. sourcefiles:=nil;
  943. used_units.done;
  944. resourcefiles.done;
  945. linkunitfiles.done;
  946. linkofiles.done;
  947. linkstaticlibs.done;
  948. linksharedlibs.done;
  949. stringdispose(objfilename);
  950. stringdispose(asmfilename);
  951. stringdispose(ppufilename);
  952. stringdispose(staticlibfilename);
  953. stringdispose(sharedlibfilename);
  954. stringdispose(exefilename);
  955. stringdispose(outpath);
  956. stringdispose(path);
  957. stringdispose(modulename);
  958. stringdispose(mainsource);
  959. stringdispose(asmprefix);
  960. if assigned(globalsymtable) then
  961. dispose(punitsymtable(globalsymtable),done);
  962. globalsymtable:=nil;
  963. if assigned(localsymtable) then
  964. dispose(punitsymtable(localsymtable),done);
  965. localsymtable:=nil;
  966. inherited done;
  967. end;
  968. {****************************************************************************
  969. TUSED_UNIT
  970. ****************************************************************************}
  971. constructor tused_unit.init(_u : pmodule;intface:boolean);
  972. begin
  973. u:=_u;
  974. in_interface:=intface;
  975. in_uses:=false;
  976. is_stab_written:=false;
  977. loaded:=true;
  978. name:=stringdup(_u^.modulename^);
  979. checksum:=_u^.crc;
  980. unitid:=0;
  981. end;
  982. constructor tused_unit.init_to_load(const n:string;c:longint;intface:boolean);
  983. begin
  984. u:=nil;
  985. in_interface:=intface;
  986. in_uses:=false;
  987. is_stab_written:=false;
  988. loaded:=false;
  989. name:=stringdup(n);
  990. checksum:=c;
  991. unitid:=0;
  992. end;
  993. destructor tused_unit.done;
  994. begin
  995. stringdispose(name);
  996. inherited done;
  997. end;
  998. end.
  999. {
  1000. $Log$
  1001. Revision 1.86 1999-02-05 08:54:24 pierre
  1002. + linkofiles splitted inot linkofiles and linkunitfiles
  1003. because linkofiles must be stored with directory
  1004. to enabled linking of different objects with same name
  1005. in a different directory
  1006. Revision 1.85 1999/01/14 21:47:11 peter
  1007. * status.currentmodule is now also updated
  1008. + status.currentsourcepath
  1009. Revision 1.84 1999/01/14 11:38:39 daniel
  1010. * Exe name derived from target_info instead of target_os
  1011. Revision 1.83 1999/01/13 15:02:00 daniel
  1012. * Tinputfile.readbuf eof bugfix
  1013. Revision 1.82 1999/01/12 14:25:26 peter
  1014. + BrowserLog for browser.log generation
  1015. + BrowserCol for browser info in TCollections
  1016. * released all other UseBrowser
  1017. Revision 1.81 1998/12/28 23:26:14 peter
  1018. + resource file handling ($R directive) for Win32
  1019. Revision 1.80 1998/12/16 00:27:19 peter
  1020. * removed some obsolete version checks
  1021. Revision 1.79 1998/12/11 00:03:14 peter
  1022. + globtype,tokens,version unit splitted from globals
  1023. Revision 1.78 1998/12/04 10:18:07 florian
  1024. * some stuff for procedures of object added
  1025. * bug with overridden virtual constructors fixed (reported by Italo Gomes)
  1026. Revision 1.77 1998/12/02 16:23:37 jonas
  1027. * changed "if longintvar in set" to case or "if () or () .." statements
  1028. * tree.pas: changed inlinenumber (and associated constructor/vars) to a byte
  1029. Revision 1.76 1998/12/01 12:51:19 peter
  1030. * fixed placing of ppas.sh and link.res when using -FE
  1031. Revision 1.75 1998/11/16 15:41:40 peter
  1032. * tp7 didn't like my ifopt H+ :(
  1033. Revision 1.74 1998/11/16 12:18:01 peter
  1034. * H+ fixes
  1035. Revision 1.73 1998/11/16 11:28:58 pierre
  1036. * stackcheck removed for i386_win32
  1037. * exportlist does not crash at least !!
  1038. (was need for tests dir !)z
  1039. Revision 1.72 1998/11/15 16:32:35 florian
  1040. * some stuff of Pavel implement (win32 dll creation)
  1041. * bug with ansistring function results fixed
  1042. Revision 1.71 1998/11/06 09:45:40 pierre
  1043. * bug on errors (file used after dispose !) fixed
  1044. Revision 1.70 1998/11/03 11:33:14 peter
  1045. + search_unit arg to only search for sources
  1046. Revision 1.69 1998/10/29 11:35:44 florian
  1047. * some dll support for win32
  1048. * fixed assembler writing for PalmOS
  1049. Revision 1.68 1998/10/27 10:22:34 florian
  1050. + First things for win32 export sections
  1051. Revision 1.67 1998/10/26 22:23:29 peter
  1052. + fixpath() has an extra option to allow a ./ as path
  1053. Revision 1.66 1998/10/19 18:07:11 peter
  1054. + external dll_name name func support for linux
  1055. Revision 1.65 1998/10/15 12:22:25 pierre
  1056. * close include files immediately after end reading
  1057. instead of waiting until unit compilation ended !
  1058. Revision 1.64 1998/10/14 13:38:19 peter
  1059. * fixed path with staticlib/objects in ppufiles
  1060. Revision 1.63 1998/10/14 11:02:49 daniel
  1061. * Stupid typo fixed.
  1062. Revision 1.62 1998/10/14 10:59:37 daniel
  1063. * Staticlibfilename now doesn't include path.
  1064. Revision 1.61 1998/10/14 10:57:25 daniel
  1065. * Dirstr, namestr, extstr.
  1066. * $V+ to prevent Peter from forgetting this.
  1067. * OS/2 compiler uses 8.3 filenames to support running the compiler on an old
  1068. DOS FAT partition.
  1069. Revision 1.60 1998/10/14 10:45:07 pierre
  1070. * ppu problems for m68k fixed (at least in cross compiling)
  1071. * one last memory leak for sysamiga fixed
  1072. * the amiga RTL compiles now completely !!
  1073. Revision 1.59 1998/10/13 14:01:07 peter
  1074. * fixed -al
  1075. Revision 1.58 1998/10/12 11:59:00 peter
  1076. + show name and date of .o and .s files which the compiler checks
  1077. Revision 1.57 1998/10/09 16:36:03 pierre
  1078. * some memory leaks specific to usebrowser define fixed
  1079. * removed tmodule.implsymtable (was like tmodule.localsymtable)
  1080. Revision 1.56 1998/10/09 08:56:26 pierre
  1081. * several memory leaks fixed
  1082. Revision 1.55 1998/10/08 23:28:54 peter
  1083. * -vu shows unit info, -vt shows tried/used files
  1084. Revision 1.54 1998/10/08 17:17:19 pierre
  1085. * current_module old scanner tagged as invalid if unit is recompiled
  1086. + added ppheap for better info on tracegetmem of heaptrc
  1087. (adds line column and file index)
  1088. * several memory leaks removed ith help of heaptrc !!
  1089. Revision 1.53 1998/10/08 13:48:43 peter
  1090. * fixed memory leaks for do nothing source
  1091. * fixed unit interdependency
  1092. Revision 1.52 1998/10/06 22:09:48 peter
  1093. * fixed for compiling with 0.99.8 due circular units
  1094. Revision 1.51 1998/10/06 17:16:47 pierre
  1095. * some memory leaks fixed (thanks to Peter for heaptrc !)
  1096. Revision 1.50 1998/09/30 16:43:34 peter
  1097. * fixed unit interdependency with circular uses
  1098. Revision 1.49 1998/09/28 16:57:20 pierre
  1099. * changed all length(p^.value_str^) into str_length(p)
  1100. to get it work with and without ansistrings
  1101. * changed sourcefiles field of tmodule to a pointer
  1102. Revision 1.48 1998/09/24 23:46:34 peter
  1103. + outputdir support
  1104. Revision 1.47 1998/09/22 17:13:43 pierre
  1105. + browsing updated and developed
  1106. records and objects fields are also stored
  1107. Revision 1.46 1998/09/21 08:45:10 pierre
  1108. + added vmt_offset in tobjectdef.write for fututre use
  1109. (first steps to have objects without vmt if no virtual !!)
  1110. + added fpu_used field for tabstractprocdef :
  1111. sets this level to 2 if the functions return with value in FPU
  1112. (is then set to correct value at parsing of implementation)
  1113. THIS MIGHT refuse some code with FPU expression too complex
  1114. that were accepted before and even in some cases
  1115. that don't overflow in fact
  1116. ( like if f : float; is a forward that finally in implementation
  1117. only uses one fpu register !!)
  1118. Nevertheless I think that it will improve security on
  1119. FPU operations !!
  1120. * most other changes only for UseBrowser code
  1121. (added symtable references for record and objects)
  1122. local switch for refs to args and local of each function
  1123. (static symtable still missing)
  1124. UseBrowser still not stable and probably broken by
  1125. the definition hash array !!
  1126. Revision 1.45 1998/09/18 09:58:51 peter
  1127. * -s doesn't require the .o to be available, this allows compiling of
  1128. everything on other platforms (profiling the windows.pp loading ;)
  1129. Revision 1.44 1998/09/10 13:51:32 peter
  1130. * tp compiler also uses 'as' as asmprefix
  1131. Revision 1.43 1998/09/03 17:08:45 pierre
  1132. * better lines for stabs
  1133. (no scroll back to if before else part
  1134. no return to case line at jump outside case)
  1135. + source lines also if not in order
  1136. Revision 1.42 1998/09/03 11:24:00 peter
  1137. * moved more inputfile things from tscannerfile to tinputfile
  1138. * changed ifdef Sourceline to cs_asm_source
  1139. Revision 1.41 1998/08/26 15:35:30 peter
  1140. * fixed scannerfiles for macros
  1141. + $I %<environment>%
  1142. Revision 1.40 1998/08/26 10:08:48 peter
  1143. * fixed problem with libprefix at the wrong place
  1144. * fixed lib generation with smartlinking and no -CS used
  1145. Revision 1.39 1998/08/25 16:44:16 pierre
  1146. * openppu was true even if the object file is missing
  1147. this lead to trying to open a filename without extension
  1148. and prevented the 'make cycle' to work for win32
  1149. Revision 1.38 1998/08/19 10:06:12 peter
  1150. * fixed filenames and removedir which supports slash at the end
  1151. Revision 1.37 1998/08/18 20:52:19 peter
  1152. * renamed in_main to in_global which is more logical
  1153. Revision 1.36 1998/08/17 10:10:07 peter
  1154. - removed OLDPPU
  1155. Revision 1.35 1998/08/17 09:17:44 peter
  1156. * static/shared linking updates
  1157. Revision 1.34 1998/08/14 21:56:31 peter
  1158. * setting the outputfile using -o works now to create static libs
  1159. Revision 1.33 1998/08/11 14:09:08 peter
  1160. * fixed some messages and smaller msgtxt.inc
  1161. Revision 1.32 1998/08/10 14:49:58 peter
  1162. + localswitches, moduleswitches, globalswitches splitting
  1163. Revision 1.31 1998/07/14 14:46:48 peter
  1164. * released NEWINPUT
  1165. Revision 1.30 1998/07/07 11:19:55 peter
  1166. + NEWINPUT for a better inputfile and scanner object
  1167. Revision 1.29 1998/06/25 10:51:00 pierre
  1168. * removed a remaining ifndef NEWPPU
  1169. replaced by ifdef OLDPPU
  1170. * added uf_finalize to ppu unit
  1171. Revision 1.28 1998/06/25 08:48:12 florian
  1172. * first version of rtti support
  1173. Revision 1.27 1998/06/24 14:48:34 peter
  1174. * ifdef newppu -> ifndef oldppu
  1175. Revision 1.26 1998/06/17 14:36:19 peter
  1176. * forgot an $ifndef OLDPPU :(
  1177. Revision 1.25 1998/06/17 14:10:11 peter
  1178. * small os2 fixes
  1179. * fixed interdependent units with newppu (remake3 under linux works now)
  1180. Revision 1.24 1998/06/16 08:56:20 peter
  1181. + targetcpu
  1182. * cleaner pmodules for newppu
  1183. Revision 1.23 1998/06/15 14:44:36 daniel
  1184. * BP updates.
  1185. Revision 1.22 1998/06/14 18:25:41 peter
  1186. * small fix with crc in newppu
  1187. Revision 1.21 1998/06/13 00:10:05 peter
  1188. * working browser and newppu
  1189. * some small fixes against crashes which occured in bp7 (but not in
  1190. fpc?!)
  1191. Revision 1.20 1998/06/12 14:50:48 peter
  1192. * removed the tree dependency to types.pas
  1193. * long_fil.pas support (not fully tested yet)
  1194. Revision 1.19 1998/06/12 10:32:26 pierre
  1195. * column problem hopefully solved
  1196. + C vars declaration changed
  1197. Revision 1.18 1998/06/11 13:58:07 peter
  1198. * small fix to let newppu compile
  1199. Revision 1.17 1998/06/09 16:01:40 pierre
  1200. + added procedure directive parsing for procvars
  1201. (accepted are popstack cdecl and pascal)
  1202. + added C vars with the following syntax
  1203. var C calias 'true_c_name';(can be followed by external)
  1204. reason is that you must add the Cprefix
  1205. which is target dependent
  1206. Revision 1.16 1998/06/04 10:42:19 pierre
  1207. * small bug fix in load_ppu or openppu
  1208. Revision 1.15 1998/05/28 14:37:53 peter
  1209. * default programname is PROGRAM (like TP7) to avoid dup id's
  1210. Revision 1.14 1998/05/27 19:45:02 peter
  1211. * symtable.pas splitted into includefiles
  1212. * symtable adapted for $ifndef OLDPPU
  1213. Revision 1.13 1998/05/23 01:21:05 peter
  1214. + aktasmmode, aktoptprocessor, aktoutputformat
  1215. + smartlink per module $SMARTLINK-/+ (like MMX) and moved to aktswitches
  1216. + $LIBNAME to set the library name where the unit will be put in
  1217. * splitted cgi386 a bit (codeseg to large for bp7)
  1218. * nasm, tasm works again. nasm moved to ag386nsm.pas
  1219. Revision 1.12 1998/05/20 09:42:33 pierre
  1220. + UseTokenInfo now default
  1221. * unit in interface uses and implementation uses gives error now
  1222. * only one error for unknown symbol (uses lastsymknown boolean)
  1223. the problem came from the label code !
  1224. + first inlined procedures and function work
  1225. (warning there might be allowed cases were the result is still wrong !!)
  1226. * UseBrower updated gives a global list of all position of all used symbols
  1227. with switch -gb
  1228. Revision 1.11 1998/05/12 10:46:59 peter
  1229. * moved printstatus to verb_def
  1230. + V_Normal which is between V_Error and V_Warning and doesn't have a
  1231. prefix like error: warning: and is included in V_Default
  1232. * fixed some messages
  1233. * first time parameter scan is only for -v and -T
  1234. - removed old style messages
  1235. Revision 1.10 1998/05/11 13:07:53 peter
  1236. + $ifndef OLDPPU for the new ppuformat
  1237. + $define GDB not longer required
  1238. * removed all warnings and stripped some log comments
  1239. * no findfirst/findnext anymore to remove smartlink *.o files
  1240. Revision 1.9 1998/05/06 15:04:20 pierre
  1241. + when trying to find source files of a ppufile
  1242. check the includepathlist for included files
  1243. the main file must still be in the same directory
  1244. Revision 1.8 1998/05/04 17:54:25 peter
  1245. + smartlinking works (only case jumptable left todo)
  1246. * redesign of systems.pas to support assemblers and linkers
  1247. + Unitname is now also in the PPU-file, increased version to 14
  1248. Revision 1.7 1998/05/01 16:38:44 florian
  1249. * handling of private and protected fixed
  1250. + change_keywords_to_tp implemented to remove
  1251. keywords which aren't supported by tp
  1252. * break and continue are now symbols of the system unit
  1253. + widestring, longstring and ansistring type released
  1254. Revision 1.6 1998/05/01 07:43:53 florian
  1255. + basics for rtti implemented
  1256. + switch $m (generate rtti for published sections)
  1257. Revision 1.5 1998/04/30 15:59:40 pierre
  1258. * GDB works again better :
  1259. correct type info in one pass
  1260. + UseTokenInfo for better source position
  1261. * fixed one remaining bug in scanner for line counts
  1262. * several little fixes
  1263. Revision 1.4 1998/04/29 10:33:52 pierre
  1264. + added some code for ansistring (not complete nor working yet)
  1265. * corrected operator overloading
  1266. * corrected nasm output
  1267. + started inline procedures
  1268. + added starstarn : use ** for exponentiation (^ gave problems)
  1269. + started UseTokenInfo cond to get accurate positions
  1270. Revision 1.3 1998/04/27 23:10:28 peter
  1271. + new scanner
  1272. * $makelib -> if smartlink
  1273. * small filename fixes pmodule.setfilename
  1274. * moved import from files.pas -> import.pas
  1275. Revision 1.2 1998/04/21 10:16:47 peter
  1276. * patches from strasbourg
  1277. * objects is not used anymore in the fpc compiled version
  1278. }