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

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

Issue 11558012: Use FormatMessageW for Windows error messages to handle internationalized messages correctly. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/platform_android.cc » ('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 BIN_PLATFORM_H_ 5 #ifndef BIN_PLATFORM_H_
6 #define BIN_PLATFORM_H_ 6 #define BIN_PLATFORM_H_
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 9
10 class Platform { 10 class Platform {
11 public: 11 public:
12 // Perform platform specific initialization. 12 // Perform platform specific initialization.
13 static bool Initialize(); 13 static bool Initialize();
14 14
15 // Returns the number of processors on the machine. 15 // Returns the number of processors on the machine.
16 static int NumberOfProcessors(); 16 static int NumberOfProcessors();
17 17
18 // Returns a string representing the operating system ("linux", 18 // Returns a string representing the operating system ("linux",
19 // "macos" or "windows"). The returned string should not be 19 // "macos" or "windows"). The returned string should not be
20 // deallocated by the caller. 20 // deallocated by the caller.
21 static const char* OperatingSystem(); 21 static const char* OperatingSystem();
22 22
23 // Returns a string representation of an error code. The returned
24 // string must be deallocated by the caller.
25 static char* StrError(int error_code);
26
27 // Extracts the local hostname. 23 // Extracts the local hostname.
28 static bool LocalHostname(char* buffer, intptr_t buffer_length); 24 static bool LocalHostname(char* buffer, intptr_t buffer_length);
29 25
30 // Extracts the environment variables for the current process. The 26 // Extracts the environment variables for the current process. The
31 // array of strings returned must be deallocated using 27 // array of strings returned must be deallocated using
32 // FreeEnvironment. The number of elements in the array is returned 28 // FreeEnvironment. The number of elements in the array is returned
33 // in the count argument. 29 // in the count argument.
34 static char** Environment(intptr_t* count); 30 static char** Environment(intptr_t* count);
35 static void FreeEnvironment(char** env, intptr_t count); 31 static void FreeEnvironment(char** env, intptr_t count);
36 32
37 private: 33 private:
38 DISALLOW_ALLOCATION(); 34 DISALLOW_ALLOCATION();
39 DISALLOW_IMPLICIT_CONSTRUCTORS(Platform); 35 DISALLOW_IMPLICIT_CONSTRUCTORS(Platform);
40 }; 36 };
41 37
42 #endif // BIN_PLATFORM_H_ 38 #endif // BIN_PLATFORM_H_
OLDNEW
« no previous file with comments | « runtime/bin/main.cc ('k') | runtime/bin/platform_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698