| Index: runtime/bin/crypto_fuchsia.cc
|
| diff --git a/runtime/bin/crypto_win.cc b/runtime/bin/crypto_fuchsia.cc
|
| similarity index 72%
|
| copy from runtime/bin/crypto_win.cc
|
| copy to runtime/bin/crypto_fuchsia.cc
|
| index 0208d95757fda0c14c0e442578e80676a499ceb5..9423f7cdf9423a3bed545b2f051bb42dae635dc1 100644
|
| --- a/runtime/bin/crypto_win.cc
|
| +++ b/runtime/bin/crypto_fuchsia.cc
|
| @@ -1,13 +1,9 @@
|
| -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
|
| +// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -#ifndef _CRT_RAND_S
|
| -#define _CRT_RAND_S
|
| -#endif
|
| -
|
| #include "platform/globals.h"
|
| -#if defined(TARGET_OS_WINDOWS)
|
| +#if defined(TARGET_OS_FUCHSIA)
|
|
|
| #include "bin/crypto.h"
|
|
|
| @@ -18,7 +14,7 @@ bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
|
| uint32_t num;
|
| intptr_t read = 0;
|
| while (read < count) {
|
| - if (rand_s(&num) != 0) {
|
| + if (rand_r(&num) != 0) {
|
| return false;
|
| }
|
| for (int i = 0; i < 4 && read < count; i++) {
|
| @@ -32,4 +28,4 @@ bool Crypto::GetRandomBytes(intptr_t count, uint8_t* buffer) {
|
| } // namespace bin
|
| } // namespace dart
|
|
|
| -#endif // defined(TARGET_OS_WINDOWS)
|
| +#endif // defined(TARGET_OS_FUCHSIA)
|
|
|