Commit graph

317 commits

Author SHA1 Message Date
rfm
053c3118a1 More leak fixes 2025-02-06 19:58:32 +00:00
rfm
9395e20db9 Add convenience methods to perform a method as an operation 2025-01-06 21:40:39 +00:00
rfm
a1a3f42ec0 Make use of new KVO implementation configurable 2024-11-29 11:55:47 +00:00
Hugo Melder
6681a3da47
Initial port of WinObjC's KVO implementation to GNUstep (#420)
* 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>
2024-11-10 17:05:23 +01:00
rfm
6667842dd5 Update FSF address as requested by Gregory 2024-11-07 13:37:59 +00:00
Hugo Melder
6eef1c3289
NSKeyValueCoding: Safe-Caching for -[NSObject valueForKey:] (#445)
* 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>
2024-10-29 14:12:34 +01:00
rfm
ed4e305026
NSURLSession rewrite (#422)
* 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>
2024-08-16 14:08:41 +02:00
rfm
3fedf31c2d
Revert "NSURLSession Reimplementation (#411)"
This reverts commit 07233534e6.
2024-07-02 19:19:14 +01:00
Hugo Melder
07233534e6
NSURLSession Reimplementation (#411)
* 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
2024-07-02 15:58:48 +02:00
rfm
58ae7db59a fixup headers for deletion of obsolete lock code 2024-05-30 11:06:23 +01:00
Gregory Casamento
3c1db49f4f
Merge pull request #384 from qmfrederik/dummy-nsnetservices 2024-04-03 23:49:03 -04:00
Frederik Carlier
97c01d8064
NSNetService and NSNetServiceBrowser: Gracefully fail when no-backend implementation
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).
2024-03-31 11:37:23 +00:00
Frederik Carlier
07d17a16a7 Generate pkg-config configuration file for libs-base
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`).
2024-03-30 15:56:22 +00:00
Frederik Seiffert
61709e6101 Support building on Windows with Clang MSVC target 2021-02-03 15:02:27 +01:00
Richard Frith-Macdonald
1b7bf26bea Merge changes for NSURLSession from EngageHub (formerly Brainstorm). 2020-11-29 06:57:47 -05:00
Frederik Seiffert
40b6cbbbc7 Added FoundationLegacySwiftCompatibility.h to Foundation headers 2019-11-14 15:11:38 +01:00
Gregory John Casamento
fe22c1f998 Add final files 2019-11-13 04:17:00 -05:00
Gregory John Casamento
3d9598e2a0 Make NSExtensionRequest conform to protocol 2019-11-10 23:02:59 -05:00
Gregory John Casamento
6b6a11aaa7 Skeleton of extension context 2019-11-10 16:48:48 -05:00
Gregory John Casamento
d7b854a0d2 Add NSDateComponentsFormatter 2019-11-06 19:04:41 -05:00
Gregory John Casamento
30162a9a1e Add NSOrthography and NSLinguisticTagger 2019-11-05 04:04:59 -05:00
Gregory John Casamento
3b5016e54f Add to foundation 2019-11-01 15:42:59 -04:00
Gregory John Casamento
59581f63aa Compiling header 2019-10-29 12:17:19 -04:00
Gregory John Casamento
a23e54c107 NSMetadataAttributes constants 2019-10-29 01:54:05 -04:00
Gregory John Casamento
aa8f60c30e Initial empty skeleton 2019-10-26 07:45:19 -04:00
Gregory John Casamento
517f2212c5 Correct spelling of header 2019-10-24 21:01:17 -04:00
Gregory John Casamento
629a3c2d5c Consistent header for NSDateIntervalFormatter.h 2019-10-20 09:21:22 -04:00
Gregory John Casamento
b1c868bbcb Add NSDateInterval.[hm] files. 2019-10-12 12:42:18 -04:00
Gregory John Casamento
ac9a6850c8 Add new formatter skeletons. 2019-10-09 07:32:30 -04:00
Gregory John Casamento
e95de25ea0 Compiling skeletons. 2019-09-30 16:06:11 -04:00
Gregory John Casamento
b2bfca7569 Add Apple script stub 2019-09-26 09:52:02 -04:00
Gregory John Casamento
81a82f8400 Add to Foundation.h 2019-09-26 01:39:24 -04:00
Gregory John Casamento
981fecc39b Add person name components formatter 2019-09-15 22:17:28 -04:00
Gregory John Casamento
3b546ff753 Add copy and coder methods. 2019-09-15 11:17:26 -04:00
Gregory John Casamento
7d6be5f5f4 Move NSFileWrapper to Foundation 2019-09-08 17:34:51 -04:00
Gregory John Casamento
f8e181d875 Add NSProgress.m... compiling. 2019-07-29 22:32:55 -04:00
Gregory John Casamento
bb117a17db Add NSByteCountFormatter.[hm] class. 2019-07-14 01:28:42 -04:00
Gregory John Casamento
f2d1c21d37 add new class and constants 2019-07-03 04:36:24 -04:00
Gregory John Casamento
9a516999c8 GSOrderedSet partial implementation 2019-05-20 01:43:06 -04:00
Gregory John Casamento
d96ac7f32a Barebones skeleton compiling now. 2019-05-17 20:17:10 -04:00
Richard Frith-Macdonald
6f3bd6ac97 Expose GNU TLS wrappers and add methods to get certificate expiry 2019-01-16 09:56:08 +00:00
Daniel Ferreira
7636967f30 api: generate stubs for new classes
Generate class stubs (without any method definition) for
NSFileCoordinator, NSFilePresenter, NSFileVersion and NSURLSession.
2017-06-29 21:18:16 +01:00
Richard Frith-MacDonald
33ed35331b Various configure/build tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40062 72102866-910b-0410-8b05-ffd578937521
2016-08-19 12:20:24 +00:00
Richard Frith-MacDonald
2dbc4d0d20 msys2 64bit tweaks
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@39930 72102866-910b-0410-8b05-ffd578937521
2016-06-27 16:38:51 +00:00
Richard Frith-MacDonald
3b02814665 more updates
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38803 72102866-910b-0410-8b05-ffd578937521
2015-07-16 08:44:15 +00:00
Niels Grewe
46d97b3be0 Implement +addObjectsFromArray: on NSHashTable
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@38802 72102866-910b-0410-8b05-ffd578937521
2015-07-16 07:38:14 +00:00
Marcus Müller
28cac03e05 Added NSUserNotification (new in OSX 10.8) and infrastructure. It's currently only available for compilers which support autosynthesis (clang >= 3.2) and the default implementation of NSUserNotificationCenter doesn't do much. However, there's a bundle loading mechanism embedded which makes it easy to provide a concrete implementation. I've provided a DBusKit based implementation as part of DBusKit which already works.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37645 72102866-910b-0410-8b05-ffd578937521
2014-01-30 14:23:18 +00:00
Richard Frith-MacDonald
9b99122b0f iUUID for unix by leeg
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37480 72102866-910b-0410-8b05-ffd578937521
2013-12-20 12:26:22 +00:00
Richard Frith-MacDonald
498b8300c3 add new class from Graham Lee <iamleeg@gmail.com>
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36860 72102866-910b-0410-8b05-ffd578937521
2013-07-09 18:59:38 +00:00
Richard Frith-MacDonald
9151fe541b Added Ibadinov's socks parsing code, modified to build without warnings/errors
on more systems.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36828 72102866-910b-0410-8b05-ffd578937521
2013-07-04 05:33:50 +00:00