diff options
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/wtf/RandomNumber.cpp')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/wtf/RandomNumber.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/wtf/RandomNumber.cpp b/src/3rdparty/webkit/JavaScriptCore/wtf/RandomNumber.cpp index c94d5a4..0e6e208 100644 --- a/src/3rdparty/webkit/JavaScriptCore/wtf/RandomNumber.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/wtf/RandomNumber.cpp @@ -1,6 +1,6 @@ /* * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. - * (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) + * (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -34,6 +34,12 @@ #include <stdint.h> #include <stdlib.h> +#if PLATFORM(WINCE) +extern "C" { +#include "wince/mt19937ar.c" +} +#endif + namespace WTF { double weakRandomNumber() @@ -74,6 +80,8 @@ double randomNumber() // Mask off the low 53bits fullRandom &= (1LL << 53) - 1; return static_cast<double>(fullRandom)/static_cast<double>(1LL << 53); +#elif PLATFORM(WINCE) + return genrand_res53(); #else uint32_t part1 = rand() & (RAND_MAX - 1); uint32_t part2 = rand() & (RAND_MAX - 1); |