mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-12 04:49:03 +08:00
18 lines
601 B
Diff
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;
|