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

Side by Side Diff: src/shared/platform_macos.cc

Issue 1659163007: Rename fletch -> dartino (Closed) Base URL: https://github.com/dartino/sdk.git@master
Patch Set: address comments Created 4 years, 10 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 | « src/shared/platform_lk.cc ('k') | src/shared/platform_posix.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) 2015, the Dartino project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dartino 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.md file. 3 // BSD-style license that can be found in the LICENSE.md file.
4 4
5 #if defined(FLETCH_TARGET_OS_MACOS) 5 #if defined(DARTINO_TARGET_OS_MACOS)
6 6
7 #include <mach-o/dyld.h> 7 #include <mach-o/dyld.h>
8 8
9 #include <CoreFoundation/CFTimeZone.h> 9 #include <CoreFoundation/CFTimeZone.h>
10 10
11 #include "src/shared/assert.h" 11 #include "src/shared/assert.h"
12 #include "src/shared/platform.h" 12 #include "src/shared/platform.h"
13 13
14 namespace fletch { 14 namespace dartino {
15 15
16 void GetPathOfExecutable(char* path, size_t path_length) { 16 void GetPathOfExecutable(char* path, size_t path_length) {
17 uint32_t bytes_copied = path_length; 17 uint32_t bytes_copied = path_length;
18 if (_NSGetExecutablePath(path, &bytes_copied) != 0) { 18 if (_NSGetExecutablePath(path, &bytes_copied) != 0) {
19 FATAL1("_NSGetExecutablePath failed, %u bytes left.", bytes_copied); 19 FATAL1("_NSGetExecutablePath failed, %u bytes left.", bytes_copied);
20 } 20 }
21 } 21 }
22 22
23 int Platform::GetLocalTimeZoneOffset() { 23 int Platform::GetLocalTimeZoneOffset() {
24 CFTimeZoneRef tz = CFTimeZoneCopySystem(); 24 CFTimeZoneRef tz = CFTimeZoneCopySystem();
25 // Even if the offset was 24 hours it would still easily fit into 32 bits. 25 // Even if the offset was 24 hours it would still easily fit into 32 bits.
26 int offset = CFTimeZoneGetSecondsFromGMT(tz, CFAbsoluteTimeGetCurrent()); 26 int offset = CFTimeZoneGetSecondsFromGMT(tz, CFAbsoluteTimeGetCurrent());
27 CFRelease(tz); 27 CFRelease(tz);
28 // Note that Unix and Dart disagree on the sign. 28 // Note that Unix and Dart disagree on the sign.
29 return static_cast<int>(-offset); 29 return static_cast<int>(-offset);
30 } 30 }
31 31
32 } // namespace fletch 32 } // namespace dartino
33 33
34 #endif // defined(FLETCH_TARGET_OS_MACOS) 34 #endif // defined(DARTINO_TARGET_OS_MACOS)
OLDNEW
« no previous file with comments | « src/shared/platform_lk.cc ('k') | src/shared/platform_posix.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698