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`).