-
Notifications
You must be signed in to change notification settings - Fork 470
Support compiling on MSYS2 #814
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
Changes from 1 commit
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 |
---|---|---|
|
@@ -24,7 +24,10 @@ | |
// Unices provide `howmany` via sys/param.h | ||
#define howmany(x, y) (((x) + ((y) - 1)) / (y)) | ||
|
||
#ifndef _MODE_T_ | ||
#define _MODE_T_ | ||
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. Is there no generic way to avoid this? I'd rather not encode the macro that MinGW uses for this into the header. Why not hoist this into a check in CMake and use |
||
typedef int mode_t; | ||
#endif | ||
typedef void pthread_attr_t; | ||
|
||
#ifndef API_AVAILABLE | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,9 @@ | |
#include <Windows.h> | ||
|
||
typedef int kern_return_t; | ||
#ifndef _PID_T_ | ||
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. Similar |
||
typedef int pid_t; | ||
#endif | ||
|
||
#if defined(_WIN64) | ||
typedef long long ssize_t; | ||
|
@@ -68,8 +70,10 @@ mach_timebase_info(mach_timebase_info_t tbi) | |
return 0; | ||
} | ||
|
||
#ifndef HAVE_MKSTEMP | ||
dispatch_fd_t | ||
mkstemp(char *tmpl); | ||
#endif | ||
|
||
void | ||
print_winapi_error(const char *function_name, DWORD error); | ||
|
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 believe this project compiles on Windows using clang-cl. In that case, all of the compiler options defined below can be passed to the clang-cl compiler. That surfaces a bunch of warnings, which could be fixed in a follow-up PR.
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.
IIRC,
-fms-extensions
are non-conforming extensions and we should not be enabling them. If MinGW requires that, then it should be done under aMINGW
specific clause.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.
You need
-fms-extensions
because__popcnt64
is used in hw_config.h. That's a Microsoft-specific extension.The source code, as it stands, requires this Microsoft-specific extension when targeting the Windows platform. I assume you don't need to make it explicit on Windows because you're using
clang-cl
(which enables-fms-extensions
by default), or the MSVC compiler.I think the proper condition is "when targeting Windows but not using a MSVC-compatible compiler`, let me try to refine that if clause.