From 6817f52d9bf1c2b923b1b55288a328e77c501f03 Mon Sep 17 00:00:00 2001 From: Rubidium Date: Sun, 4 May 2025 11:36:57 +0200 Subject: [PATCH] Codechange: move definition of getcwd for Windows to where it is used --- src/fileio.cpp | 3 +++ src/stdafx.h | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fileio.cpp b/src/fileio.cpp index b837d4005f..b59de557b3 100644 --- a/src/fileio.cpp +++ b/src/fileio.cpp @@ -657,6 +657,9 @@ bool ExtractTar(const std::string &tar_filename, Subdirectory subdir) * @note defined in the OS related files (win32.cpp, unix.cpp etc) */ extern void DetermineBasePaths(std::string_view exe); + +/** Mimicks the getcwd from POSIX for Windows. */ +char *getcwd(char *buf, size_t size); #else /* defined(_WIN32) */ /** diff --git a/src/stdafx.h b/src/stdafx.h index f72b1ad9ee..cf75d44b1a 100644 --- a/src/stdafx.h +++ b/src/stdafx.h @@ -157,8 +157,6 @@ using namespace std::literals::string_view_literals; #if !defined(STRGEN) && !defined(SETTINGSGEN) # if defined(_WIN32) - char *getcwd(char *buf, size_t size); - std::string FS2OTTD(std::wstring_view name); std::wstring OTTD2FS(std::string_view name); # elif defined(WITH_ICONV)