From: <sv...@op...> - 2025-03-10 11:00:04
|
Author: manx Date: Mon Mar 10 11:59:46 2025 New Revision: 23002 URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=23002 Log: [Ref] mptPathString: Most of mptPathString.h is only used if MODPLUG_TRACKER. Simplify preprocessor logic. Modified: trunk/OpenMPT/common/mptPathString.cpp trunk/OpenMPT/common/mptPathString.h Modified: trunk/OpenMPT/common/mptPathString.cpp ============================================================================== --- trunk/OpenMPT/common/mptPathString.cpp Mon Mar 10 11:58:03 2025 (r23001) +++ trunk/OpenMPT/common/mptPathString.cpp Mon Mar 10 11:59:46 2025 (r23002) @@ -10,15 +10,13 @@ #include "stdafx.h" #include "mptPathString.h" -#include "mpt/path/os_path_long.hpp" - #include <vector> -#if MPT_OS_WINDOWS +#if defined(MODPLUG_TRACKER) && MPT_OS_WINDOWS #include <tchar.h> #endif -#if MPT_OS_WINDOWS +#if defined(MODPLUG_TRACKER) && MPT_OS_WINDOWS #include <windows.h> #endif @@ -31,7 +29,9 @@ -#if MPT_OS_WINDOWS +#if defined(MODPLUG_TRACKER) && MPT_OS_WINDOWS + + #if !MPT_OS_WINDOWS_WINRT @@ -42,11 +42,6 @@ #endif // !MPT_OS_WINDOWS_WINRT -#endif // MPT_OS_WINDOWS - - - -#if defined(MODPLUG_TRACKER) && MPT_OS_WINDOWS // Convert an absolute path to a path that's relative to "&relativeTo". @@ -107,11 +102,6 @@ } -#endif // MODPLUG_TRACKER && MPT_OS_WINDOWS - - - -#if MPT_OS_WINDOWS #if !(MPT_WINRT_BEFORE(MPT_WIN_10)) @@ -132,17 +122,17 @@ #endif -#endif // MPT_OS_WINDOWS +#endif // MODPLUG_TRACKER && MPT_OS_WINDOWS -} // namespace mpt +} // namespace mpt -#if defined(MODPLUG_TRACKER) +#if defined(MODPLUG_TRACKER) mpt::ustring SanitizePathComponent(mpt::ustring str) { @@ -156,8 +146,6 @@ } #endif // MPT_WITH_MFC - - #endif // MODPLUG_TRACKER Modified: trunk/OpenMPT/common/mptPathString.h ============================================================================== --- trunk/OpenMPT/common/mptPathString.h Mon Mar 10 11:58:03 2025 (r23001) +++ trunk/OpenMPT/common/mptPathString.h Mon Mar 10 11:59:46 2025 (r23002) @@ -64,14 +64,16 @@ -#if MPT_OS_WINDOWS +#if defined(MODPLUG_TRACKER) && MPT_OS_WINDOWS + + + #if !(MPT_WINRT_BEFORE(MPT_WIN_10)) // Returns the absolute path for a potentially relative path and removes ".." or "." components. (same as GetFullPathNameW) mpt::PathString GetAbsolutePath(const mpt::PathString &path); #endif -#endif // MPT_OS_WINDOWS -#if defined(MODPLUG_TRACKER) && MPT_OS_WINDOWS + // Relative / absolute paths conversion @@ -79,15 +81,15 @@ mpt::PathString RelativePathToAbsolute(const mpt::PathString &p, const mpt::PathString &relativeTo); -#endif // MODPLUG_TRACKER && MPT_OS_WINDOWS - -#if MPT_OS_WINDOWS #if !MPT_OS_WINDOWS_WINRT int PathCompareNoCase(const PathString &a, const PathString &b); #endif // !MPT_OS_WINDOWS_WINRT -#endif + + + +#endif // MODPLUG_TRACKER && MPT_OS_WINDOWS |