# HG changeset patch # User Paper # Date 1713148130 14400 # Node ID f01b6e9c8fa2b4c47aa1f0253f2ca7ec6f60f158 # Parent 0718f538c5f91bc5f1fc9106a21065bc34018401 dep/animone: make OS X code build diff -r 0718f538c5f9 -r f01b6e9c8fa2 configure.ac --- a/configure.ac Fri Apr 12 19:13:50 2024 -0400 +++ b/configure.ac Sun Apr 14 22:28:50 2024 -0400 @@ -13,7 +13,6 @@ AC_PROG_CC dnl Do we have a C++17 compiler -: ${CXXFLAGS=""} AC_PROG_CXX AX_CXX_COMPILE_STDCXX([17], [noext], [mandatory]) diff -r 0718f538c5f9 -r f01b6e9c8fa2 dep/animone/src/win/quartz.cc --- a/dep/animone/src/win/quartz.cc Fri Apr 12 19:13:50 2024 -0400 +++ b/dep/animone/src/win/quartz.cc Sun Apr 14 22:28:50 2024 -0400 @@ -18,7 +18,13 @@ namespace animone::internal::quartz { template -using CFPtr = std::unique_ptr>; +struct CFDeconstructor { + using pointer = T; + void operator()(pointer t) const { ::CFRelease(t); }; +}; + +template +using CFPtr = std::unique_ptr>; #if __LP64__ typedef long NSInteger; @@ -100,23 +106,17 @@ return true; } -template -struct CFDeconstructor { - using pointer = T; - void operator()(pointer t) const { ::CFRelease(t); }; -}; - static bool GetWindowTitleAccessibility(unsigned int wid, pid_t pid, std::string& result) { CGRect bounds = {0}; { const CGWindowID wids[1] = {wid}; CFPtr arr(CFArrayCreate(kCFAllocatorDefault, (CFTypeRef*)wids, 1, NULL)); - CFPtr dicts(CGWindowListCreateDescriptionFromArray(arr)); + CFPtr dicts(CGWindowListCreateDescriptionFromArray(arr.get())); if (!dicts.get() || CFArrayGetCount(dicts.get()) < 1) return false; - CFDictionaryRef dict = reinterpret_cast(CFArrayGetValueAtIndex(dicts, 0)); + CFDictionaryRef dict = reinterpret_cast(CFArrayGetValueAtIndex(dicts.get(), 0)); if (!dict) return false; @@ -151,7 +151,7 @@ if (AXUIElementCopyAttributeValue(window, kAXPositionAttribute, reinterpret_cast(&val)) == kAXErrorSuccess) { CGPoint point; - if (!AXValueGetValue(val, kAXValueTypeCGPoint, reinterpret_cast(&point)) || + if (!AXValueGetValue(val, kAXValueCGPointType, reinterpret_cast(&point)) || (point.x != bounds.origin.x || point.y != bounds.origin.y)) { CFRelease(val); continue; @@ -166,7 +166,7 @@ if (AXUIElementCopyAttributeValue(window, kAXSizeAttribute, reinterpret_cast(&val)) == kAXErrorSuccess) { CGSize size; - if (!AXValueGetValue(val, kAXValueTypeCGSize, reinterpret_cast(&size)) || + if (!AXValueGetValue(val, kAXValueCGSizeType, reinterpret_cast(&size)) || (size.width != bounds.size.width || size.height != bounds.size.height)) { CFRelease(val); continue; @@ -211,7 +211,7 @@ static bool GetProcessBundleIdentifierNew(pid_t pid, std::string& result) { /* 10.6 and higher */ const id app = - cls_send(objc_getClass("NSRunningApplication"), sel_getUid("runningApplicationWithProcessIdentifier:"), pid); + cls_send((Class)objc_getClass("NSRunningApplication"), sel_getUid("runningApplicationWithProcessIdentifier:"), pid); if (!app) return false; @@ -228,11 +228,11 @@ if (GetProcessForPID(pid, &psn)) return false; - CFPtr info = ProcessInformationCopyDictionary(psn, kProcessDictionaryIncludeAllInformationMask); + CFPtr info(ProcessInformationCopyDictionary(&psn, kProcessDictionaryIncludeAllInformationMask)); if (!info) return false; - CFStringRef value = reinterpret_cast(CFDictionaryGetValue(dict, CFSTR("CFBundleIdentifier"))); + CFStringRef value = reinterpret_cast(CFDictionaryGetValue(info.get(), CFSTR("CFBundleIdentifier"))); if (!value) return false; @@ -247,7 +247,7 @@ if (GetProcessBundleIdentifierNew(pid, result)) return true; - return GetProcessBundleIdentifierOld(); + return GetProcessBundleIdentifierOld(pid, result); } bool EnumerateWindows(window_proc_t window_proc) { diff -r 0718f538c5f9 -r f01b6e9c8fa2 m4/m4_ax_have_qt.m4 --- a/m4/m4_ax_have_qt.m4 Fri Apr 12 19:13:50 2024 -0400 +++ b/m4/m4_ax_have_qt.m4 Sun Apr 14 22:28:50 2024 -0400 @@ -77,7 +77,7 @@ if test "$ver" ">" "Qt version 4"; then have_qt=yes # This pro file dumps qmake's variables, but it only works on Qt 5 or later - am_have_qt_dir=`mktemp -d` + am_have_qt_dir=$(mktemp -d || mktemp -d -t tmp) am_have_qt_pro="$am_have_qt_dir/test.pro" am_have_qt_stash="$am_have_qt_dir/.qmake.stash" am_have_qt_makefile="$am_have_qt_dir/Makefile"