* GSAtomic: Add prefix to macro definitions
* NSKVOSupport: Import
* NSKVOSupport: Add test cases
* NSKVOSwizzling: Ugly C Rewrite
* NSKeyValueObserving: Use old implementation as fallback
* NSKeyValueObserving: Rename TypeEncodingCases header
* NSKVOSupport: Fix new objects not being added to NSKeyValueChangeNew set on set mutation
* NSKeyValueMutableSet: Fix will and didChange notifications for set operations
* NSKeyValueMutableSet: Document Accessor Search Patterns
* NSKVOSupport: Add toMany test
* NSKeyValueCoding: Change notifications when changing value via setValue:forKey:
* NSKVOSupport: Add more tests
* NSKVOSupport: Do not wrap block in try/finally to avoid crash in windows
* NSKVOSwizzling: use _alloca on Windows
* NSKVOSupport: Do not autorelease newWithObservee:
* NSKVOSupport: Do not leak Observee and TestFacade objects
* Improve runtime detection in makefile
* Add file extension of source file in GNUMakefile
* NSKVOSupport: Remove @status comments
* NSKVOSupport: Implement private notify method
* NSUserDefaults: KVO Support and fix macOS incompatibilities
* NSKeyValueObserving: Set old to null if nil
* NSKeyValueObserving: Remove cached new value
* NSMethodSignature: Add signature cache
* NSKVOSupport: Remove ObjC2 features and mark tests failing on GCC as hopeful
* Call class method instead of private _keyPathsForValuesAffectingValueForKey
* Move _keyPathsForValuesAffectingValueForKey body into class method and statically construct empty NSSet
* NSUserDefaults: Change notification should contain old value from other domains aswell
* NSUserDefaults: Fetch new value from all domains
* NSKVOInternal: Fixup filename in header
* NSUserDefaults: Go through search list instead of only one domain in KVO change
* Making indentation a bit less worse
* Add NSUserDefaults KVO tests
* NSKVOSupport: NSUserDefaults test small fixes
* Add autoreleasepool
* NSUserDefaults: Only emit change notifications if value changed
* Avoid compiler warnings and tidy some of the whitespace/formatting
---------
Co-authored-by: Frederik Seiffert <frederik@algoriddim.com>
Co-authored-by: rfm <richardfrithmacdonald@gmail.com>
Co-authored-by: rfm <rfm@gnu.org>
* KVC Caching Implementation
* Do not ignore struct name when comparing type encoding as NSPoint and NSSize have the same layout
* Use fast-path when using Objective-C 2
* Guard old ValueForKey function when using the fast-path
* Add basic NSKeyValueCoding tests
* Update Copyright Years
* NSKeyValueCoding+Caching: Add Versioning to IVar Slot
* safe_caching: Remove Guards
* Add type encoding helper header
* Rename geometry structs (NSRect, NSPoint, NSSize) for toll-free bridging with CoreGraphics
* Move CG struct definitions to CFCGTypes.h
* Update known struct encoding prefixes
* Windows 64-bit is LLP64 and not LP64
* Re-order to avoid complier warning
---------
Co-authored-by: rfm <richardfrithmacdonald@gmail.com>
* Implement GSSmallObject Class
* Remove private concrete class access
* Change secondary bias
* NSDate: Get interval from rhs object in comparison
* Add prefix to CONCRETE_CLASS_NAME macro
* clang-format: Do not use tabs
* Ignore clangd cache and compile_commands
* NSBlockOperation: Fix memory leak
* NSHTTPCookie: Fix expires date parsing
* NSHTTPCookie: Release DateFormatter after use
* NSOperation: Remove all objects at end of execution
* Reimplementation of NSURLSession
* NSURLSession: Update expiration dates in test
* Update ChangeLog
* Fix trivial compiler warning caused by missing import
* Import GSDispatch.h for definition of DISPATCH_QUEUE_SERIAL
* Import common.h early to avoid header conflict
* Fix import order to avoid conflicts and ensure we have correct localisation macro
* Check for presence of dispatch_cancel
* Cancel timer using dispatch_source_cancel() if dispatch_cancel() is missing.
* NSURLSession: Replace dispatch_io with dispatch_source in unit test HTTP server
---------
Co-authored-by: hmelder <service@hugomelder.com>
* Update `-[NSMutableArray removeLastObject]`
Updates the following implementation to avoid raising an exception if the array is already empty (or notifying observers if applicable):
* `-[NSMutableArray removeLastObject]`
* `-[GSMutableArray removeLastObject]`
* `-[NSKeyValueMutableArray removeLastObject]`
* `-[NSKeyValueIvarMutableArray removeLastObject]`
This brings the behavior of `-[NSMutableArray removeLastObject]` inline with the Apple implementation, improving compatibility for code bases which use both GNUStep and Apple objc/Foundation implementations.
* Add `-[NSMutableArray removeLastObject]` test case
Adds a test case to ensure `-[NSMutableArray removeLastObject]` does not raise an exception when called on an empty array.
* Create NSString Win32Additions Category
* NSUserDefaults: Fetch Windows UI language information
* NSUserDefaults: Add winnls include
* Android Native UI Language
* NSUserDefaults: Replace incorrect separator on Windows
* NSProcessInfo: BCP-47 Note
* GSConfig: Bump MinGW WINVER to Vista
* NSString+Win32Additions: Do not add array to arp twice
* NSUserDefaults: Increase default length
* clang-format: Do not use tabs
* Ignore clangd cache and compile_commands
* NSBlockOperation: Fix memory leak
* NSHTTPCookie: Fix expires date parsing
* NSOperation: Remove all objects at end of execution
* Reimplementation of NSURLSession
* Update ChangeLog
fstat() on UNIX isn't guaranteed to always succeed, even if the file handle is valid. Special files may or may not support fstat() in the kernel.
(For context, I'm working on a Vulkan application. Vulkan has facilities to send certain objects across processes by representing the objects as file descriptors. These file descriptors still need to be close()d, which makes them good candidates for wrapping an NSFileHandle around them, but they do not support fstat(). I'm creating multiple of these each frame in the application, which means the line "unable to get status of descriptor" appears very often in the terminal while my application is running.)
This modifies the NotificationCenter class to do the following:
- add an ivar to the class for an array to hold observers that need to be released when they are removed
- adds an observer to that array if the observer is of class GSNotificationObserver
- upon removing an observer, check if it is in that array, if so remove it from the array and release it.
This replaces the previous implementation which checked the class of the observer as it was being removed, which would cause a crash if the observer had been deallocated.
Map `CURLE_COULDNT_CONNECT` to `NSURLErrorCannotConnectToHost`.
When connecting to an IPv6 socket fails, curl easy will return `CURLE_COULDNT_CONNECT`. GNUstep currently maps `easyCode == CURLE_COULDNT_CONNECT && failureErrno == ETIMEDOUT` to `NSURLErrorTimedOut`, in all other scenarios `CURLE_COULDNT_CONNECT` is not handled.
This would cause the `NSURLSession/test01` to fail on (certain) systems with IPv6 enabled.
This PR maps all other values of `CURLE_COULDNT_CONNECT` to `NSURLErrorCannotConnectToHost`.
Additionally, it also stores the value of `easyCode` in the `NSUnderlyingErrorKey` to make troubleshooting (slightly) easier.
Always compile `NSNetService` and `NSNetServiceBrowser`, but have their
`intialize` method return `nil` if libavahi and mDNS are unavailable.
This:
- Results in a clear error message if code which was compiled against a
copy of GNUstep with avahi/mDNS support runs on a copy of GNUstep which
doesn't have avahi/mDNS support.
- Avoids code which uses `NSNetService` or `NSNetServiceBrowser` to
successfully compile (because the classes are defined in the header)
but then failing to link (because there is no implementation for these
classes).
This commit generates a `gnustep-base.pc` file which is installed in `/lib/pkgconfig` and contains the GNUstep base version number, the libraries to link (equivalent to `gnustep-config --base-libs`) with and the C flags to use (equivalent to `gnustep-config --objc-flags`).