| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // File compatability routines. Useful to delete database files with. | 5 // File compatibility routines. Useful to delete database files with. |
| 6 | 6 |
| 7 #ifndef CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ | 7 #ifndef CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ |
| 8 #define CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ | 8 #define CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ |
| 9 | 9 |
| 10 #include <fcntl.h> | 10 #include <fcntl.h> |
| 11 #include <sys/stat.h> | 11 #include <sys/stat.h> |
| 12 #include <sys/types.h> | 12 #include <sys/types.h> |
| 13 |
| 14 #include "build/build_config.h" |
| 13 #include "chrome/browser/sync/util/sync_types.h" | 15 #include "chrome/browser/sync/util/sync_types.h" |
| 14 | 16 |
| 15 extern const PathChar* const kPathSeparator; | 17 extern const PathChar* const kPathSeparator; |
| 16 | 18 |
| 17 // Path calls for all OSes. | 19 // Path calls for all OSes. |
| 18 // Returns 0 on success, non-zero on failure. | 20 // Returns 0 on success, non-zero on failure. |
| 19 int PathRemove(const PathString& path); | 21 int PathRemove(const PathString& path); |
| 20 | 22 |
| 21 #ifdef OS_WINDOWS | 23 #ifdef OS_WIN |
| 22 inline int PathRemove(const PathString& path) { | 24 inline int PathRemove(const PathString& path) { |
| 23 return _wremove(path.c_str()); | 25 return _wremove(path.c_str()); |
| 24 } | 26 } |
| 25 #elif (defined(OS_MACOSX) || defined(OS_LINUX)) | 27 #elif (defined(OS_MACOSX) || defined(OS_LINUX)) |
| 26 inline int PathRemove(const PathString& path) { | 28 inline int PathRemove(const PathString& path) { |
| 27 return unlink(path.c_str()); | 29 return unlink(path.c_str()); |
| 28 } | 30 } |
| 29 #endif | 31 #endif |
| 30 | 32 |
| 31 #endif // CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ | 33 #endif // CHROME_BROWSER_SYNC_UTIL_COMPAT_FILE_H_ |
| OLD | NEW |