Skip to content

Conversation

@Nytra
Copy link
Contributor

@Nytra Nytra commented Sep 25, 2025

Changes strdup to _strdup

Fixes the following build error on Windows 11 with VS2022:

rtmidi_c.cpp(420,19): error C4996: 'strdup': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _strdup. See online help for details.

@Nytra
Copy link
Contributor Author

Nytra commented Sep 25, 2025

Looks like this breaks the build on Linux and MacOS

@Nytra
Copy link
Contributor Author

Nytra commented Sep 25, 2025

Could be fixed with the following I think, although it's a bit of a hack

#ifdef _MSC_VER
#define strdup _strdup
#endif

@Nytra
Copy link
Contributor Author

Nytra commented Sep 25, 2025

Changing SDLCheck to false in rtmidilib.vcxproj fixes it too, not sure if that would be preferable

@keinstein
Copy link

keinstein commented Sep 27, 2025

Ironically C24 has adopted the strdup functiion as mentioned in the ANSI C Blog so _strdup will probably be deprecated in the far future.

@garyscavone garyscavone merged commit c025d46 into thestk:master Sep 30, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants