Mercurial > minori
diff dep/animia/src/strategist.cc @ 139:478f3b366199
dep/animia: separate lots of things, use base class for OS stuff
author | Paper <mrpapersonic@gmail.com> |
---|---|
date | Sun, 12 Nov 2023 16:43:07 -0500 |
parents | 28842a8d0c6b |
children | 1e696863b54c |
line wrap: on
line diff
--- a/dep/animia/src/strategist.cc Sun Nov 12 04:53:19 2023 -0500 +++ b/dep/animia/src/strategist.cc Sun Nov 12 16:43:07 2023 -0500 @@ -1,16 +1,9 @@ #include "animia/strategies.h" #include "animia/util.h" +#include "animia/fd.h" #include "animia.h" #include <iostream> -#ifdef ANIMIA_ON_WIN32 -# include "animia/fd/win32.h" -#elif defined(ANIMIA_ON_LINUX) -# include "animia/fd/linux.h" -#elif defined(ANIMIA_ON_UNIX) -# include "animia/fd/bsd.h" -#endif - namespace animia::internal { class Strategist { @@ -60,13 +53,7 @@ const std::set<pid_t> pids{result_.process.pid}; std::vector<std::tuple<pid_t, std::string>> files; -#ifdef ANIMIA_ON_WIN32 - win32::EnumerateOpenFiles(pids, files); -#elif defined(ANIMIA_ON_LINUX) - linux::EnumerateOpenFiles(pids, files); -#elif defined(ANIMIA_ON_UNIX) - unix::EnumerateOpenFiles(pids, files); -#endif + fd.EnumerateOpenFiles(pids, files); for (const auto& [pid, file] : files) { success |= AddMedia({MediaInfoType::File, file});