-
Notifications
You must be signed in to change notification settings - Fork 145
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
fix build on mingw #446
base: master
Are you sure you want to change the base?
fix build on mingw #446
Changes from all commits
765a6da
37f4785
88679c0
2f615c0
2189000
be31c45
c1bd5cd
8783407
410660f
d911291
ff4d2b2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ | |
#include <stdint.h> | ||
#include <stddef.h> | ||
|
||
#ifdef _WINDOWS | ||
#ifdef _WIN32 | ||
#include <intrin.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please do not change this code, that would break the native Visual Studio implementation. If you really prefer using the string "_WIN32", then you could write: #if defined(_WIN32) || defined(_WINDOWS) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You don't need to define _WINDOWS since _WIN32 is always set on Windows. (even if Windows 64 bit) |
||
#endif | ||
|
||
|
@@ -298,7 +298,7 @@ static inline void copy_bytes_unaligned(uint8_t *out, const uint8_t *in, size_t | |
|
||
static inline uint32_t count_trailing_zeroes(uint32_t x) | ||
{ | ||
#ifdef _WINDOWS | ||
#ifdef _WIN32 | ||
uint32_t r = 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same remark as above. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I replaced all _WINDOWS to _WIN32 since _WINDOWS is not required for mingw and Visual Studio both. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am dubious about this because the CI checks are not running after your changes in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason the ci didn't run after this change is because I merged this change from another branch. https://github.com/mattn/picotls/actions @kazuho could you please re-run the action for latest changes ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mattn Mind pushing an empty commit? I think @huitema is wondering if we could rerun CI on appveyor. Regarding Official documentation does state that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it is not something that Visual Studio sets. It is something that I kind of invented 5 years ago as I was trying to make things work. I think that to be complete, we should also edit the Visual Studio projects that use the _WINDOWS and _WINDOWS64 macros. But I could do that in a different PR. As soon as I see a correct test run, I will approve the changes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. AFAIK, _WIN32 can be used for checking Windows OS from 12 years ago at least. For example, I used _WIN32 in 2010 that works with both compilers. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mattn I do realize that I made a mistake 5 years ago. As I said, I just need to see the test run... |
||
_BitScanReverse(&r, x); | ||
return (31 - r); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name "windows" is a bit confusing, as we also have a direct port on Windows relying on Visual Studio. Maybe use "mingw" for clarity?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that this change broke the CI tests -- they did not run at all after that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current implementation of t/cli.c have many UNIX-ish codes. So we can not run it. But this can be useful to check build error for future's changes at least.