-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Implement NSRunLoop #133
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
Implement NSRunLoop #133
Conversation
The main issue here is that none of this will work on Linux because the CF code is not yet ported. |
@parkera I think I've got kovpas/swift-corelibs-foundation@nsrunloop...kovpas:cfrunloop_ubuntu |
I think you're on the right track; I had started on something similar, although I used |
Since we don't really have a mechanism in our tests for writing C unit tests of CF directly, I think it makes sense to consider this all together so we can verify that it's working. |
@parkera makes sense to treat it as one thing, indeed. I'll update this PR. Also going to add some tests for One thing: for some reason
Do you have any idea why this could happen and how to fix that? Meanwhile I had to do that:
|
@@ -14,7 +14,7 @@ | |||
foundation.GCC_PREFIX_HEADER = 'CoreFoundation/Base.subproj/CoreFoundation_Prefix.h' | |||
|
|||
if Configuration.current.target.sdk == OSType.Linux: | |||
foundation.CFLAGS = '-DDEPLOYMENT_TARGET_LINUX ' | |||
foundation.CFLAGS = '-DDEPLOYMENT_TARGET_LINUX -D_GNU_SOURCE ' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This causes a build warning:
[9/175] CompileC: closure/runtime.c
closure/runtime.c:16:9: warning: '__USE_GNU' macro redefined [-Wmacro-redefined]
#define __USE_GNU
^
/usr/include/features.h:322:10: note: previous definition is here
# define __USE_GNU 1
^
1 warning generated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not recommended to define __USE_GNU
in code, better to use define _GNU_SOURCE
. I just removed this define in closure/runtime.c
, as all source files are now compiled with _GNU_SOURCE
.
Overall looks really good. I just have a few minor comments for you to address then we'll merge this in. Thanks! |
When libdispatch builds properly for linux this will be re-enabled This reverts commit cefb963.
[clangd] Set correct argv[0] for clangd to fix c++ header search
addPort and removePort are not implemented because NSPort implementation is missing.