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

Use uint64 on win64 for fd type #34

Closed
wants to merge 1 commit into from

Conversation

yitzchak
Copy link
Contributor

zmq_poll appears broken on win64 due to the fact that the fd slot in the poll struct is a uint64 on that OS. The most recent version of libzmq uses the type zmq_fd_t to account for this. Unfortunately. there are versions of libzmq around on Windows and elsewhere that don't have this type. Older versions just had a #ifdef directly in the struct definition subsituting the SOCKET type on Windows. To account for this I used a read-time conditional instead.

The original issue is from common-lisp-jupyter, The details are at the very bottom of the issue.

yitzchak/common-lisp-jupyter#65 (comment)

@orivej
Copy link
Owner

orivej commented May 16, 2021

I've looked up that zmq_fd_t was introduced in zeromq/libzmq#3498 and released in 4.3.2. Your change looks good time, will merge soon.

I was writing the bindings based on the documentation, and it still says that zmq_pollitem_t.fd is int, even though it was uintptr on Windows since 2009:
http://api.zeromq.org/master:zmq-poll
https://github.com/zeromq/libzmq/blob/v4.3.4/doc/zmq_poll.txt#L28
zeromq/libzmq@d4fdc26
Would you like to report this issue to libzmq devs?

@yitzchak
Copy link
Contributor Author

I can do that.

orivej added a commit that referenced this pull request May 16, 2021
This accounts for variable fd size on Windows.

Fixes #34
@orivej orivej mentioned this pull request May 16, 2021
@orivej
Copy link
Owner

orivej commented May 16, 2021

Could you review and test an alternative fix in #35? It allows us to ignore fd field size.

@orivej orivej closed this in #35 May 16, 2021
orivej added a commit that referenced this pull request May 16, 2021
This accounts for variable fd size on Windows.

Fixes #34
@yitzchak yitzchak deleted the fix-win64-poll branch May 16, 2021 14:02
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.

None yet

2 participants