Skip to content

Added missing queue macros for building on Android #458

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

Merged
merged 2 commits into from
Mar 21, 2019
Merged

Added missing queue macros for building on Android #458

merged 2 commits into from
Mar 21, 2019

Conversation

triplef
Copy link
Contributor

@triplef triplef commented Mar 19, 2019

TAILQ_CONCAT() and LIST_FOREACH_SAFE() are not defined in queue.h in the Android NDK.

I simply added the macros to internal.h, but please let me know if you’d prefer another place to add them.

@compnerd
Copy link
Member

This is insufficient, there are additional ones, #453 covers this as well.

@triplef
Copy link
Contributor Author

triplef commented Mar 19, 2019

The thing is that (probably unlike Windows) the Android NDK implements some of these macros, but not all of them. I see a couple of alternate ways that I think should work and would probably be better than just sticking them in internal.h like I did here:

a) Add missing macros to android_stubs.h.
b) Wait for #453, then include generic_sys_queue.h on Android and don’t include sys/queue.h.
c) Wait for #453, then include generic_sys_queue.h and add #ifndef’s around each definition.

Do any of these approaches sound good or is there another way you’d prefer?

@compnerd
Copy link
Member

I'm totally happy with b. It seems much nicer. The file is already annoying to work with, so c isn't very appealing. a would really increase the duplication, so I really think b is the best approach.

@triplef
Copy link
Contributor Author

triplef commented Mar 19, 2019

Sounds good! I’ll wait for #453 and re-do this.

@compnerd
Copy link
Member

@triplef - #453 is merged :-)

triplef added 2 commits March 20, 2019 16:30
The Android implementation of sys/queue.h is missing definitions for TAILQ_CONCAT() and LIST_FOREACH_SAFE().
@triplef
Copy link
Contributor Author

triplef commented Mar 20, 2019

Thanks! :) I’ve updated the patch as discussed.

@compnerd
Copy link
Member

@swift-ci please test

@compnerd
Copy link
Member

CC: @ktopley-apple

@ktopley-apple ktopley-apple merged commit 6e1825a into swiftlang:master Mar 21, 2019
rokhinip pushed a commit that referenced this pull request Nov 5, 2021
Added missing queue macros for building on Android

Signed-off-by: Kim Topley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants