Skip to content
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

Fails to compile in XCode/iOS with precompiled headers enabled. #55

Closed
craigsteyn opened this issue Jun 16, 2020 · 2 comments
Closed

Fails to compile in XCode/iOS with precompiled headers enabled. #55

craigsteyn opened this issue Jun 16, 2020 · 2 comments
Assignees

Comments

@craigsteyn
Copy link

craigsteyn commented Jun 16, 2020

Hey,
I've been using enkiTS for a while now and I've really enjoying it. After using it on Win32, it worked on Android/Clang with only 1 unused variable when _DEBUG is not defined int err = sem_init( &semaphoreid.sem, 0, 0 ); Happy to open another issue / PR for this.

I then went ahead and moved it over to iOS and ran into this Issue.
I understand this is avoidable by adding enkiTS as its own lib/project in xcode, which I plan to do, however I wanted to bring this to your attention either way.
when precompiled headers are turned on and the precompiled header happens to have malloc.h included, the compiler throws this error:

/enkits/TaskScheduler.cpp:87:9: error: expected identifier
        THREAD_STATE_NONE,                  // shouldn't get this value
        ^
In file included from /precompiled-header.pch:14:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/malloc/malloc.h:28:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/mach/mach_types.h:87:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/mach/exception_types.h:182:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/mach/thread_status.h:76:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/mach/machine/thread_status.h:33:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS13.2.sdk/usr/include/mach/arm/thread_status.h:55:34: note: expanded from macro 'THREAD_STATE_NONE'
#define THREAD_STATE_NONE        5

For me to get around it I renamed THREAD_STATE_NONE however you could also undefine THREAD_STATE_NONE when __APPLE__ is defined since TaskScheduler.cpp doesn't use it.

@dougbinks
Copy link
Owner

Thanks for the report - that's an annoying name collision but since it's not in the API I can easily rename the enums, and I'll fix the other error too at the same time.

@dougbinks
Copy link
Owner

Fixes for these have now been merged into master - let me know if there's any problems.

Thanks again for the report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants