* make compiler compilable with 2.4.4 rtl

git-svn-id: trunk@19269 -
This commit is contained in:
florian 2011-09-28 18:54:32 +00:00
parent 39d8ee1136
commit a6d01c09aa
12 changed files with 61 additions and 46 deletions

View File

@ -13,9 +13,6 @@
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
**********************************************************************} **********************************************************************}
{ this unit is included temporarily for 2.2 bootstrapping and can be
removed after the next release after 2.2.2 }
{$mode objfpc} {$mode objfpc}
unit ccharset; unit ccharset;
@ -52,11 +49,15 @@ unit ccharset;
tcp2unicode = class(tcsconvert) tcp2unicode = class(tcsconvert)
end; end;
const
DefaultSystemCodePage = 437;
function loadunicodemapping(const cpname,f : string; cp :word) : punicodemap; function loadunicodemapping(const cpname,f : string; cp :word) : punicodemap;
procedure registermapping(p : punicodemap); procedure registermapping(p : punicodemap);
function getmap(const s : string) : punicodemap; function getmap(const s : string) : punicodemap;
function getmap(cp : word) : punicodemap; function getmap(cp : word) : punicodemap;
function mappingavailable(const s : string) : boolean; function mappingavailable(const s : string) : boolean;
function mappingavailable(cp :word) : boolean;
function getunicode(c : char;p : punicodemap) : tunicodechar; function getunicode(c : char;p : punicodemap) : tunicodechar;
function getascii(c : tunicodechar;p : punicodemap) : string; function getascii(c : tunicodechar;p : punicodemap) : string;
@ -84,9 +85,9 @@ unit ccharset;
datasize:=256; datasize:=256;
getmem(data,sizeof(tunicodecharmapping)*datasize); getmem(data,sizeof(tunicodecharmapping)*datasize);
assign(t,f); assign(t,f);
{$push}{$I-} {$I-}
reset(t); reset(t);
{$pop} {$I+}
if ioresult<>0 then if ioresult<>0 then
begin begin
freemem(data,sizeof(tunicodecharmapping)*datasize); freemem(data,sizeof(tunicodecharmapping)*datasize);
@ -202,7 +203,7 @@ unit ccharset;
hp:=hp^.next; hp:=hp^.next;
end; end;
getmap:=nil; getmap:=nil;
end; end;////////
function getmap(cp : word) : punicodemap; function getmap(cp : word) : punicodemap;
@ -240,6 +241,12 @@ unit ccharset;
mappingavailable:=getmap(s)<>nil; mappingavailable:=getmap(s)<>nil;
end; end;
function mappingavailable(cp : word) : boolean;
begin
mappingavailable:=getmap(cp)<>nil;
end;
function getunicode(c : char;p : punicodemap) : tunicodechar; function getunicode(c : char;p : punicodemap) : tunicodechar;
begin begin
@ -255,8 +262,8 @@ unit ccharset;
i : longint; i : longint;
begin begin
{ at least map to space } { at least map to '?' }
getascii:=#32; getascii:=#63;
for i:=0 to p^.lastchar do for i:=0 to p^.lastchar do
if p^.map[i].unicode=c then if p^.map[i].unicode=c then
begin begin

View File

@ -6,7 +6,7 @@ unit cp1251;
implementation implementation
uses uses
{$ifdef VER2_2}ccharset{$else VER2_2}charset{$endif VER2_2}; {$ifdef VER2_4}ccharset{$else VER2_4}charset{$endif VER2_4};
const const
map : array[0..255] of tunicodecharmapping = ( map : array[0..255] of tunicodecharmapping = (

View File

@ -6,7 +6,7 @@ unit CP1252;
implementation implementation
uses uses
charset; {$ifdef VER2_4}ccharset{$else VER2_4}charset{$endif VER2_4};
const const
map : array[0..255] of tunicodecharmapping = ( map : array[0..255] of tunicodecharmapping = (

View File

@ -6,7 +6,7 @@ unit cp437;
implementation implementation
uses uses
{$ifdef VER2_2}ccharset{$else VER2_2}charset{$endif VER2_2}; {$ifdef VER2_4}ccharset{$else VER2_4}charset{$endif VER2_4};
const const
map : array[0..255] of tunicodecharmapping = ( map : array[0..255] of tunicodecharmapping = (

View File

@ -6,7 +6,7 @@ unit cp850;
implementation implementation
uses uses
{$ifdef VER2_2}ccharset{$else VER2_2}charset{$endif VER2_2}; {$ifdef VER2_4}ccharset{$else VER2_4}charset{$endif VER2_4};
const const
map : array[0..255] of tunicodecharmapping = ( map : array[0..255] of tunicodecharmapping = (

View File

@ -6,7 +6,7 @@ unit cp866;
implementation implementation
uses uses
{$ifdef VER2_2}ccharset{$else VER2_2}charset{$endif VER2_2}; {$ifdef VER2_4}ccharset{$else VER2_4}charset{$endif VER2_4};
const const
map : array[0..255] of tunicodecharmapping = ( map : array[0..255] of tunicodecharmapping = (

View File

@ -6,7 +6,7 @@ unit cp8859_1;
implementation implementation
uses uses
{$ifdef VER2_2}ccharset{$else VER2_2}charset{$endif VER2_2}; {$ifdef VER2_4}ccharset{$else VER2_4}charset{$endif VER2_4};
const const
map : array[0..255] of tunicodecharmapping = ( map : array[0..255] of tunicodecharmapping = (

View File

@ -6,7 +6,7 @@ unit cp8859_5;
implementation implementation
uses uses
{$ifdef VER2_2}ccharset{$else VER2_2}charset{$endif VER2_2}; {$ifdef VER2_4}ccharset{$else VER2_4}charset{$endif VER2_4};
const const
map : array[0..255] of tunicodecharmapping = ( map : array[0..255] of tunicodecharmapping = (

View File

@ -37,7 +37,11 @@ uses
symconst,symtype,symdef,symsym, symconst,symtype,symdef,symsym,
verbose,fmodule,ppu, verbose,fmodule,ppu,
aasmbase,aasmtai,aasmdata, aasmbase,aasmtai,aasmdata,
aasmcpu,asmutils; aasmcpu,
{$if FPC_FULLVERSION<20700}
ccharset,
{$endif }
asmutils;
Type Type
{ These are used to form a singly-linked list, ordered by hash value } { These are used to form a singly-linked list, ordered by hash value }

View File

@ -78,7 +78,7 @@ implementation
uses uses
widestr, widestr,
{$ifdef VER2_2}ccharset{$else VER2_2}charset{$endif VER2_2}, {$ifdef VER2_4}ccharset{$else VER2_4}charset{$endif VER2_4},
SysUtils, SysUtils,
version, version,
cutils,cmsgs, cutils,cmsgs,

View File

@ -268,7 +268,11 @@ implementation
symbase,symtable,symtype,symsym,symconst,symdef,defutil, symbase,symtable,symtype,symsym,symconst,symdef,defutil,
{ This is needed for tcputype } { This is needed for tcputype }
cpuinfo, cpuinfo,
fmodule; fmodule
{$ifdef FPC_FULLVERSION<20700}
,ccharset
{$endif}
;
var var
{ dictionaries with the supported directives } { dictionaries with the supported directives }

View File

@ -28,7 +28,7 @@ unit widestr;
interface interface
uses uses
{$ifdef VER2_2}ccharset{$else VER2_2}charset{$endif VER2_2},globtype; {$ifdef VER2_4}ccharset{$else VER2_4}charset{$endif VER2_4},globtype;
type type