-
Notifications
You must be signed in to change notification settings - Fork 140
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 a typedef instead of a #define for ssize_t with MSVC #32
Conversation
A Maybe wrap the |
Will try it, but I don't think that'll work since the libuv headers aren't checking |
The full failure, for reference, is
We could either use the same |
If we This is a general problem with defining our own symbols with standard names — other libraries are bound to use the same names. |
I'm not sure I understand the problem. If libuv is |
I would think it might, but it apparently wasn't an issue at least in this limited case of utf8proc and libuv. Maybe if the typedefs are consistent enough, the compiler doesn't complain?
See https://github.com/JuliaLang/libuv/blob/abcbb0c22faa527c427e1ea6b55f073836b26f69/include/uv-win.h#L26-L30 for precisely what libuv is doing. It's using |
As an alternative, we could pick a less-likely-to-collide name, something like |
172bf28
to
ad27722
Compare
That avoids the MSVC issue, and Travis and Appveyor look happy with it. |
Picking a new name seems like the best practice. But we should also probably define |
Perhaps. I was wanting to avoid extra work to fix problems that I haven't had, but I could go even more nuts with grep and sed if needed. MSVC has been gradually improving in its C99 compliance recently, so many of these typedefs aren't needed with modern versions, but laziness probably isn't a good enough reason to not at least leave in the possibility of support for old versions. The Python 2 community will be continuing to use MSVC 2008 for several more years at the very least. |
Done. This latest commit seems like overkill to me, take it or leave it. Note that I didn't touch the contents of |
Okay to merge this, or is that second commit too ugly? |
Should be okay to merge. |
Use a typedef instead of a #define for ssize_t with MSVC
Thanks! |
Presumably we can merge master into the release-1.2 branch at some point. |
I was seeing the define for
ssize_t
cause some collisions and compilation errors in Julia (with MSVC) due to libuv also using this type. I think a typedef would be preferable? Could potentially useintptr_t
for this instead, but I'm not sure exactly which versions of MSVC would support that.