function randombits(b:integer):longint;\r
\r
{generate a version 4 random uuid}\r
-function generate_uuid:string;\r
+function generate_uuid:ansistring;\r
\r
{$ifndef nolcorernd}\r
\r
\r
{$ifndef nolcorernd}\r
uses\r
- {$ifdef win32}windows,activex,types,{$endif}\r
- {$ifdef unix}baseunix,unix,unixutil,{$endif}\r
+ {$ifdef win32}windows,activex,{$endif}\r
+ {$ifdef unix}\r
+ {$ifdef ver1_0}\r
+ linux,\r
+ {$else}\r
+ baseunix,unix,unixutil,sockets,\r
+ {$endif}\r
+ {$endif}\r
fastmd5,sysutils;\r
\r
{$ifdef unix}{$include unixstuff.inc}{$endif}\r
const\r
wordsizeshift=2;\r
wordsize=1 shl wordsizeshift;\r
-\r
- {$if (wordsize <> sizeof(wordtype))}'wordsizeshift must be setcorrectly'{$ifend}\r
-\r
+ //wordsize check commented out for d3 compatibility\r
+ //{ $if (wordsize <> sizeof(wordtype))}'wordsizeshift must be setcorrectly'{ $ifend}\r
hashsize=sizeof(hashtype);\r
halfhashsize=hashsize div 2;\r
hashdwords=hashsize div wordsize;\r
end;\r
\r
const\r
- ch:array[0..15] of char='0123456789abcdef';\r
+ ch:array[0..15] of ansichar='0123456789abcdef';\r
\r
-function generate_uuid:string;\r
+function generate_uuid:ansistring;\r
var\r
buf:array[0..7] of word;\r
-function inttohex(w:word):string;\r
+function inttohex(w:word):ansistring;\r
begin\r
result := ch[w shr 12] + ch[(w shr 8) and $f] + ch[(w shr 4) and $f] + ch[w and $f];\r
end;\r