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

Side by Side Diff: runtime/platform/utils_openbsd.h

Issue 1559053002: Refs #10260 OpenBSD support #25327 Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address code review issues Created 4 years, 11 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 unified diff | Download patch
« no previous file with comments | « runtime/platform/utils.h ('k') | runtime/vm/atomic.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef PLATFORM_UTILS_ANDROID_H_ 5 #ifndef PLATFORM_UTILS_OPENBSD_H_
6 #define PLATFORM_UTILS_ANDROID_H_ 6 #define PLATFORM_UTILS_OPENBSD_H_
7 7
8 #include <endian.h> // NOLINT 8 #include <endian.h> // NOLINT
9 9
10 namespace dart { 10 namespace dart {
11 11
12 inline int Utils::CountLeadingZeros(uword x) { 12 inline int Utils::CountLeadingZeros(uword x) {
13 #if defined(ARCH_IS_32_BIT) 13 #if defined(ARCH_IS_32_BIT)
14 return __builtin_clzl(x); 14 return __builtin_clzl(x);
15 #elif defined(ARCH_IS_64_BIT) 15 #elif defined(ARCH_IS_64_BIT)
16 return __builtin_clzll(x); 16 return __builtin_clzll(x);
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 inline char* Utils::StrError(int err, char* buffer, size_t bufsize) { 63 inline char* Utils::StrError(int err, char* buffer, size_t bufsize) {
64 if (strerror_r(err, buffer, bufsize) != 0) { 64 if (strerror_r(err, buffer, bufsize) != 0) {
65 snprintf(buffer, bufsize, "%s", "strerror_r failed"); 65 snprintf(buffer, bufsize, "%s", "strerror_r failed");
66 } 66 }
67 return buffer; 67 return buffer;
68 } 68 }
69 69
70 } // namespace dart 70 } // namespace dart
71 71
72 #endif // PLATFORM_UTILS_ANDROID_H_ 72 #endif // PLATFORM_UTILS_OPENBSD_H_
OLDNEW
« no previous file with comments | « runtime/platform/utils.h ('k') | runtime/vm/atomic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698