globals.pas 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545
  1. {
  2. $Id$
  3. Copyright (C) 1993-98 by Florian Klaempfl
  4. This unit implements some support functions and global variables
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. ****************************************************************************
  17. }
  18. {$ifdef tp}
  19. {$E+,N+}
  20. {$endif}
  21. unit globals;
  22. interface
  23. uses
  24. {$ifdef win32}
  25. windows,
  26. {$endif}
  27. {$ifdef linux}
  28. linux,
  29. {$endif}
  30. {$ifdef Delphi4}
  31. dmisc,
  32. sysutils,
  33. {$else}
  34. strings,dos,
  35. {$endif}
  36. {$ifdef TP}
  37. objects,
  38. {$endif}
  39. globtype,version,tokens,systems,cobjects;
  40. const
  41. {$ifdef linux}
  42. DirSep = '/';
  43. {$else}
  44. {$ifdef amiga}
  45. DirSep = '/';
  46. {$else}
  47. DirSep = '\';
  48. {$endif}
  49. {$endif}
  50. {$ifdef Splitheap}
  51. testsplit : boolean = false;
  52. {$endif Splitheap}
  53. delphimodeswitches : tmodeswitches=
  54. [m_delphi,m_tp,m_all,m_class,m_objpas,m_result,m_string_pchar,
  55. m_pointer_2_procedure,m_autoderef,m_tp_procvar,m_initfinal];
  56. fpcmodeswitches : tmodeswitches=
  57. [m_fpc,m_all,m_string_pchar,m_nested_comment,m_repeat_forward,
  58. m_cvar_support,m_initfinal,m_add_pointer];
  59. objfpcmodeswitches : tmodeswitches=
  60. [m_objfpc,m_fpc,m_all,m_class,m_objpas,m_result,m_string_pchar,m_nested_comment,
  61. m_repeat_forward,m_cvar_support,m_initfinal,m_add_pointer];
  62. tpmodeswitches : tmodeswitches=
  63. [m_tp,m_all,m_tp_procvar];
  64. gpcmodeswitches : tmodeswitches=
  65. [m_gpc,m_all];
  66. type
  67. TSearchPathList = object(TStringQueue)
  68. procedure AddPath(s:string;addfirst:boolean);
  69. procedure AddList(list:TSearchPathList;addfirst:boolean);
  70. function FindFile(const f : string;var b : boolean) : string;
  71. end;
  72. var
  73. { specified inputfile }
  74. inputdir : dirstr;
  75. inputfile : namestr;
  76. inputextension : extstr;
  77. { specified outputfile with -o parameter }
  78. outputfile : namestr;
  79. { specified with -FE or -FU }
  80. outputexedir : dirstr;
  81. outputunitdir : dirstr;
  82. { things specified with parameters }
  83. paralinkoptions,
  84. paradynamiclinker : string;
  85. parapreprocess : boolean;
  86. { directory where the utils can be found (options -FD) }
  87. utilsdirectory : dirstr;
  88. { some flags for global compiler switches }
  89. do_build,
  90. do_make : boolean;
  91. not_unit_proc : boolean;
  92. { path for searching units, different paths can be seperated by ; }
  93. exepath : dirstr; { Path to ppc }
  94. librarysearchpath,
  95. unitsearchpath,
  96. objectsearchpath,
  97. includesearchpath : TSearchPathList;
  98. { deffile }
  99. usewindowapi : boolean;
  100. description : string;
  101. { current position }
  102. token, { current token being parsed }
  103. idtoken : ttoken; { holds the token if the pattern is a known word }
  104. tokenpos, { last postion of the read token }
  105. aktfilepos : tfileposinfo; { current position }
  106. { type of currently parsed block }
  107. { isn't full implemented (FK) }
  108. block_type : tblock_type;
  109. in_args : boolean; { arguments must be checked especially }
  110. parsing_para_level : longint; { parameter level, used to convert
  111. proc calls to proc loads in firstcalln }
  112. { Must_be_valid : boolean; should the variable already have a value
  113. obsolete replace by set_varstate function }
  114. compile_level : word;
  115. make_ref : boolean;
  116. resolving_forward : boolean; { used to add forward reference as second ref }
  117. use_esp_stackframe : boolean; { to test for call with ESP as stack frame }
  118. {$ifdef TP}
  119. use_big : boolean;
  120. {$endif}
  121. { commandline values }
  122. initdefines : tlinkedlist;
  123. initglobalswitches : tglobalswitches;
  124. initmoduleswitches : tmoduleswitches;
  125. initlocalswitches : tlocalswitches;
  126. initmodeswitches : tmodeswitches;
  127. initpackenum : longint;
  128. initpackrecords : tpackrecords;
  129. initoutputformat : tasm;
  130. initoptprocessor : tprocessors;
  131. initasmmode : tasmmode;
  132. { current state values }
  133. aktglobalswitches : tglobalswitches;
  134. aktmoduleswitches : tmoduleswitches;
  135. aktlocalswitches : tlocalswitches;
  136. aktmodeswitches : tmodeswitches;
  137. aktpackenum : longint;
  138. aktpackrecords : tpackrecords;
  139. aktoutputformat : tasm;
  140. aktoptprocessor : tprocessors;
  141. aktasmmode : tasmmode;
  142. { Memory sizes }
  143. heapsize,
  144. maxheapsize,
  145. stacksize : longint;
  146. {$Ifdef EXTDEBUG}
  147. total_of_firstpass,
  148. firstpass_several : longint;
  149. {$ifdef FPC}
  150. EntryMemUsed : longint;
  151. {$endif FPC}
  152. { parameter switches }
  153. debugstop,
  154. only_one_pass : boolean;
  155. {$EndIf EXTDEBUG}
  156. { windows application type }
  157. apptype : tapptype;
  158. const
  159. RelocSection : boolean = true;
  160. RelocSectionSetExplicitly : boolean = false;
  161. DLLsource : boolean = false;
  162. DLLImageBase : pstring = nil;
  163. UseDeffileForExport : boolean = true;
  164. ForceDeffileForExport : boolean = false;
  165. { used to set all registers used for each global function
  166. this should dramatically decrease the number of
  167. recompilations needed PM }
  168. simplify_ppu : boolean = false;
  169. { should we allow non static members ? }
  170. allow_only_static : boolean = false;
  171. Inside_asm_statement : boolean = false;
  172. { for error info in pp.pas }
  173. const
  174. parser_current_file : string = '';
  175. {$ifdef debug}
  176. { if the pointer don't point to the heap then write an error }
  177. function assigned(p : pointer) : boolean;
  178. {$endif}
  179. function min(a,b : longint) : longint;
  180. function max(a,b : longint) : longint;
  181. function align(i,a:longint):longint;
  182. procedure Replace(var s:string;s1:string;const s2:string);
  183. procedure ReplaceCase(var s:string;const s1,s2:string);
  184. function upper(const s : string) : string;
  185. function lower(const s : string) : string;
  186. function trimspace(const s:string):string;
  187. {$ifdef FPC}
  188. function tostru(i:cardinal) : string;
  189. {$else}
  190. function tostru(i:longint) : string;
  191. {$endif}
  192. procedure uppervar(var s : string);
  193. function tostr(i : longint) : string;
  194. function tostr_with_plus(i : longint) : string;
  195. procedure valint(S : string;var V : longint;var code : integer);
  196. function is_number(const s : string) : boolean;
  197. function ispowerof2(value : longint;var power : longint) : boolean;
  198. { enable ansistring comparison }
  199. function compareansistrings(p1,p2 : pchar;length1,length2 : longint) : longint;
  200. function concatansistrings(p1,p2 : pchar;length1,length2 : longint) : pchar;
  201. function bstoslash(const s : string) : string;
  202. procedure abstract;
  203. function getdatestr:string;
  204. function gettimestr:string;
  205. function filetimestring( t : longint) : string;
  206. procedure DefaultReplacements(var s:string);
  207. function path_absolute(const s : string) : boolean;
  208. Function FileExists ( Const F : String) : Boolean;
  209. Function RemoveFile(const f:string):boolean;
  210. Function RemoveDir(d:string):boolean;
  211. Function GetFileTime ( Var F : File) : Longint;
  212. Function GetNamedFileTime ( Const F : String) : Longint;
  213. Function SplitFileName(const s:string):string;
  214. Function SplitName(const s:string):string;
  215. Function SplitExtension(Const HStr:String):String;
  216. Function AddExtension(Const HStr,ext:String):String;
  217. Function ForceExtension(Const HStr,ext:String):String;
  218. Function FixPath(s:string;allowdot:boolean):string;
  219. function FixFileName(const s:string):string;
  220. procedure SplitBinCmd(const s:string;var bstr,cstr:string);
  221. procedure SynchronizeFileTime(const fn1,fn2:string);
  222. function FindFile(const f : string;path : string;var b : boolean) : string;
  223. function FindExe(bin:string;var found:boolean):string;
  224. function GetShortName(const n:string):string;
  225. Procedure Shell(const command:string);
  226. function GetEnvPChar(const envname:string):pchar;
  227. procedure FreeEnvPChar(p:pchar);
  228. procedure InitGlobals;
  229. procedure DoneGlobals;
  230. implementation
  231. uses
  232. comphook;
  233. procedure abstract;
  234. begin
  235. do_internalerror(255);
  236. end;
  237. function ngraphsearchvalue(const s1,s2 : string) : double;
  238. const
  239. n = 3;
  240. var
  241. equals,i,j : longint;
  242. hs : string;
  243. begin
  244. equals:=0;
  245. { is the string long enough ? }
  246. if min(length(s1),length(s2))-n+1<1 then
  247. begin
  248. ngraphsearchvalue:=0.0;
  249. exit;
  250. end;
  251. for i:=1 to length(s1)-n+1 do
  252. begin
  253. hs:=copy(s1,i,n);
  254. for j:=1 to length(s2)-n+1 do
  255. if hs=copy(s2,j,n) then
  256. inc(equals);
  257. end;
  258. {$ifdef fpc}
  259. ngraphsearchvalue:=equals/double(max(length(s1),length(s2))-n+1);
  260. {$else}
  261. ngraphsearchvalue:=equals/(max(length(s1),length(s2))-n+1);
  262. {$endif}
  263. end;
  264. function bstoslash(const s : string) : string;
  265. {
  266. return string s with all \ changed into /
  267. }
  268. var
  269. i : longint;
  270. begin
  271. for i:=1to length(s) do
  272. if s[i]='\' then
  273. bstoslash[i]:='/'
  274. else
  275. bstoslash[i]:=s[i];
  276. {$ifndef TP}
  277. {$ifopt H+}
  278. setlength(bstoslash,length(s));
  279. {$else}
  280. bstoslash[0]:=s[0];
  281. {$endif}
  282. {$else}
  283. bstoslash[0]:=s[0];
  284. {$endif}
  285. end;
  286. {$ifdef debug}
  287. function assigned(p : pointer) : boolean;
  288. {$ifndef FPC}
  289. {$ifndef DPMI}
  290. type
  291. ptrrec = record
  292. ofs,seg : word;
  293. end;
  294. var
  295. lp : longint;
  296. {$endif DPMI}
  297. {$endif FPC}
  298. begin
  299. {$ifdef FPC}
  300. { Assigned is used for procvar and
  301. stack stored temp records !! PM }
  302. (* if (p<>nil) {and
  303. ((p<heaporg) or
  304. (p>heapptr))} then
  305. do_internalerror(230); *)
  306. {$else}
  307. {$ifdef DPMI}
  308. assigned:=(p<>nil);
  309. exit;
  310. {$else DPMI}
  311. if p=nil then
  312. lp:=0
  313. else
  314. lp:=longint(ptrrec(p).seg)*16+longint(ptrrec(p).ofs);
  315. if (lp<>0) and
  316. ((lp<longint(seg(heaporg^))*16+longint(ofs(heaporg^))) or
  317. (lp>longint(seg(heapptr^))*16+longint(ofs(heapptr^)))) then
  318. do_internalerror(230);
  319. {$endif DPMI}
  320. {$endif FPC}
  321. assigned:=(p<>nil);
  322. end;
  323. {$endif}
  324. function min(a,b : longint) : longint;
  325. {
  326. return the minimal of a and b
  327. }
  328. begin
  329. if a>b then
  330. min:=b
  331. else
  332. min:=a;
  333. end;
  334. function max(a,b : longint) : longint;
  335. {
  336. return the maximum of a and b
  337. }
  338. begin
  339. if a<b then
  340. max:=b
  341. else
  342. max:=a;
  343. end;
  344. function align(i,a:longint):longint;
  345. {
  346. return value <i> aligned <a> boundary
  347. }
  348. begin
  349. align:=(i+a-1) and not(a-1);
  350. end;
  351. procedure Replace(var s:string;s1:string;const s2:string);
  352. var
  353. last,
  354. i : longint;
  355. begin
  356. s1:=upper(s1);
  357. last:=0;
  358. repeat
  359. i:=pos(s1,upper(s));
  360. if i=last then
  361. i:=0;
  362. if (i>0) then
  363. begin
  364. Delete(s,i,length(s1));
  365. Insert(s2,s,i);
  366. last:=i;
  367. end;
  368. until (i=0);
  369. end;
  370. procedure ReplaceCase(var s:string;const s1,s2:string);
  371. var
  372. last,
  373. i : longint;
  374. begin
  375. last:=0;
  376. repeat
  377. i:=pos(s1,s);
  378. if i=last then
  379. i:=0;
  380. if (i>0) then
  381. begin
  382. Delete(s,i,length(s1));
  383. Insert(s2,s,i);
  384. last:=i;
  385. end;
  386. until (i=0);
  387. end;
  388. function upper(const s : string) : string;
  389. {
  390. return uppercased string of s
  391. }
  392. var
  393. i : longint;
  394. begin
  395. for i:=1 to length(s) do
  396. if s[i] in ['a'..'z'] then
  397. upper[i]:=char(byte(s[i])-32)
  398. else
  399. upper[i]:=s[i];
  400. upper[0]:=s[0];
  401. end;
  402. function lower(const s : string) : string;
  403. {
  404. return lowercased string of s
  405. }
  406. var
  407. i : longint;
  408. begin
  409. for i:=1 to length(s) do
  410. if s[i] in ['A'..'Z'] then
  411. lower[i]:=char(byte(s[i])+32)
  412. else
  413. lower[i]:=s[i];
  414. lower[0]:=s[0];
  415. end;
  416. procedure uppervar(var s : string);
  417. {
  418. uppercase string s
  419. }
  420. var
  421. i : longint;
  422. begin
  423. for i:=1 to length(s) do
  424. if s[i] in ['a'..'z'] then
  425. s[i]:=char(byte(s[i])-32);
  426. end;
  427. {$ifdef FPC}
  428. function tostru(i:cardinal):string;
  429. {
  430. return string of value i, but for cardinals
  431. }
  432. var
  433. hs : string;
  434. begin
  435. str(i,hs);
  436. tostru:=hs;
  437. end;
  438. {$else FPC}
  439. function tostru(i:longint):string;
  440. begin
  441. tostru:=tostr(i);
  442. end;
  443. {$endif FPC}
  444. function trimspace(const s:string):string;
  445. {
  446. return s with all leading and ending spaces and tabs removed
  447. }
  448. var
  449. i,j : longint;
  450. begin
  451. i:=length(s);
  452. while (i>0) and (s[i] in [#9,' ']) do
  453. dec(i);
  454. j:=1;
  455. while (j<i) and (s[j] in [#9,' ']) do
  456. inc(j);
  457. trimspace:=Copy(s,j,i-j+1);
  458. end;
  459. function tostr(i : longint) : string;
  460. {
  461. return string of value i
  462. }
  463. var
  464. hs : string;
  465. begin
  466. str(i,hs);
  467. tostr:=hs;
  468. end;
  469. function tostr_with_plus(i : longint) : string;
  470. {
  471. return string of value i, but always include a + when i>=0
  472. }
  473. var
  474. hs : string;
  475. begin
  476. str(i,hs);
  477. if i>=0 then
  478. tostr_with_plus:='+'+hs
  479. else
  480. tostr_with_plus:=hs;
  481. end;
  482. procedure valint(S : string;var V : longint;var code : integer);
  483. {
  484. val() with support for octal, which is not supported under tp7
  485. }
  486. {$ifndef FPC}
  487. var
  488. vs : longint;
  489. c : byte;
  490. begin
  491. if s[1]='%' then
  492. begin
  493. vs:=0;
  494. longint(v):=0;
  495. for c:=2 to length(s) do
  496. begin
  497. if s[c]='0' then
  498. vs:=vs shl 1
  499. else
  500. if s[c]='1' then
  501. vs:=vs shl 1+1
  502. else
  503. begin
  504. code:=c;
  505. exit;
  506. end;
  507. end;
  508. code:=0;
  509. longint(v):=vs;
  510. end
  511. else
  512. system.val(S,V,code);
  513. end;
  514. {$else not FPC}
  515. begin
  516. system.val(S,V,code);
  517. end;
  518. {$endif not FPC}
  519. function is_number(const s : string) : boolean;
  520. {
  521. is string a correct number ?
  522. }
  523. var
  524. w : integer;
  525. l : longint;
  526. begin
  527. valint(s,l,w);
  528. is_number:=(w=0);
  529. end;
  530. function ispowerof2(value : longint;var power : longint) : boolean;
  531. {
  532. return if value is a power of 2. And if correct return the power
  533. }
  534. var
  535. hl : longint;
  536. i : longint;
  537. begin
  538. hl:=1;
  539. ispowerof2:=true;
  540. for i:=0 to 31 do
  541. begin
  542. if hl=value then
  543. begin
  544. power:=i;
  545. exit;
  546. end;
  547. hl:=hl shl 1;
  548. end;
  549. ispowerof2:=false;
  550. end;
  551. { enable ansistring comparison }
  552. { 0 means equal }
  553. { 1 means p1 > p2 }
  554. { -1 means p1 < p2 }
  555. function compareansistrings(p1,p2 : pchar;length1,length2 : longint) : longint;
  556. var
  557. i,j : longint;
  558. begin
  559. compareansistrings:=0;
  560. j:=min(length1,length2);
  561. i:=0;
  562. while (i<j) do
  563. begin
  564. if p1[i]>p2[i] then
  565. begin
  566. compareansistrings:=1;
  567. exit;
  568. end
  569. else
  570. if p1[i]<p2[i] then
  571. begin
  572. compareansistrings:=-1;
  573. exit;
  574. end;
  575. inc(i);
  576. end;
  577. if length1>length2 then
  578. compareansistrings:=1
  579. else
  580. if length1<length2 then
  581. compareansistrings:=-1;
  582. end;
  583. function concatansistrings(p1,p2 : pchar;length1,length2 : longint) : pchar;
  584. var
  585. p : pchar;
  586. begin
  587. getmem(p,length1+length2+1);
  588. move(p1[0],p[0],length1);
  589. move(p2[0],p[length1],length2+1);
  590. concatansistrings:=p;
  591. end;
  592. {****************************************************************************
  593. Time Handling
  594. ****************************************************************************}
  595. Function L0(l:longint):string;
  596. {
  597. return the string of value l, if l<10 then insert a zero, so
  598. the string is always at least 2 chars '01','02',etc
  599. }
  600. var
  601. s : string;
  602. begin
  603. Str(l,s);
  604. if l<10 then
  605. s:='0'+s;
  606. L0:=s;
  607. end;
  608. function gettimestr:string;
  609. {
  610. get the current time in a string HH:MM:SS
  611. }
  612. var
  613. hour,min,sec,hsec : word;
  614. begin
  615. {$ifdef delphi}
  616. dmisc.gettime(hour,min,sec,hsec);
  617. {$else delphi}
  618. dos.gettime(hour,min,sec,hsec);
  619. {$endif delphi}
  620. gettimestr:=L0(Hour)+':'+L0(min)+':'+L0(sec);
  621. end;
  622. function getdatestr:string;
  623. {
  624. get the current date in a string YY/MM/DD
  625. }
  626. var
  627. Year,Month,Day,Wday : Word;
  628. begin
  629. {$ifdef delphi}
  630. dmisc.getdate(year,month,day,wday);
  631. {$else}
  632. dos.getdate(year,month,day,wday);
  633. {$endif}
  634. getdatestr:=L0(Year)+'/'+L0(Month)+'/'+L0(Day);
  635. end;
  636. function filetimestring( t : longint) : string;
  637. {
  638. convert dos datetime t to a string YY/MM/DD HH:MM:SS
  639. }
  640. var
  641. {$ifndef linux}
  642. DT : DateTime;
  643. {$endif}
  644. Year,Month,Day,Hour,Min,Sec : Word;
  645. begin
  646. if t=-1 then
  647. begin
  648. FileTimeString:='Not Found';
  649. exit;
  650. end;
  651. {$ifndef linux}
  652. unpacktime(t,DT);
  653. Year:=dT.year;month:=dt.month;day:=dt.day;
  654. Hour:=dt.hour;min:=dt.min;sec:=dt.sec;
  655. {$else}
  656. EpochToLocal (t,year,month,day,hour,min,sec);
  657. {$endif}
  658. filetimestring:=L0(Year)+'/'+L0(Month)+'/'+L0(Day)+' '+L0(Hour)+':'+L0(min)+':'+L0(sec);
  659. end;
  660. {****************************************************************************
  661. Default Macro Handling
  662. ****************************************************************************}
  663. procedure DefaultReplacements(var s:string);
  664. begin
  665. { Replace some macro's }
  666. Replace(s,'$FPCVER',full_version_string);
  667. Replace(s,'$FPCDATE',date_string);
  668. Replace(s,'$FPCTARGET',target_cpu_string);
  669. Replace(s,'$FPCCPU',target_cpu_string);
  670. Replace(s,'$TARGET',target_path);
  671. Replace(s,'$FPCOS',target_path);
  672. end;
  673. {****************************************************************************
  674. File Handling
  675. ****************************************************************************}
  676. function path_absolute(const s : string) : boolean;
  677. {
  678. is path s an absolute path?
  679. }
  680. begin
  681. path_absolute:=false;
  682. {$ifdef linux}
  683. if (length(s)>0) and (s[1]='/') then
  684. path_absolute:=true;
  685. {$else linux}
  686. {$ifdef amiga}
  687. if ((length(s)>0) and ((s[1]='\') or (s[1]='/'))) or (Pos(':',s) = length(s)) then
  688. path_absolute:=true;
  689. {$else}
  690. if ((length(s)>0) and ((s[1]='\') or (s[1]='/'))) or
  691. ((length(s)>2) and (s[2]=':') and ((s[3]='\') or (s[3]='/'))) then
  692. path_absolute:=true;
  693. {$endif amiga}
  694. {$endif linux}
  695. end;
  696. {$ifndef FPC}
  697. Procedure FindClose(var Info : SearchRec);
  698. Begin
  699. End;
  700. {$endif not FPC}
  701. {$ifdef delphi}
  702. Function FileExists ( Const F : String) : Boolean;
  703. begin
  704. FileExists:=sysutils.FileExists(f);
  705. end;
  706. {$else}
  707. Function FileExists ( Const F : String) : Boolean;
  708. Var
  709. {$ifdef linux}
  710. Info : Stat;
  711. {$else}
  712. Info : SearchRec;
  713. {$endif}
  714. begin
  715. {$ifdef linux}
  716. FileExists:=FStat(F,info);
  717. {$else}
  718. findfirst(F,readonly+archive+hidden,info);
  719. FileExists:=(doserror=0);
  720. findclose(Info);
  721. {$endif}
  722. end;
  723. {$endif}
  724. Function RemoveFile(const f:string):boolean;
  725. var
  726. g : file;
  727. begin
  728. assign(g,f);
  729. {$I-}
  730. erase(g);
  731. {$I+}
  732. RemoveFile:=(ioresult=0);
  733. end;
  734. Function RemoveDir(d:string):boolean;
  735. begin
  736. if d[length(d)]=DirSep then
  737. Delete(d,length(d),1);
  738. {$I-}
  739. rmdir(d);
  740. {$I+}
  741. RemoveDir:=(ioresult=0);
  742. end;
  743. Function SplitFileName(const s:string):string;
  744. var
  745. p : dirstr;
  746. n : namestr;
  747. e : extstr;
  748. begin
  749. FSplit(s,p,n,e);
  750. SplitFileName:=n+e;
  751. end;
  752. Function SplitName(const s:string):string;
  753. var
  754. i,j : longint;
  755. begin
  756. i:=Length(s);
  757. j:=Length(s);
  758. while (i>0) and not(s[i] in ['/','\']) do
  759. dec(i);
  760. while (j>0) and (s[j]<>'.') do
  761. dec(j);
  762. if j<=i then
  763. j:=255;
  764. SplitName:=Copy(s,i+1,j-(i+1));
  765. end;
  766. Function SplitExtension(Const HStr:String):String;
  767. var
  768. j : longint;
  769. begin
  770. j:=length(Hstr);
  771. while (j>0) and (Hstr[j]<>'.') do
  772. begin
  773. if hstr[j]=DirSep then
  774. j:=0
  775. else
  776. dec(j);
  777. end;
  778. if j=0 then
  779. j:=254;
  780. SplitExtension:=Copy(Hstr,j,255);
  781. end;
  782. Function AddExtension(Const HStr,ext:String):String;
  783. begin
  784. if (Ext<>'') and (SplitExtension(HStr)='') then
  785. AddExtension:=Hstr+Ext
  786. else
  787. AddExtension:=Hstr;
  788. end;
  789. Function ForceExtension(Const HStr,ext:String):String;
  790. var
  791. j : longint;
  792. begin
  793. j:=length(Hstr);
  794. while (j>0) and (Hstr[j]<>'.') do
  795. dec(j);
  796. if j=0 then
  797. j:=255;
  798. ForceExtension:=Copy(Hstr,1,j-1)+Ext;
  799. end;
  800. Function FixPath(s:string;allowdot:boolean):string;
  801. var
  802. i : longint;
  803. begin
  804. { Fix separator }
  805. for i:=1 to length(s) do
  806. if s[i] in ['/','\'] then
  807. s[i]:=DirSep;
  808. { Fix ending / }
  809. if (length(s)>0) and (s[length(s)]<>DirSep) and
  810. (s[length(s)]<>':') then
  811. s:=s+DirSep;
  812. { Remove ./ }
  813. if (not allowdot) and (s='.'+DirSep) then
  814. s:='';
  815. { return }
  816. FixPath:=s;
  817. end;
  818. function FixFileName(const s:string):string;
  819. var
  820. i : longint;
  821. {$ifdef Linux}
  822. NoPath : boolean;
  823. {$endif Linux}
  824. begin
  825. {$ifdef Linux}
  826. NoPath:=true;
  827. {$endif Linux}
  828. for i:=length(s) downto 1 do
  829. begin
  830. case s[i] of
  831. {$ifdef Linux}
  832. '/','\' : begin
  833. FixFileName[i]:='/';
  834. NoPath:=false; {Skip lowercasing path: 'X11'<>'x11' }
  835. end;
  836. 'A'..'Z' : if NoPath then
  837. FixFileName[i]:=char(byte(s[i])+32)
  838. else
  839. FixFileName[i]:=s[i];
  840. {$else}
  841. '/' : FixFileName[i]:='\';
  842. 'A'..'Z' : FixFileName[i]:=char(byte(s[i])+32);
  843. {$endif}
  844. else
  845. FixFileName[i]:=s[i];
  846. end;
  847. end;
  848. {$ifndef TP}
  849. {$ifopt H+}
  850. SetLength(FixFileName,length(s));
  851. {$else}
  852. FixFileName[0]:=s[0];
  853. {$endif}
  854. {$else}
  855. FixFileName[0]:=s[0];
  856. {$endif}
  857. end;
  858. procedure SplitBinCmd(const s:string;var bstr,cstr:string);
  859. var
  860. i : longint;
  861. begin
  862. i:=pos(' ',s);
  863. if i>0 then
  864. begin
  865. bstr:=Copy(s,1,i-1);
  866. cstr:=Copy(s,i+1,length(s)-i);
  867. end
  868. else
  869. begin
  870. bstr:='';
  871. cstr:='';
  872. end;
  873. end;
  874. procedure TSearchPathList.AddPath(s:string;addfirst:boolean);
  875. var
  876. j : longint;
  877. CurrentDir,
  878. CurrPath : string;
  879. hp : PStringQueueItem;
  880. begin
  881. if s='' then
  882. exit;
  883. { Support default macro's }
  884. DefaultReplacements(s);
  885. { get current dir }
  886. GetDir(0,CurrentDir);
  887. CurrentDir:=FixPath(CurrentDir,false);
  888. repeat
  889. j:=Pos(';',s);
  890. if j=0 then
  891. j:=255;
  892. {Get Pathname}
  893. CurrPath:=FixPath(Copy(s,1,j-1),false);
  894. if CurrPath='' then
  895. CurrPath:='.'+DirSep
  896. else
  897. begin
  898. CurrPath:=FixPath(FExpand(CurrPath),false);
  899. if (Copy(CurrPath,1,length(CurrentDir))=CurrentDir) then
  900. CurrPath:='.'+DirSep+Copy(CurrPath,length(CurrentDir)+1,255);
  901. end;
  902. System.Delete(s,1,j);
  903. if addfirst then
  904. begin
  905. Delete(currPath);
  906. Insert(currPath);
  907. end
  908. else
  909. begin
  910. { Check if already in path, then we don't add it }
  911. hp:=Find(currPath);
  912. if not assigned(hp) then
  913. Concat(currPath);
  914. end;
  915. until (s='');
  916. end;
  917. procedure TSearchPathList.AddList(list:TSearchPathList;addfirst:boolean);
  918. var
  919. s : string;
  920. hl : TSearchPathList;
  921. hp,hp2 : PStringQueueItem;
  922. begin
  923. if list.empty then
  924. exit;
  925. { create temp and reverse the list }
  926. if addfirst then
  927. begin
  928. hl.Init;
  929. hp:=list.first;
  930. while assigned(hp) do
  931. begin
  932. hl.insert(hp^.data^);
  933. hp:=hp^.next;
  934. end;
  935. while not hl.empty do
  936. begin
  937. s:=hl.Get;
  938. Delete(s);
  939. Insert(s);
  940. end;
  941. hl.done;
  942. end
  943. else
  944. begin
  945. hp:=list.first;
  946. while assigned(hp) do
  947. begin
  948. hp2:=Find(hp^.data^);
  949. { Check if already in path, then we don't add it }
  950. if not assigned(hp2) then
  951. Concat(hp^.data^);
  952. hp:=hp^.next;
  953. end;
  954. end;
  955. end;
  956. function TSearchPathList.FindFile(const f : string;var b : boolean) : string;
  957. Var
  958. p : PStringQueueItem;
  959. begin
  960. FindFile:='';
  961. b:=false;
  962. p:=first;
  963. while assigned(p) do
  964. begin
  965. If FileExists(p^.data^+f) then
  966. begin
  967. FindFile:=p^.data^;
  968. b:=true;
  969. exit;
  970. end;
  971. p:=p^.next;
  972. end;
  973. end;
  974. Function GetFileTime ( Var F : File) : Longint;
  975. Var
  976. {$ifdef linux}
  977. Info : Stat;
  978. {$endif}
  979. L : longint;
  980. begin
  981. {$ifdef linux}
  982. FStat (F,Info);
  983. L:=Info.Mtime;
  984. {$else}
  985. GetFTime(f,l);
  986. {$endif}
  987. GetFileTime:=L;
  988. end;
  989. Function GetNamedFileTime (Const F : String) : Longint;
  990. var
  991. L : Longint;
  992. {$ifndef linux}
  993. info : SearchRec;
  994. {$else}
  995. info : stat;
  996. {$endif}
  997. begin
  998. l:=-1;
  999. {$ifdef linux}
  1000. if FStat (F,Info) then
  1001. L:=info.mtime;
  1002. {$else}
  1003. {$ifdef delphi}
  1004. dmisc.FindFirst (F,archive+readonly+hidden,info);
  1005. {$else delphi}
  1006. FindFirst (F,archive+readonly+hidden,info);
  1007. {$endif delphi}
  1008. if DosError=0 then
  1009. l:=info.time;
  1010. {$ifdef Linux}
  1011. FindClose(info);
  1012. {$endif}
  1013. {$ifdef Win32}
  1014. FindClose(info);
  1015. {$endif}
  1016. {$endif}
  1017. GetNamedFileTime:=l;
  1018. end;
  1019. {Touch Assembler and object time to ppu time is there is a ppufilename}
  1020. procedure SynchronizeFileTime(const fn1,fn2:string);
  1021. var
  1022. f : file;
  1023. l : longint;
  1024. begin
  1025. Assign(f,fn1);
  1026. {$I-}
  1027. reset(f,1);
  1028. {$I+}
  1029. if ioresult=0 then
  1030. begin
  1031. getftime(f,l);
  1032. close(f);
  1033. assign(f,fn2);
  1034. {$I-}
  1035. reset(f,1);
  1036. {$I+}
  1037. if ioresult=0 then
  1038. begin
  1039. setftime(f,l);
  1040. close(f);
  1041. end;
  1042. end;
  1043. end;
  1044. function FindFile(const f : string;path : string;var b : boolean) : string;
  1045. Var
  1046. singlepathstring : string;
  1047. i : longint;
  1048. begin
  1049. {$ifdef linux}
  1050. for i:=1 to length(path) do
  1051. if path[i]=':' then
  1052. path[i]:=';';
  1053. {$endif}
  1054. b:=false;
  1055. FindFile:='';
  1056. repeat
  1057. i:=pos(';',path);
  1058. if i=0 then
  1059. i:=255;
  1060. singlepathstring:=FixPath(copy(path,1,i-1),false);
  1061. delete(path,1,i);
  1062. If FileExists (singlepathstring+f) then
  1063. begin
  1064. FindFile:=singlepathstring;
  1065. b:=true;
  1066. exit;
  1067. end;
  1068. until path='';
  1069. end;
  1070. function FindExe(bin:string;var found:boolean):string;
  1071. begin
  1072. bin:=FixFileName(bin)+source_os.exeext;
  1073. {$ifdef delphi}
  1074. FindExe:=FindFile(bin,'.;'+exepath+';'+dmisc.getenv('PATH'),found)+bin;
  1075. {$else delphi}
  1076. FindExe:=FindFile(bin,'.;'+exepath+';'+dos.getenv('PATH'),found)+bin;
  1077. {$endif delphi}
  1078. end;
  1079. function GetShortName(const n:string):string;
  1080. {$ifdef win32}
  1081. var
  1082. hs,hs2 : string;
  1083. {$endif}
  1084. {$ifdef go32v2}
  1085. var
  1086. hs : string;
  1087. {$endif}
  1088. begin
  1089. GetShortName:=n;
  1090. {$ifdef win32}
  1091. hs:=n+#0;
  1092. Windows.GetShortPathName(@hs[1],@hs2[1],high(hs2));
  1093. hs2[0]:=chr(strlen(@hs2[1]));
  1094. GetShortName:=hs2;
  1095. {$endif}
  1096. {$ifdef go32v2}
  1097. hs:=n;
  1098. if Dos.GetShortName(hs) then
  1099. GetShortName:=hs;
  1100. {$endif}
  1101. end;
  1102. {****************************************************************************
  1103. OS Dependent things
  1104. ****************************************************************************}
  1105. function GetEnvPChar(const envname:string):pchar;
  1106. {$ifdef win32}
  1107. var
  1108. s : string;
  1109. i,len : longint;
  1110. hp,p,p2 : pchar;
  1111. {$endif}
  1112. begin
  1113. {$ifdef linux}
  1114. GetEnvPchar:=Linux.Getenv(envname);
  1115. {$define GETENVOK}
  1116. {$endif}
  1117. {$ifdef win32}
  1118. GetEnvPchar:=nil;
  1119. p:=GetEnvironmentStrings;
  1120. hp:=p;
  1121. while hp^<>#0 do
  1122. begin
  1123. s:=strpas(hp);
  1124. i:=pos('=',s);
  1125. len:=strlen(hp);
  1126. if upcase(copy(s,1,i-1))=upcase(envname) then
  1127. begin
  1128. GetMem(p2,len-length(envname));
  1129. Move(hp[i],p2^,len-length(envname));
  1130. GetEnvPchar:=p2;
  1131. break;
  1132. end;
  1133. { next string entry}
  1134. hp:=hp+len+1;
  1135. end;
  1136. FreeEnvironmentStrings(p);
  1137. {$define GETENVOK}
  1138. {$endif}
  1139. {$ifdef GETENVOK}
  1140. {$undef GETENVOK}
  1141. {$else}
  1142. GetEnvPchar:=StrPNew(Dos.Getenv(envname));
  1143. {$endif}
  1144. end;
  1145. procedure FreeEnvPChar(p:pchar);
  1146. begin
  1147. {$ifndef linux}
  1148. StrDispose(p);
  1149. {$endif}
  1150. end;
  1151. Procedure Shell(const command:string);
  1152. { This is already defined in the linux.ppu for linux, need for the *
  1153. expansion under linux }
  1154. {$ifdef linux}
  1155. begin
  1156. Linux.Shell(command);
  1157. end;
  1158. {$else}
  1159. var
  1160. comspec : string;
  1161. begin
  1162. comspec:=getenv('COMSPEC');
  1163. Exec(comspec,' /C '+command);
  1164. end;
  1165. {$endif}
  1166. {****************************************************************************
  1167. Init
  1168. ****************************************************************************}
  1169. procedure get_exepath;
  1170. var
  1171. hs1 : namestr;
  1172. hs2 : extstr;
  1173. begin
  1174. {$ifdef delphi}
  1175. exepath:=dmisc.getenv('PPC_EXEC_PATH');
  1176. {$else delphi}
  1177. exepath:=dos.getenv('PPC_EXEC_PATH');
  1178. {$endif delphi}
  1179. if exepath='' then
  1180. fsplit(FixFileName(paramstr(0)),exepath,hs1,hs2);
  1181. {$ifdef linux}
  1182. if exepath='' then
  1183. fsearch(hs1,dos.getenv('PATH'));
  1184. {$endif}
  1185. exepath:=FixPath(exepath,false);
  1186. end;
  1187. procedure DoneGlobals;
  1188. begin
  1189. initdefines.done;
  1190. if assigned(DLLImageBase) then
  1191. StringDispose(DLLImageBase);
  1192. RelocSection:=true;
  1193. RelocSectionSetExplicitly:=false;
  1194. DLLsource:=false;
  1195. UseDeffileForExport:=true;
  1196. librarysearchpath.Done;
  1197. unitsearchpath.Done;
  1198. objectsearchpath.Done;
  1199. includesearchpath.Done;
  1200. end;
  1201. procedure InitGlobals;
  1202. begin
  1203. { set global switches }
  1204. do_build:=false;
  1205. do_make:=true;
  1206. {$ifdef tp}
  1207. use_big:=false;
  1208. {$endif tp}
  1209. compile_level:=0;
  1210. { Output }
  1211. OutputFile:='';
  1212. OutputExeDir:='';
  1213. OutputUnitDir:='';
  1214. { Utils directory }
  1215. utilsdirectory:='';
  1216. { Search Paths }
  1217. librarysearchpath.Init;
  1218. unitsearchpath.Init;
  1219. includesearchpath.Init;
  1220. objectsearchpath.Init;
  1221. { Def file }
  1222. usewindowapi:=false;
  1223. description:='Compiled by FPC '+version_string+' - '+target_cpu_string;
  1224. { Init values }
  1225. initmodeswitches:=fpcmodeswitches;
  1226. initlocalswitches:=[cs_check_io];
  1227. initmoduleswitches:=[cs_extsyntax,cs_browser];
  1228. initglobalswitches:=[cs_check_unit_name,cs_link_static];
  1229. {$ifdef i386}
  1230. initoptprocessor:=Class386;
  1231. initpackenum:=4;
  1232. initpackrecords:=packrecord_2;
  1233. initoutputformat:=target_asm.id;
  1234. initasmmode:=asmmode_i386_att;
  1235. {$else not i386}
  1236. {$ifdef m68k}
  1237. initoptprocessor:=MC68000;
  1238. include(initmoduleswitches,cs_fp_emulation);
  1239. initpackenum:=4;
  1240. initpackrecords:=packrecord_2;
  1241. initoutputformat:=as_m68k_as;
  1242. initasmmode:=asmmode_m68k_mot;
  1243. {$endif m68k}
  1244. {$endif i386}
  1245. initdefines.init;
  1246. { memory sizes, will be overriden by parameter or default for target
  1247. in options or init_parser }
  1248. stacksize:=0;
  1249. heapsize:=0;
  1250. maxheapsize:=0;
  1251. { compile state }
  1252. in_args:=false;
  1253. { must_be_valid:=true; obsolete PM }
  1254. not_unit_proc:=true;
  1255. apptype:=at_cui;
  1256. end;
  1257. begin
  1258. get_exepath;
  1259. {$ifdef EXTDEBUG}
  1260. {$ifdef FPC}
  1261. EntryMemUsed:=system.HeapSize-MemAvail;
  1262. {$endif FPC}
  1263. {$endif}
  1264. end.
  1265. {
  1266. $Log$
  1267. Revision 1.39 1999-12-08 10:40:00 pierre
  1268. + allow use of unit var in exports of DLL for win32
  1269. by using direct export writing by default instead of use of DEFFILE
  1270. that does not allow assembler labels that do not
  1271. start with an underscore.
  1272. Use -WD to force use of Deffile for Win32 DLL
  1273. Revision 1.38 1999/12/06 18:21:03 peter
  1274. * support !ENVVAR for long commandlines
  1275. * win32/go32v2 write short pathnames to link.res so c:\Program Files\ is
  1276. finally supported as installdir.
  1277. Revision 1.37 1999/12/02 17:34:34 peter
  1278. * preprocessor support. But it fails on the caret in type blocks
  1279. Revision 1.36 1999/11/18 15:34:45 pierre
  1280. * Notes/Hints for local syms changed to
  1281. Set_varstate function
  1282. Revision 1.35 1999/11/17 17:04:59 pierre
  1283. * Notes/hints changes
  1284. Revision 1.34 1999/11/15 17:42:41 pierre
  1285. * -g disables reloc section for win32
  1286. Revision 1.33 1999/11/12 11:03:50 peter
  1287. * searchpaths changed to stringqueue object
  1288. Revision 1.32 1999/11/09 23:34:46 pierre
  1289. + resolving_forward boolean used for references
  1290. Revision 1.31 1999/11/09 13:00:38 peter
  1291. * define FPC_DELPHI,FPC_OBJFPC,FPC_TP,FPC_GPC
  1292. * initial support for ansistring default with modes
  1293. Revision 1.30 1999/11/08 16:27:20 pierre
  1294. + Reset AnsiStrings to clean up memory
  1295. Revision 1.29 1999/11/06 14:34:20 peter
  1296. * truncated log to 20 revs
  1297. Revision 1.28 1999/11/04 10:55:31 peter
  1298. * TSearchPathList for the string type of the searchpaths, which is
  1299. ansistring under FPC/Delphi
  1300. Revision 1.27 1999/10/26 12:30:41 peter
  1301. * const parameter is now checked
  1302. * better and generic check if a node can be used for assigning
  1303. * export fixes
  1304. * procvar equal works now (it never had worked at least from 0.99.8)
  1305. * defcoll changed to linkedlist with pparaitem so it can easily be
  1306. walked both directions
  1307. Revision 1.26 1999/10/21 14:29:34 peter
  1308. * redesigned linker object
  1309. + library support for linux (only procedures can be exported)
  1310. Revision 1.25 1999/09/10 18:48:02 florian
  1311. * some bug fixes (e.g. must_be_valid and procinfo.funcret_is_valid)
  1312. * most things for stored properties fixed
  1313. Revision 1.24 1999/09/08 16:05:31 peter
  1314. * pointer add/sub is now as expected and the same results as inc/dec
  1315. Revision 1.23 1999/09/07 15:11:00 pierre
  1316. * use do_internalerror insetead of runerror
  1317. Revision 1.22 1999/08/30 10:17:56 peter
  1318. * fixed crash in psub
  1319. * ansistringcompare fixed
  1320. * support for #$0b8
  1321. Revision 1.21 1999/08/27 10:45:00 pierre
  1322. options -Ca sets simply_ppu to true
  1323. Revision 1.20 1999/08/19 13:02:12 pierre
  1324. + label faillabel added for _FAIL support
  1325. Revision 1.19 1999/08/16 15:35:21 pierre
  1326. * fix for DLL relocation problems
  1327. * external bss vars had wrong stabs for pecoff
  1328. + -WB11000000 to specify default image base, allows to
  1329. load several DLLs with debugging info included
  1330. (relocatable DLL are stripped because the relocation
  1331. of the .Stab section is misplaced by ldw)
  1332. Revision 1.18 1999/08/11 17:26:32 peter
  1333. * tlinker object is now inherited for win32 and dos
  1334. * postprocessexecutable is now a method of tlinker
  1335. Revision 1.17 1999/08/10 12:51:14 pierre
  1336. * bind_win32_dll removed (Relocsection used instead)
  1337. * now relocsection is true by default ! (needs dlltool
  1338. for DLL generation)
  1339. Revision 1.16 1999/08/05 20:54:19 daniel
  1340. * Changes for new symtable.
  1341. Revision 1.15 1999/08/03 17:09:35 florian
  1342. * the alpha compiler can be compiled now
  1343. Revision 1.14 1999/07/23 16:05:19 peter
  1344. * alignment is now saved in the symtable
  1345. * C alignment added for records
  1346. * PPU version increased to solve .12 <-> .13 probs
  1347. Revision 1.13 1999/07/18 10:19:52 florian
  1348. * made it compilable with Dlephi 4 again
  1349. + fixed problem with large stack allocations on win32
  1350. Revision 1.12 1999/07/13 19:14:44 michael
  1351. + Defaultreplacemens now more logical
  1352. Revision 1.11 1999/07/10 10:26:18 peter
  1353. * merged
  1354. Revision 1.8.2.2 1999/07/10 10:03:04 peter
  1355. * fixed initialization/finalization in fpc mode
  1356. * allow $TARGET also in search paths
  1357. Revision 1.8.2.1 1999/07/07 07:53:21 michael
  1358. + Merged patches from florian
  1359. }