| 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 #include "bin/platform.h" | 5 #include "bin/platform.h" |
| 6 | 6 |
| 7 | 7 |
| 8 bool Platform::Initialize() { |
| 9 // Nothing to do on Windows. |
| 10 return true; |
| 11 } |
| 12 |
| 13 |
| 8 int Platform::NumberOfProcessors() { | 14 int Platform::NumberOfProcessors() { |
| 9 SYSTEM_INFO info; | 15 SYSTEM_INFO info; |
| 10 GetSystemInfo(&info); | 16 GetSystemInfo(&info); |
| 11 return info.dwNumberOfProcessors; | 17 return info.dwNumberOfProcessors; |
| 12 } | 18 } |
| 13 | 19 |
| 14 | 20 |
| 15 const char* Platform::OperatingSystem() { | 21 const char* Platform::OperatingSystem() { |
| 16 return "windows"; | 22 return "windows"; |
| 17 } | 23 } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 38 // null termination. | 44 // null termination. |
| 39 if (message_size > 2 && | 45 if (message_size > 2 && |
| 40 error[message_size - 2] == '\r' && | 46 error[message_size - 2] == '\r' && |
| 41 error[message_size - 1] == '\n') { | 47 error[message_size - 1] == '\n') { |
| 42 error[message_size - 2] = '\0'; | 48 error[message_size - 2] = '\0'; |
| 43 } else { | 49 } else { |
| 44 error[kBufferSize - 1] = '\0'; | 50 error[kBufferSize - 1] = '\0'; |
| 45 } | 51 } |
| 46 return error; | 52 return error; |
| 47 } | 53 } |
| OLD | NEW |