| OLD | NEW |
| 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 #include "platform/globals.h" | 5 #include "platform/globals.h" |
| 6 #if defined(TARGET_OS_WINDOWS) | 6 #if defined(TARGET_OS_WINDOWS) |
| 7 | 7 |
| 8 #include "bin/directory.h" | 8 #include "bin/directory.h" |
| 9 #include "bin/file.h" | 9 #include "bin/file.h" |
| 10 #include "bin/utils.h" | 10 #include "bin/utils.h" |
| 11 | 11 |
| 12 #include <errno.h> // NOLINT | 12 #include <errno.h> // NOLINT |
| 13 #include <sys/stat.h> // NOLINT | 13 #include <sys/stat.h> // NOLINT |
| 14 | 14 |
| 15 #include "bin/log.h" | 15 #include "bin/log.h" |
| 16 | 16 |
| 17 #undef DeleteFile | 17 #undef DeleteFile |
| 18 | 18 |
| 19 namespace dart { | 19 namespace dart { |
| 20 namespace bin { | 20 namespace bin { |
| 21 | 21 |
| 22 PathBuffer::PathBuffer() : length_(0) { | 22 PathBuffer::PathBuffer() : length_(0) { |
| 23 data_ = calloc(PATH_MAX + 1, sizeof(wchar_t)); // NOLINT | 23 data_ = calloc(MAX_PATH + 1, sizeof(wchar_t)); // NOLINT |
| 24 } | 24 } |
| 25 | 25 |
| 26 char* PathBuffer::AsString() const { | 26 char* PathBuffer::AsString() const { |
| 27 return StringUtils::WideToUtf8(AsStringW()); | 27 return StringUtils::WideToUtf8(AsStringW()); |
| 28 } | 28 } |
| 29 | 29 |
| 30 wchar_t* PathBuffer::AsStringW() const { | 30 wchar_t* PathBuffer::AsStringW() const { |
| 31 return reinterpret_cast<wchar_t*>(data_); | 31 return reinterpret_cast<wchar_t*>(data_); |
| 32 } | 32 } |
| 33 | 33 |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 468 MoveFileExW(system_path, system_new_path, flags); | 468 MoveFileExW(system_path, system_new_path, flags); |
| 469 free(const_cast<wchar_t*>(system_path)); | 469 free(const_cast<wchar_t*>(system_path)); |
| 470 free(const_cast<wchar_t*>(system_new_path)); | 470 free(const_cast<wchar_t*>(system_new_path)); |
| 471 return (move_status != 0); | 471 return (move_status != 0); |
| 472 } | 472 } |
| 473 | 473 |
| 474 } // namespace bin | 474 } // namespace bin |
| 475 } // namespace dart | 475 } // namespace dart |
| 476 | 476 |
| 477 #endif // defined(TARGET_OS_WINDOWS) | 477 #endif // defined(TARGET_OS_WINDOWS) |
| OLD | NEW |