# HG changeset patch # User Paper # Date 1768873840 18000 # Node ID e561b7542b7b0f3e707085fa135b7636255ea032 # Parent df4a027623d0305dd79bc64cd1806f3c73c08b71 *: fix build on mac os x diff -r df4a027623d0 -r e561b7542b7b dep/animone/include/animone/types.h --- a/dep/animone/include/animone/types.h Mon Nov 10 15:51:45 2025 -0500 +++ b/dep/animone/include/animone/types.h Mon Jan 19 20:50:40 2026 -0500 @@ -30,7 +30,7 @@ /* different window systems have different sized IDs */ union ANIMONE_API wid_t { std::uintptr_t win32; // XXX this ought to be a `void *` - std::int64_t quartz; // FIXME is this correct? + std::uint32_t quartz; std::uint32_t x11; }; diff -r df4a027623d0 -r e561b7542b7b dep/animone/src/win/quartz.cc --- a/dep/animone/src/win/quartz.cc Mon Nov 10 15:51:45 2025 -0500 +++ b/dep/animone/src/win/quartz.cc Mon Jan 19 20:50:40 2026 -0500 @@ -106,7 +106,7 @@ return true; } -static bool GetWindowTitleAccessibility(unsigned int wid, pid_t pid, std::string& result) { +static bool GetWindowTitleAccessibility(CGWindowID wid, pid_t pid, std::string& result) { CGRect bounds = {0}; { const CGWindowID wids[1] = {wid}; @@ -190,7 +190,7 @@ return false; } -static bool GetWindowTitle(unsigned int wid, pid_t pid, std::string& result) { +static bool GetWindowTitle(CGWindowID wid, pid_t pid, std::string& result) { /* try using CoreGraphics (only usable on old versions of OS X) */ if ((CGSDefaultConnectionForThread && CGSCopyWindowProperty) || GetCoreGraphicsPrivateSymbols()) { CFPtr title; @@ -268,14 +268,14 @@ proc.platform = ExecutablePlatform::Xnu; CFDictionaryGetValue(window, CFSTR("kCGWindowOwnerPID"), proc.pid); if (!CFDictionaryGetValue(window, CFSTR("kCGWindowOwnerName"), proc.comm)) - fd::GetProcessName(proc.pid, proc.comm); + GetProcessName(proc.pid, proc.comm); Window win; win.platform = WindowPlatform::Quartz; CFDictionaryGetValue(window, CFSTR("kCGWindowNumber"), win.id.quartz); GetProcessBundleIdentifier(proc.pid, win.class_name); - GetWindowTitle(win.id, proc.pid, win.text); + GetWindowTitle(win.id.quartz, proc.pid, win.text); if (!window_proc(proc, win)) { CFRelease(windows); diff -r df4a027623d0 -r e561b7542b7b include/core/filesystem.h --- a/include/core/filesystem.h Mon Nov 10 15:51:45 2025 -0500 +++ b/include/core/filesystem.h Mon Jan 19 20:50:40 2026 -0500 @@ -3,6 +3,7 @@ #include #include #include +#include namespace Filesystem { @@ -13,6 +14,15 @@ std::filesystem::path GetTorrentsPath(); // (dotpath)/torrents/... std::filesystem::path GetAnimePostersPath(); // (dotpath)/anime/posters/ +struct PathHash { + auto operator()(const std::filesystem::path &p) const noexcept { + return std::filesystem::hash_value(p); + } +}; + +template +using PathMap = std::unordered_map; + /* ------------------------------------------------------------------------ */ /* Filesystem watcher interface. This is implemented differently on * different platforms :) */ diff -r df4a027623d0 -r e561b7542b7b include/library/library.h --- a/include/library/library.h Mon Nov 10 15:51:45 2025 -0500 +++ b/include/library/library.h Mon Jan 19 20:50:40 2026 -0500 @@ -32,7 +32,7 @@ private: void Refresh(std::optional find_id); - std::unordered_map> watchers_; + Filesystem::PathMap> watchers_; /* ID we're looking for */ std::optional find_id_; diff -r df4a027623d0 -r e561b7542b7b src/core/date.cc --- a/src/core/date.cc Mon Nov 10 15:51:45 2025 -0500 +++ b/src/core/date.cc Mon Jan 19 20:50:40 2026 -0500 @@ -6,6 +6,7 @@ #include #include +#include #include /* An implementation of AniList's "fuzzy date" */ diff -r df4a027623d0 -r e561b7542b7b src/core/filesystem.cc --- a/src/core/filesystem.cc Mon Nov 10 15:51:45 2025 -0500 +++ b/src/core/filesystem.cc Mon Jan 19 20:50:40 2026 -0500 @@ -5,6 +5,7 @@ #include #include +#include #ifdef WIN32 # include @@ -100,7 +101,7 @@ resort to old-fashioned recursion. --paper */ static void IterateDirectory(const std::filesystem::path &path, bool recursive, - std::function func) + const std::function &func) { std::error_code ec; static const std::filesystem::directory_iterator end; @@ -180,7 +181,7 @@ } /* unordered hashmap, path[found] */ - std::unordered_map paths_; + PathMap paths_; bool recursive_; };