-
Notifications
You must be signed in to change notification settings - Fork 278
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
Fixed some cpplib build issues under Windows/Mingw. #100
Changes from all commits
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 @@ | |
|
||
// define this to use C++11 std::mutex for locking | ||
#ifdef LIBPD_USE_STD_MUTEX | ||
#if __cplusplus < 201103L | ||
#ifdef _WIN32 | ||
// __cplusplus is badly behaved in windows. just assume we have mutex | ||
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 don't like this. Why just assume? Maybe someone is using libpd with an older C++ library and can't compile it with C++11 support? That's the point of the __cplusplus version check. 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 problem is that some versions of msvc implements mutex but have _cplusplus=199711L. I agree it is bad to assume. One way around this would be to use _MSC_VER or a user-configurable header. 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. Ok, I follow you. In looking around stack overflow, it seems like doing an explicit check will not always work since compilers can lie and not everything might be supported. In that case, it's better to leave the responsibility on the user and honor the define. I've decided to drop the _cplusplus check. |
||
#include <mutex> | ||
#elif __cplusplus < 201103L | ||
#warning std::mutex requires C++11 | ||
#else | ||
#include <mutex> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ else | |
ifeq ($(OS), Windows_NT) # Windows, use Mingw | ||
SOLIB_EXT = dll | ||
PDNATIVE_PLATFORM = windows | ||
CC = gcc | ||
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. If you're running in msys, isn't this set by default? 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. Hmm not sure, maybe it was set to cc by default. |
||
else # Assume Linux | ||
SOLIB_EXT = so | ||
PDNATIVE_PLATFORM = linux | ||
|
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.
Shouldn't this be handled on the line above?
--output-def=libs/libpd.def
Aren't the symbols available in the def file? Just double-checking.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 can't remember why I had to do this, sorry.