Commit Graph

111 Commits

Author SHA1 Message Date
Ariel Abreu
54d606dd9a
Stub/implement CFPreferencesAppValueIsForced and [NSError _setFileNameLocalizationEnabled:] 2020-08-27 22:10:24 -04:00
Ariel Abreu
5906c1c491
Add CF_CLOSED_ENUM and _CFMZEnabled plus some version definitions 2020-07-15 11:48:33 -04:00
Ariel Abreu
e6c6780355
Merge remote-tracking branch 'origin/master' into update-sources 2020-07-15 11:47:11 -04:00
Ariel Abreu
cefb42dff3
Add definition for CFRELEASE_IF_NOT_NULL
I'm actually not sure if this belongs here, but it doesn't look like it belongs anywhere else
2020-07-05 13:49:58 -04:00
Thomas A
7bc3e63f1a Use Better Macro Check 2020-07-02 07:41:35 -07:00
Ariel Abreu
0222b9ee8e
Update to work with update objc runtime 2020-07-01 23:19:33 -04:00
Thomas A
e780581794 Don't Use *_stret Objective C Runtime for ARM64
objc_msgSendSuper_stret and objc_msgSend_stret does not exist for ARM64 platforms.
2020-06-30 21:17:56 -07:00
Thomas A
ea6e617c47 Add Generic Implementation For HALT 2020-06-30 21:14:23 -07:00
Ariel Abreu
553dbef124
Initial update to clean up include directories
"initial" because there might some additional modifications necessary later on
2020-05-14 12:57:39 -04:00
Lubos Dolezel
01585f999b Build Apportable's CFStringTransform.c (darlinghq/darling#781) 2020-05-11 09:14:56 +02:00
Sergey Bugaev
2f5a05bc01 Rely on NSMethodSignature to provide ___forwarding___ with correct layout
Rather than trying to reimplement the same algorithm ourselves.
2020-05-01 18:27:11 +03:00
Sergey Bugaev
fa3b4a0ceb Fix invocation register dump block size
The actual size is 0xe0, but CFForwarding should only subtract 0xd0 to account
for the return address and the frame pointer it pushes onto the stack.
2020-05-01 18:24:47 +03:00
Sergey Bugaev
561605027d Implement -[NSInvocation invokeUsingIMP:] and invokeSuper 2020-05-01 18:18:33 +03:00
Sergey Bugaev
301a5a4af5 Ignore non-CFLocale locales
For compatibility reasons, locale is of type id, and you can pass
a dictionary there. If we are passed a dictionary, ignore it and
just use the current locale as we would when passed nil. This is
also what Apple's version does.

This fixes GNUstep defaults(1) segfaulting.
2020-04-25 18:31:56 +03:00
Lubos Dolezel
a1e76eb4cb Add CF_SWIFT_NAME() macro 2020-04-19 21:58:52 +02:00
Lubos Dolezel
0df921f1db Fix CFXPCBridge header, this file was never part of CoreBase 2020-04-19 19:42:00 +02:00
Sergey Bugaev
5bb4863d34 Attempt at fixing x86-64 invocation ABI
This implementation is incomplete, and we should probably use libffi here.
2020-04-16 11:55:20 +03:00
Sergey Bugaev
df641dcfa7 Small NSIntegerization 2020-04-16 11:54:51 +03:00
Sergey Bugaev
5730bd1369 Store and expose the type string in NSMethodSignature
This is what Apple's version does, and we're going to use this in Foundation
soon. This requires a corresponding change in Foundation.
2020-04-16 11:54:31 +03:00
Sergey Bugaev
775d287f3c Implement -[NSInvocation debugDescription]
For some reason, LLDB is really unhappy about NSInvocation's debug info, and
refuses to display NSInvocation values (or any values when NSInvocation is in
scope). Now, we can at least `po` invocations.
2020-04-16 11:44:30 +03:00
Sergey Bugaev
1b265f437b Change the way NSInvocation retains its arguments
This is closer to what Apple's vresion does, and it also allows us to store
additional objects in the container, which will be useful for pointer argument
pointees later.

This requires a small corresponding change in Foundation (NSInvocation.h)
2020-04-16 11:42:32 +03:00
Sergey Bugaev
576490f5d9 Fix invocation of __invoke__()
__invoke__() expects a character, not a string, for the return type.
2020-04-16 11:40:11 +03:00
Sergey Bugaev
a40bdc5357 Add call frame info to CFForwardingPrep and NSInvoke
This enables libunwind to throw exceptions through them. Notably, unrecognized
selector exceptions can now be caught properly, insteda of always aborting the
process.
2020-04-16 11:38:35 +03:00
Sergey Bugaev
27765590be Revert "Rename ___forwarding___ to have the correct symbol name"
This reverts commit f6ca56ca3e.

Turns out I was wrong about that, and ____forwarding___ is
the correct symbol name.
2020-04-16 11:36:59 +03:00
Sergey Bugaev
7ff4187fe9 Move NSInvocation (Internal) to an internal header
We're going to use these methods from Foundation (port coders).
2020-04-16 11:15:55 +03:00
Sergey Bugaev
9e1cd0382b Rework NSMessageBuilder
This is how it's supposed to work; and it's actually useful now. You invoke it
with the target and an out-pointer to an invocation, it returns you a special
proxy that will save the invocation you make on it to that pointer.

This requires a matching change in Foundation (NSProxy).
2020-04-16 11:07:27 +03:00
Sergey Bugaev
3393a89d63 Don't fail when forwarding target does not support fast path
NSObject does, but some other types may not.
2020-04-16 11:04:13 +03:00
Sergey Bugaev
2cbfb0348f Support CFRelease() on TFBed objects even without Foundation
See https://github.com/darlinghq/darling-security/pull/3
2020-04-16 11:02:13 +03:00
Sergey Bugaev
4809c095d9 Cosmetic tweaks in NSException 2020-04-15 22:14:51 +03:00
Sergey Bugaev
97aed63cd0
Merge pull request #3 from facekapow/cf-xpc-bridge
Partially implement `_CFXPCCreateCFObjectFromXPCObject`
2020-04-15 15:49:38 +03:00
Ariel Abreu
4cbf3681b0
Remove unnecessary __blocks; implement XPC int64 conversion 2020-04-15 08:12:21 -04:00
Ariel Abreu
81323b3ee3
Partially implement _CFXPCCreateCFObjectFromXPCObject 2020-04-14 21:36:02 -04:00
Luboš Doležel
3a147d44c8
Merge pull request #2 from facekapow/cf-xpc-bridge
Implement (at least partially) `_CFXPCCreateXPCObjectFromCFObject`
2020-04-07 16:08:21 +02:00
Ariel Abreu
3a53d4fa0d
Implement (at least partially) _CFXPCCreateXPCObjectFromCFObject 2020-04-07 09:28:35 -04:00
Andrew Hyatt
a04303081f
Clean up build output 2020-03-06 15:39:53 -05:00
Lubos Dolezel
f504dcd155 Implement support for getting kCFURLVolumeAvailableCapacityKey and friends 2020-02-28 23:40:03 +01:00
Lubos Dolezel
93f7c0f6c8 Implement _CFBundleCreateUnique() 2020-02-24 12:40:11 +01:00
Lubos Dolezel
9d6de6a1a8 Be more tolerant in forwarding to make our ObjC STUBS work 2020-02-23 22:26:54 +01:00
Lubos Dolezel
680f22ecba Add __CFRunLoopSetOptionsReason stub 2020-02-15 14:02:25 +01:00
Lubos Dolezel
a768dce86a Revert "Don't throw on -[NSDictionary setObject:nil forKey:something], this should just remove the key"
This reverts commit b199d6bf45.
2020-02-14 14:25:18 +01:00
Lubos Dolezel
b199d6bf45 Don't throw on -[NSDictionary setObject:nil forKey:something], this should just remove the key 2020-02-14 14:20:29 +01:00
Andrew Hyatt
57b999bd2b
Allow i386 or x86_64 only builds 2019-08-13 14:05:20 -04:00
Sergey Bugaev
56f39c155c
Merge pull request #1 from CuriousTommy/NSSet_fixup
Add exceptions to "initWithObjects: count:"
2019-06-17 17:19:44 +03:00
Thomas A
3051ba07b1 Add exceptions to "initWithObjects: count:" 2019-06-16 20:50:20 -07:00
Sergey Bugaev
f72a5756b6 Move ___forwarding___ to NSForwarding.m
As Apple has it, according to crash logs.
2019-05-09 16:48:46 +03:00
Sergey Bugaev
f6ca56ca3e Rename ___forwarding___ to have the correct symbol name 2019-05-09 16:48:46 +03:00
Andrew Hyatt
b674f74a80 Fix reference to NSAttributedString class 2019-04-30 17:28:34 -04:00
Andrew Hyatt
8bc77f97e6 Typo in last commit 2019-04-30 17:19:20 -04:00
Andrew Hyatt
1251c65656 Comment out NSAttributedString class
It's in Foundation
2019-04-30 17:02:26 -04:00
Andrew Hyatt
1c6ea502b7 Revert "Fix all warnings in CoreFoundation"
This reverts commit 3cf877c00d.

The issue with this commit is that it adds stubs for some methods
which are actually implemeneted in categories in Foundation. The good
parts of this commit will be later committed once those are removed.
2019-04-30 16:59:58 -04:00