From dffcefbfdf604a4b6310577d595ce665a223798d Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 25 Sep 2019 11:40:20 +0300 Subject: [PATCH] - fixed compilation with GCC and Clang MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit libraries/timidity/instrum_dls.cpp:1071:18: error: ‘INT_MIN’ was not declared in this scope libraries/timidity/instrum_font.cpp:37:47: error: ‘stricmp’ was not declared in this scope libraries/timidity/timidity.cpp:207:32: error: ‘strcmp’ was not declared in this scope libraries/timidity/timidity.cpp:235:24: error: ‘strcmp’ was not declared in this scope libraries/timidity/timidity.cpp:310:33: error: ‘strchr’ was not declared in this scope libraries/timidity/timidity.cpp:515:30: error: ‘strchr’ was not declared in this scope libraries/timidity/timidity.cpp:602:34: error: ‘memset’ was not declared in this scope libraries/timidity/timidity.cpp:648:35: error: ‘memcpy’ was not declared in this scope libraries/timidity/timidity.cpp:753:41: error: ‘memset’ was not declared in this scope --- libraries/timidity/CMakeLists.txt | 7 +++++++ libraries/timidity/instrum_dls.cpp | 1 + libraries/timidity/timidity.cpp | 1 + 3 files changed, 9 insertions(+) diff --git a/libraries/timidity/CMakeLists.txt b/libraries/timidity/CMakeLists.txt index 84dc7d2861..8d3b758ed1 100644 --- a/libraries/timidity/CMakeLists.txt +++ b/libraries/timidity/CMakeLists.txt @@ -9,6 +9,13 @@ 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() + include_directories( timidity ) file( GLOB HEADER_FILES diff --git a/libraries/timidity/instrum_dls.cpp b/libraries/timidity/instrum_dls.cpp index 552090e09d..24c4c2ebcd 100644 --- a/libraries/timidity/instrum_dls.cpp +++ b/libraries/timidity/instrum_dls.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "t_swap.h" #include "timidity.h" diff --git a/libraries/timidity/timidity.cpp b/libraries/timidity/timidity.cpp index 1d7d09c64f..3255de186f 100644 --- a/libraries/timidity/timidity.cpp +++ b/libraries/timidity/timidity.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include "timidity.h" #include "timidity_file.h"