X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/a688d5e42f5131d40b38ab4bb9d98329cb898578..8e7497020dcd3c9f6b1b035aea011edeb76e6f8c:/lcore.pas?ds=inline diff --git a/lcore.pas b/lcore.pas index bb9eb8d..d0fc568 100755 --- a/lcore.pas +++ b/lcore.pas @@ -48,6 +48,19 @@ interface absoloutemaxs:integer=0; type + {$IF CompilerVersion >= 20.0} + { Delphi 2009/2010 widestring is the default string type } + thostname = ansistring; + tbufferstring = ansistring; + tipstring = ansistring; + {$else} + { Old pre-unicode delphi, todo: need to check if ansistring is available + in all older versions of delphi } + thostname = string; + tbufferstring = string; + tipstring = string; + {$ifend} + {$ifdef ver1_0} sigset= array[0..31] of longint; {$endif} @@ -106,7 +119,7 @@ interface lasterror:integer; destroying:boolean; recvbufsize:integer; - function receivestr:string; virtual; + function receivestr:tbufferstring; virtual; procedure close; procedure abort; procedure internalclose(error:word); virtual; @@ -119,8 +132,8 @@ interface procedure dup(invalue:longint); function sendflush : integer; - procedure sendstr(const str : string);virtual; - procedure putstringinsendbuffer(const newstring : string); + procedure sendstr(const str : tbufferstring);virtual; + procedure putstringinsendbuffer(const newstring : tbufferstring); function send(data:pointer;len:integer):integer;virtual; procedure putdatainsendbuffer(data:pointer;len:integer); virtual; procedure deletebuffereddata; @@ -442,13 +455,13 @@ begin end; end; -procedure tlasio.sendstr(const str : string); +procedure tlasio.sendstr(const str : tbufferstring); begin putstringinsendbuffer(str); sendflush; end; -procedure tlasio.putstringinsendbuffer(const newstring : string); +procedure tlasio.putstringinsendbuffer(const newstring : tbufferstring); begin if newstring <> '' then putdatainsendbuffer(@newstring[1],length(newstring)); end;