From 04b34ae8ffd6527c0d9f87a09e96e09d0fc59f7f Mon Sep 17 00:00:00 2001 From: TheoryOfNekomata Date: Sat, 25 Feb 2023 15:15:30 +0800 Subject: [PATCH] Implement _strlwr for non-Windows platforms _strlwr is not present on non-Windows platforms. --- midi-utils.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/midi-utils.c b/midi-utils.c index 626a00e..620c890 100644 --- a/midi-utils.c +++ b/midi-utils.c @@ -1,5 +1,15 @@ #include "midi-utils.h" +#if !defined __WIN32 +void _strlwr(char* dest) { + for (unsigned int i = 0; i < strlen(dest); i += 1) { + if ('A' <= dest[i] && dest[i] <= 'Z') { + dest[i] += 0x20; + } + } +} +#endif + char* MIDI_GetNoteName(unsigned char midi_note) { static const char* pitch_names[] = { "C",