Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: runtime/bin/crypto_fuchsia.cc

Issue 2168193002: Fuchsia: Build standalone VM. Make it run "Hello, World!". (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address comments Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/builtin_impl_sources.gypi ('k') | runtime/bin/directory_fuchsia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « runtime/bin/builtin_impl_sources.gypi ('k') | runtime/bin/directory_fuchsia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698