From 418ba2372bd4d71639c2835761ad7a8f7fa57136 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Thu, 26 Sep 2019 10:28:34 +0300 Subject: [PATCH] - fixed compilation with GCC and Clang libraries/wildmidi/file_io.cpp:68:40: error: use of undeclared identifier 'malloc' libraries/wildmidi/wildmidi_lib.cpp:672:10: error: use of undeclared identifier 'stricmp'; did you mean 'strcmp'? libraries/wildmidi/wildmidi_lib.cpp:1011:11: error: use of undeclared identifier 'strnicmp'; did you mean 'strncmp'? --- libraries/wildmidi/CMakeLists.txt | 12 ++++++++++++ libraries/wildmidi/file_io.cpp | 1 + 2 files changed, 13 insertions(+) diff --git a/libraries/wildmidi/CMakeLists.txt b/libraries/wildmidi/CMakeLists.txt index fbecf9f4e..97b7cf807 100644 --- a/libraries/wildmidi/CMakeLists.txt +++ b/libraries/wildmidi/CMakeLists.txt @@ -9,6 +9,18 @@ endif() set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ZD_FASTMATH_FLAG}") +include( CheckFunctionExists ) + +CHECK_FUNCTION_EXISTS( stricmp STRICMP_EXISTS ) +if( NOT STRICMP_EXISTS ) + add_definitions( -Dstricmp=strcasecmp ) +endif() + +CHECK_FUNCTION_EXISTS( strnicmp STRNICMP_EXISTS ) +if( NOT STRNICMP_EXISTS ) + add_definitions( -Dstrnicmp=strncasecmp ) +endif() + include_directories( wildmidi ) file( GLOB HEADER_FILES diff --git a/libraries/wildmidi/file_io.cpp b/libraries/wildmidi/file_io.cpp index c4b6a9ee7..ebdfc5f46 100644 --- a/libraries/wildmidi/file_io.cpp +++ b/libraries/wildmidi/file_io.cpp @@ -35,6 +35,7 @@ #include #include +#include #include "wm_error.h" #include "file_io.h"