From d58231c575cff918b260a7ca6fed3ec27df10c68 Mon Sep 17 00:00:00 2001 From: Yuri Gorshenin Date: Thu, 24 Mar 2016 19:51:46 +0300 Subject: [PATCH] [platform][build] Fixed build warning. --- platform/platform.cpp | 20 ++++++++++++++++++++ platform/platform.hpp | 2 ++ platform/platform_unix_impl.cpp | 20 -------------------- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/platform/platform.cpp b/platform/platform.cpp index 1a7e9dd9c8..339ff20b35 100644 --- a/platform/platform.cpp +++ b/platform/platform.cpp @@ -207,3 +207,23 @@ unsigned Platform::CpuCores() const unsigned const cores = thread::hardware_concurrency(); return cores > 0 ? cores : 1; } + +string DebugPrint(Platform::EError err) +{ + switch (err) + { + case Platform::ERR_OK: return "Ok"; + case Platform::ERR_FILE_DOES_NOT_EXIST: return "File does not exist."; + case Platform::ERR_ACCESS_FAILED: return "Access failed."; + case Platform::ERR_DIRECTORY_NOT_EMPTY: return "Directory not empty."; + case Platform::ERR_FILE_ALREADY_EXISTS: return "File already exists."; + case Platform::ERR_NAME_TOO_LONG: + return "The length of a component of path exceeds {NAME_MAX} characters."; + case Platform::ERR_NOT_A_DIRECTORY: + return "A component of the path prefix of Path is not a directory."; + case Platform::ERR_SYMLINK_LOOP: + return "Too many symbolic links were encountered in translating path."; + case Platform::ERR_IO_ERROR: return "An I/O error occurred."; + case Platform::ERR_UNKNOWN: return "Unknown"; + } +} diff --git a/platform/platform.hpp b/platform/platform.hpp index a909d76754..45770be135 100644 --- a/platform/platform.hpp +++ b/platform/platform.hpp @@ -227,3 +227,5 @@ private: }; extern Platform & GetPlatform(); + +string DebugPrint(Platform::EError err); diff --git a/platform/platform_unix_impl.cpp b/platform/platform_unix_impl.cpp index f88e662607..1336022c0f 100644 --- a/platform/platform_unix_impl.cpp +++ b/platform/platform_unix_impl.cpp @@ -32,26 +32,6 @@ struct CloseDir closedir(dir); } }; - -string DebugPrint(Platform::EError err) -{ - switch (err) - { - case Platform::ERR_OK: return "Ok"; - case Platform::ERR_FILE_DOES_NOT_EXIST: return "File does not exist."; - case Platform::ERR_ACCESS_FAILED: return "Access failed."; - case Platform::ERR_DIRECTORY_NOT_EMPTY: return "Directory not empty."; - case Platform::ERR_FILE_ALREADY_EXISTS: return "File already exists."; - case Platform::ERR_NAME_TOO_LONG: - return "The length of a component of path exceeds {NAME_MAX} characters."; - case Platform::ERR_NOT_A_DIRECTORY: - return "A component of the path prefix of Path is not a directory."; - case Platform::ERR_SYMLINK_LOOP: - return "Too many symbolic links were encountered in translating path."; - case Platform::ERR_IO_ERROR: return "An I/O error occurred."; - case Platform::ERR_UNKNOWN: return "Unknown"; - } -} } // namespace void Platform::GetSystemFontNames(FilesList & res) const