Ignore:
Timestamp:
Jul 14, 2009, 1:21:59 PM (16 years ago)
Author:
[email protected]
Message:

2009-07-06 George Staikos <[email protected]>

Reviewed by Adam Treat.

Authors: George Staikos <[email protected]>, Joe Mason <[email protected]>, Makoto Matsumoto <[email protected]>, Takuji Nishimura

https://bugs.webkit.org/show_bug.cgi?id=27030
Implement custom RNG for WinCE using Mersenne Twister

  • wtf/RandomNumber.cpp: (WTF::randomNumber):
  • wtf/RandomNumberSeed.h: (WTF::initializeRandomNumberGenerator):
  • wtf/wince/mt19937ar.c: Added. (init_genrand): (init_by_array): (genrand_int32): (genrand_int31): (genrand_real1): (genrand_real2): (genrand_real3): (genrand_res53):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/RandomNumber.cpp

    r40968 r45865  
    11/*
    22 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
    3  *           (C) 2008 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
     3 *           (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
    44 *
    55 * Redistribution and use in source and binary forms, with or without
     
    3434#include <stdint.h>
    3535#include <stdlib.h>
     36
     37#if PLATFORM(WINCE)
     38extern "C" {
     39#include "wince/mt19937ar.c"
     40}
     41#endif
    3642
    3743namespace WTF {
     
    7581    fullRandom &= (1LL << 53) - 1;
    7682    return static_cast<double>(fullRandom)/static_cast<double>(1LL << 53);
     83#elif PLATFORM(WINCE)
     84    return genrand_res53();
    7785#else
    7886    uint32_t part1 = rand() & (RAND_MAX - 1);
Note: See TracChangeset for help on using the changeset viewer.