X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/85ef2ce64f0cc31a063fccea69fdcc7281d51548..b3b93191002f92b19c069b9815a8261d6edbc5ec:/lcorernd.pas?ds=inline diff --git a/lcorernd.pas b/lcorernd.pas index 006f6ce..3e43bb1 100644 --- a/lcorernd.pas +++ b/lcorernd.pas @@ -111,7 +111,7 @@ function randominteger(i:longint):longint; function randombits(b:integer):longint; {generate a version 4 random uuid} -function generate_uuid:string; +function generate_uuid:ansistring; {$ifndef nolcorernd} @@ -132,8 +132,14 @@ implementation {$ifndef nolcorernd} uses - {$ifdef win32}windows,activex,types,{$endif} - {$ifdef unix}baseunix,unix,unixutil,{$endif} + {$ifdef win32}windows,activex,{$endif} + {$ifdef unix} + {$ifdef ver1_0} + linux, + {$else} + baseunix,unix,unixutil,sockets, + {$endif} + {$endif} fastmd5,sysutils; {$ifdef unix}{$include unixstuff.inc}{$endif} @@ -145,9 +151,8 @@ type const wordsizeshift=2; wordsize=1 shl wordsizeshift; - - {$if (wordsize <> sizeof(wordtype))}'wordsizeshift must be setcorrectly'{$ifend} - + //wordsize check commented out for d3 compatibility + //{ $if (wordsize <> sizeof(wordtype))}'wordsizeshift must be setcorrectly'{ $ifend} hashsize=sizeof(hashtype); halfhashsize=hashsize div 2; hashdwords=hashsize div wordsize; @@ -397,12 +402,12 @@ begin end; const - ch:array[0..15] of char='0123456789abcdef'; + ch:array[0..15] of ansichar='0123456789abcdef'; -function generate_uuid:string; +function generate_uuid:ansistring; var buf:array[0..7] of word; -function inttohex(w:word):string; +function inttohex(w:word):ansistring; begin result := ch[w shr 12] + ch[(w shr 8) and $f] + ch[(w shr 4) and $f] + ch[w and $f]; end;