Here I am again... I missed that in the previous diff, they are the usual missing <algorithm> and the std:: namespace missing in sort, find, make_pair. Alkis can you please give them an eye when you have time? The next major problem is that VC has only int rand(void) void srand( int seed ) So I donno how to compile the ExecutionEngine/Interpreter/ExternalFunctions.cpp that refers to the drand48 srand48 lrand48 etc series... For now I hacked them, like double drand48(void) { return (float) rand() / (float) RAND_MAX and so... Is it -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: diffs.txt URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20040928/49dba439/attachment.txt> -------------- next part -------------- not more portable if the rand functions are moved in the System stuff? --- Paolo Invernizzi
On Tue, 2004-09-28 at 08:47, Paolo Invernizzi wrote:> Here I am again... > I missed that in the previous diff, they are the usual missing > <algorithm> and the std:: namespace missing in sort, find, make_pair. > Alkis can you please give them an eye when you have time?Applied: http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040927/018595.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040927/018597.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040927/018596.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040927/018598.html http://mail.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20040927/018599.html Thank you again for the patches! -- Alkis
On Tue, 28 Sep 2004, Paolo Invernizzi wrote:> The next major problem is that VC has only > > int rand(void) > void srand( int seed ) > > So I donno how to compile the > ExecutionEngine/Interpreter/ExternalFunctions.cpp that refers to the > drand48 srand48 lrand48 etc series... > For now I hacked them, like > > double drand48(void) { return (float) rand() / (float) RAND_MAXFor these, just ifdef them out. If the platform doesn't support drand48, there is no reason for the interpreter to do so either... -Chris -- http://llvm.org/ http://nondot.org/sabre/
Hmm, I guess I need a sys::Math::getRandom() function that uses a "good" random number generator on the given platform. I'll make a note of this and tuck it away for future implementation. Reid. Chris Lattner wrote:> On Tue, 28 Sep 2004, Paolo Invernizzi wrote: > > >>The next major problem is that VC has only >> >>int rand(void) >>void srand( int seed ) >> >>So I donno how to compile the >>ExecutionEngine/Interpreter/ExternalFunctions.cpp that refers to the >>drand48 srand48 lrand48 etc series... >>For now I hacked them, like >> >>double drand48(void) { return (float) rand() / (float) RAND_MAX > > > For these, just ifdef them out. If the platform doesn't support drand48, > there is no reason for the interpreter to do so either... > > -Chris >