| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 | 23 // Returns a string representation of an error code. The returned |
| 24 // string must be deallocated by the caller. | 24 // string must be deallocated by the caller. |
| 25 static char* StrError(int error_code); | 25 static char* StrError(int error_code); |
| 26 | 26 |
| 27 // Extracts the local hostname. |
| 28 static bool LocalHostname(char *buffer, intptr_t buffer_length); |
| 29 |
| 27 private: | 30 private: |
| 28 DISALLOW_ALLOCATION(); | 31 DISALLOW_ALLOCATION(); |
| 29 DISALLOW_IMPLICIT_CONSTRUCTORS(Platform); | 32 DISALLOW_IMPLICIT_CONSTRUCTORS(Platform); |
| 30 }; | 33 }; |
| 31 | 34 |
| 32 #endif // BIN_PLATFORM_H_ | 35 #endif // BIN_PLATFORM_H_ |
| OLD | NEW |