octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with Disable Mac App Nap


From: Rik
Subject: Re: Problem with Disable Mac App Nap
Date: Tue, 29 Oct 2019 08:14:41 -0700

On 10/28/2019 08:57 PM, address@hidden wrote:
Subject:
Re: Problem with Disable Mac App Nap
From:
Ben Abbott <address@hidden>
Date:
10/28/2019 08:57 PM
To:
Andrew Janke <address@hidden>
CC:
Ben Abbott <address@hidden>, Octave Maintainers <address@hidden>
List-Post:
<mailto:address@hidden>
Content-Transfer-Encoding:
quoted-printable
Precedence:
list
MIME-Version:
1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
References:
<address@hidden> <address@hidden>
In-Reply-To:
<address@hidden>
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset=utf-8
Message:
5

On Oct 28, 2019, at 8:21 PM, Andrew Janke <address@hidden> wrote:


On 10/28/19 11:16 PM, Ben Abbott wrote:
Hi Andrew,

After changeset 27575:d0fe6e344c41 I’m seeing the error below (macOS 10.14.6)

libgui/src/octave-qobject.cc:197:26: warning: use of old-style cast [-Wold-style-cast]
   process_info_class = (Class) objc_getClass ("NSProcessInfo");
                        ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libgui/src/octave-qobject.cc:210:39: warning: use of old-style cast [-Wold-style-cast]
   if ((process_info = objc_msgSend ((id)process_info_class, process_info_selector)) == nil)
                                     ^   ~~~~~~~~~~~~~~~~~~
libgui/src/octave-qobject.cc:213:21: error: no matching function for call to 'objc_msgSend'
   reason_string = objc_msgSend (objc_getClass ("NSString"),
                   ^~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/objc/message.h:85:1: note: candidate function not viable: no known conversion from 'Class _Nullable' (aka 'objc_class *') to
     'id _Nullable' (aka 'objc_object *') for 1st argument
objc_msgSend(id _Nullable self, SEL _Nonnull op, ...)
^
libgui/src/octave-qobject.cc:222:5: error: use of undeclared identifier 'osx_latencycritical_activity'
   osx_latencycritical_activity = objc_msgSend (process_info,


Ben
Argh. macOS 10.14.6 is what I tested it on in the first place.

Out of curiosity, what Xcode version? Not that I was expecting this to
happen; the Stack Overflow answer I sourced this from was supposed to be
compatible going back many macOS versions.

Best revert the change. I don't think I have a way of tracking down
what's causing this error.

Cheers,
Andrew
About -> Version 11.1

If it works for you on macOS 10.14.6, it should work for me as well.

Before reverting, let’s wait for others to try. Maybe something is wrong on my end.

Ben

The compile warnings about old-style casting are easy to resolve by using static_cast operator.  See https://hg.savannah.gnu.org/hgweb/octave/rev/a1907c3fdef4.  In that changeset I also took the opportunity to make disable_app_nap a file local function, rather than a private member function of the base_qobject class.  This function never needs to be exposed as part of the API of the class so this felt better.

I don't think we're that far from a solution.  See this blog post: https://www.mikeash.com/pyblog/objc_msgsends-new-prototype.html.  Quoting from it, "Apple's new OSes are out. If you've looked through the documentation, you may have noticed that the prototype for objc_msgSend has changed. Previously, it was declared as a function that took id, SEL, and variadic arguments after that, and returned id. Now it's declared as a function that takes and returns void."  The date of the blog post was 10/11/2010 so this is a recent change.

This seems easy enough to resolve.  There needs to be a configure test to check whether objc_msgSend has the old or new prototype and then call the correct one.

--Rik


reply via email to

[Prev in Thread] Current Thread [Next in Thread]