Skip to content

Bring -compare: implementations inline with macos #508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ERobsham
Copy link
Contributor

updates the implementation of -compare: vs a nil argument to return the same results as the same code running on macos (output from a sample program on macos):

NSString 'compare:' nil arg: NSOrderedDescending
NSDate   'compare:' nil arg: NSOrderedSame
NSNumber 'compare:' nil arg: exceptions `-[__NSCFNumber compare:]: nil argument`

Related issue: #507

updates the implementation of `-compare:` vs a `nil` argument to return
the same results as the same code running on macos (output from a sample program on macos):
```
NSString 'compare:' nil arg: NSOrderedDescending
NSDate   'compare:' nil arg: NSOrderedSame
NSNumber 'compare:' nil arg: exceptions `-[__NSCFNumber compare:]: nil argument`
```
@ERobsham ERobsham requested a review from rfm as a code owner May 30, 2025 17:21
Copy link
Contributor

@rfm rfm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While removing the code to raise NSInvalidArgumentException for invalid arguments is not OK, modifying it to behave differently depending on the compatibility requested by the GSMacOSXCompatible user default would be great.

Traditionally that would have meant calling the -boolForKey: method to see whether runtime compatibility with undocumented/undefined/bad OSX behaviors had been requested. However, you can now also use the new GSMacOSXVersion() function to get the value of the default in the same format as the OSX version constants defined in GSVersionMacxros.h in order to match the undefined behaviors in particular versions of OSX.

This would allow you to set the GSMacOSXCompatible user default to make GNUstep behave as your framework expects until that framework is updated so that it's no longer needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants