64 bit Objective C problems
Original Reporter info from Mantis: lks
-
Reporter name:
Original Reporter info from Mantis: lks
- Reporter name:
Description:
I am having some problems with invoking some Objective C class methods through an instance variable. For example, in lazarus/lcl/interfaces/cocoa/cocoawscommon.pas, the routine TLCLCommonCallback.MouseUpDownEvent has a line of the form:
Msg.Keys := CocoaModifiersToKeyState(Event.modifierFlags) or CocoaPressedMouseButtonsToKeyState(Event.pressedMouseButtons);
The call to Event.pressedMouseButtons, which uses the NSEvent class instance Event to call the class function pressedMouseButtons, cause a runtime obj_msgSend exception on 64 bit Darwin/cocoa. However, it does not cause a problem on 32 bit Darwin/cocoa. Also, it does not trigger an exception if the code is written as:
Msg.Keys := CocoaModifiersToKeyState(Event.modifierFlags) or CocoaPressedMouseButtonsToKeyState(NSEvent.pressedMouseButtons); // lks XXX was Event.pressedMouseButtons
In other words, if I invoke the class method not through the instance variable, but through the class name.
This code used to work a while ago, and I suspect the problem only started appearing in a recent El Capitan revision 10.11.3. As a double check, I restored an older compiler version from June of last year which used to compile and execute this code just fine under a previous OSX version, and it is now breaking.
Perhaps there is a problem with 32/64 bit pointer sizes?
Mantis conversion info:
- Mantis ID: 29667
- OS: OSX
- OS Build: 10.11.3
- Build: 33100
- Platform: x86_64-darwin
- Version: 3.1.1
- Fixed in version: 3.1.1
- Fixed in revision: 33112 (#356a5aff)
- Monitored by: » Vincent (Vincent Snijders)
- Target version: 3.0.2