Skip to content

added a sys/queue.h implementation for Windows #368

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 1 commit into from
Jun 20, 2018
Merged

added a sys/queue.h implementation for Windows #368

merged 1 commit into from
Jun 20, 2018

Conversation

dplanitzer
Copy link

Added a copy of the Apple / Darwin sys/queue.h and hooked things up such that we use that one when building on Windows because the Windows SDK doesn't come with a sys/queue.h header.

@dplanitzer
Copy link
Author

cc @MadCoder @compnerd

@MadCoder
Copy link
Contributor

We can't do that this isn't the proper license.

@jrose-apple @jckarter @tkremenek what can we do here?

@dplanitzer is there a way to get it from somewhere else? e.g. on linux we use libbsd as a way to get this header from the "SDK".

@compnerd
Copy link
Member

Why can't we use libbsd? I've been building against libbsd for Windows.

@adierking
Copy link
Contributor

I've been working on adding Windows support to libbsd: https://gitlab.freedesktop.org/libbsd/libbsd/merge_requests/1

@tkremenek
Copy link
Member

What precisely is the dependency here on libbsd? Is it just to get a header, or a link dependency? The license issue just needs to be reviewed (I can consult Apple's lawyers), but not necessarily a blocker.

@dplanitzer
Copy link
Author

dplanitzer commented Jun 20, 2018

See my comment here. I can create an independent implementation of needed queue macros instead if that makes things simpler.

@tkremenek
Copy link
Member

@dplanitzer I get a 404 with that link

@dplanitzer
Copy link
Author

dplanitzer commented Jun 20, 2018

@tkremenek sorry about that. Fixed it. It's the last comment on the page.

@dplanitzer
Copy link
Author

@MadCoder @tkremenek I've updated the PR with an independent implementation of the relevant TAILQ macros. Libdispatch only uses a handful of them anyway. I've tested the implementation locally and verified that it works beautifully :)

@MadCoder
Copy link
Contributor

@swift-ci please test

@tkremenek
Copy link
Member

@dplanitzer was the relevant implementation of TAILQ cribbed from the libbsd header? If so, technically that's copyrighted and can't just be copy-and-pasted into another place.

@tkremenek tkremenek self-requested a review June 20, 2018 20:45
@dplanitzer
Copy link
Author

@tkremenek I did a new implementation from scratch based on the documentation in the man 3 queue page. It's a simple standard doubly-linked list implementation while the sys/queue.h thing does something more fancy to avoid a few if-then checks on list manipulation.

@tkremenek
Copy link
Member

@dplanitzer OK, perfect.

@tkremenek
Copy link
Member

I think we can merge this.

@MadCoder MadCoder merged commit 30d3c8c into swiftlang:master Jun 20, 2018
@dplanitzer dplanitzer deleted the sys_queue_h_for_windows branch June 27, 2018 21:46
ktopley-apple pushed a commit that referenced this pull request Dec 6, 2018
added a sys/queue.h implementation for Windows

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.

6 participants