vcpkg/ports/rtmidi/fix-POSIXname.patch
wangli28 21445878eb [rtmidi] Update to version 4.0.0 (#6635)
* [rtmidi] Update to version 4.0.0

* Fix UNIX install failed.
2019-05-29 00:09:41 -07:00

18 lines
601 B
Diff

diff --git a/rtmidi_c.cpp b/rtmidi_c.cpp
index 248c9e5..ec1dd38 100644
--- a/rtmidi_c.cpp
+++ b/rtmidi_c.cpp
@@ -136,7 +136,11 @@ const char* rtmidi_get_port_name (RtMidiPtr device, unsigned int portNumber)
{
try {
std::string name = ((RtMidi*) device->ptr)->getPortName (portNumber);
- return strdup (name.c_str ());
+#if defined(_WIN) || defined(WINAPI_FAMILY) //Windows platform
+ return _strdup (name.c_str ());
+#else // Unix platform
+ return strdup (name.c_str ());
+#endif
} catch (const RtMidiError & err) {
device->ok = false;