external libs, libmodplug: sync src with my work. no need for rebuild for now.
authorOzkan Sezer <sezeroz@gmail.com>
Thu, 28 Nov 2019 03:10:00 +0300
changeset 104922ad5c77e1be
parent 1048 569f5be0f8ec
child 1050 300088719593
external libs, libmodplug: sync src with my work. no need for rebuild for now.
external/libmodplug-0.8.9.0/CMakeLists.txt
external/libmodplug-0.8.9.0/Makefile.am
external/libmodplug-0.8.9.0/Makefile.in
external/libmodplug-0.8.9.0/configure
external/libmodplug-0.8.9.0/configure.ac
external/libmodplug-0.8.9.0/libmodplug-0.8.9.0.patch
external/libmodplug-0.8.9.0/src/Makefile.am
external/libmodplug-0.8.9.0/src/Makefile.in
external/libmodplug-0.8.9.0/src/config.h.in
external/libmodplug-0.8.9.0/src/libmodplug/sndfile.h
external/libmodplug-0.8.9.0/src/libmodplug/stdafx.h
external/libmodplug-0.8.9.0/src/load_abc.cpp
external/libmodplug-0.8.9.0/src/load_mid.cpp
external/libmodplug-0.8.9.0/src/load_pat.cpp
external/libmodplug-0.8.9.0/src/load_wav.cpp
     1.1 --- a/external/libmodplug-0.8.9.0/CMakeLists.txt	Wed Nov 27 17:41:28 2019 +0100
     1.2 +++ b/external/libmodplug-0.8.9.0/CMakeLists.txt	Thu Nov 28 03:10:00 2019 +0300
     1.3 @@ -1,103 +1,184 @@
     1.4 -cmake_minimum_required(VERSION 3.2)
     1.5 -project(libModPlug VERSION 0.8.9.0 LANGUAGES CXX)
     1.6 +cmake_minimum_required(VERSION 2.8.0)
     1.7  
     1.8 -include(CheckFunctionExists)
     1.9 -include(CheckIncludeFile)
    1.10 -include(${CMAKE_CURRENT_SOURCE_DIR}/../audio_codec_common.cmake)
    1.11 +project(libmodplug)
    1.12  
    1.13 -if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
    1.14 -    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -std=gnu99")
    1.15 -    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-pedantic -std=gnu++98 -Wno-sequence-point")
    1.16 -    if(NOT APPLE)
    1.17 -        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-but-set-variable")
    1.18 -    endif()
    1.19 +set(VERSION "0.8.9.0")
    1.20 +
    1.21 +option(BUILD_SHARED_LIBS "Build Shared Library (DLL)" OFF)
    1.22 +option(EXPORT_CXX "Export C++ interface from library" ON)
    1.23 +option(MIDIFMT_SUPPORT "Enable midi formats support" OFF)
    1.24 +option(WAV_SUPPORT "Enable wav formats support" OFF)
    1.25 +option(MMCMP_SUPPORT "Enable mmcmp and pp20 decompression support" OFF)
    1.26 +
    1.27 +add_definitions(-DMODPLUG_BUILD)
    1.28 +if(MIDIFMT_SUPPORT)
    1.29 +  add_definitions(-DMIDIFMT_SUPPORT)
    1.30 +endif()
    1.31 +if(WAV_SUPPORT)
    1.32 +  add_definitions(-DWAV_SUPPORT)
    1.33 +endif()
    1.34 +if(MMCMP_SUPPORT)
    1.35 +  add_definitions(-DMMCMP_SUPPORT)
    1.36 +endif()
    1.37 +if(NOT EXPORT_CXX)
    1.38 +  add_definitions(-DNO_CXX_EXPORTS)
    1.39 +else()
    1.40 +  set(HEADERS_CXX
    1.41 +      src/libmodplug/it_defs.h
    1.42 +      src/libmodplug/sndfile.h
    1.43 +      src/libmodplug/stdafx.h)
    1.44  endif()
    1.45  
    1.46 -if(MSVC)
    1.47 -    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4100 /wd4244 /wd4267 /wd4996 /wd4702 /wd4706 /wd4456")
    1.48 +include (CheckFunctionExists)
    1.49 +include (CheckIncludeFile)
    1.50 +include (CheckCCompilerFlag)
    1.51 +include (CheckCSourceCompiles)
    1.52 +include (TestBigEndian)
    1.53 +
    1.54 +TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
    1.55 +if(WORDS_BIGENDIAN)
    1.56 +  add_definitions(-DWORDS_BIGENDIAN=1)
    1.57  endif()
    1.58  
    1.59 -add_definitions(
    1.60 -    #-DMODPLUG_NO_FILESAVE
    1.61 -    #-DNO_MIDIFORMATS
    1.62 -    #-DNO_WAVFORMAT
    1.63 -    -DHAVE_CONFIG_H
    1.64 -    -DHAVE_CMAKE_CONFIG_H
    1.65 -    -DMODPLUG_STATIC
    1.66 -    -DMODPLUG_BUILD=1
    1.67 -    -D_REENTRANT
    1.68 -    -D_USE_MATH_DEFINES
    1.69 +if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
    1.70 +  add_definitions(-Wall)
    1.71 +  # check symbol visibility attributes
    1.72 +  set(OLD_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
    1.73 +  if(NOT WIN32 AND NOT CYGWIN)
    1.74 +    set(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS} -Werror")
    1.75 +    check_c_source_compiles("int foo(void) __attribute__((visibility(\"default\")));
    1.76 +                             int main(void) {return 0;}" HAVE_VISIBILITY_DEFAULT)
    1.77 +    if(HAVE_VISIBILITY_DEFAULT)
    1.78 +      check_c_compiler_flag(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN)
    1.79 +    endif()
    1.80 +  endif()
    1.81 +  set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
    1.82 +  check_c_compiler_flag("" HAVE_NO_UNDEFINED)
    1.83 +  set(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS}")
    1.84 +endif()
    1.85 +
    1.86 +include_directories(AFTER
    1.87 +  src
    1.88 +  src/libmodplug
    1.89 +  ${PROJECT_BINARY_DIR}
    1.90  )
    1.91  
    1.92 -foreach(_FN
    1.93 -        setenv putenv
    1.94 -        )
    1.95 -    string(TOUPPER ${_FN} _UPPER)
    1.96 -    set(_HAVEVAR "HAVE_${_UPPER}")
    1.97 -    CHECK_FUNCTION_EXISTS("${_FN}" ${_HAVEVAR})
    1.98 -endforeach()
    1.99 +if(UNIX AND NOT APPLE)
   1.100 +  find_library(MATH_LIB m)
   1.101 +  if(MATH_LIB)
   1.102 +    set(CMAKE_REQUIRED_LIBRARIES m)
   1.103 +  endif()
   1.104 +endif()
   1.105  
   1.106 -CHECK_INCLUDE_FILE("malloc.h" HAVE_MALLOC_H)
   1.107 -CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
   1.108 -CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
   1.109 +if (WIN32)
   1.110 +  add_definitions(-D_USE_MATH_DEFINES)
   1.111 +  add_definitions(-DNOMINMAX)
   1.112 +endif()
   1.113  
   1.114 -CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config/config.h)
   1.115 -include_directories(${CMAKE_CURRENT_BINARY_DIR}/config/)
   1.116 +check_include_file("stdint.h" HAVE_STDINT)
   1.117 +if (HAVE_STDINT)
   1.118 +  add_definitions(-DHAVE_STDINT_H)
   1.119 +endif()
   1.120  
   1.121 -add_library(modplug STATIC
   1.122 -    src/fastmix.cpp
   1.123 -    src/load_669.cpp
   1.124 -    src/load_abc.cpp
   1.125 -    src/load_amf.cpp
   1.126 -    src/load_ams.cpp
   1.127 -    src/load_dbm.cpp
   1.128 -    src/load_dmf.cpp
   1.129 -    src/load_dsm.cpp
   1.130 -    src/load_far.cpp
   1.131 -    src/load_it.cpp
   1.132 -    src/load_mdl.cpp
   1.133 -    src/load_med.cpp
   1.134 -    #src/load_mid.cpp
   1.135 -    src/load_mod.cpp
   1.136 -    src/load_mt2.cpp
   1.137 -    src/load_mtm.cpp
   1.138 -    src/load_okt.cpp
   1.139 -    src/load_pat.cpp
   1.140 -    src/load_psm.cpp
   1.141 -    src/load_ptm.cpp
   1.142 -    src/load_s3m.cpp
   1.143 -    src/load_stm.cpp
   1.144 -    src/load_ult.cpp
   1.145 -    src/load_umx.cpp
   1.146 -    #src/load_wav.cpp
   1.147 -    src/load_xm.cpp
   1.148 -    src/mmcmp.cpp
   1.149 -    src/modplug.cpp
   1.150 -    src/snd_dsp.cpp
   1.151 -    src/snd_flt.cpp
   1.152 -    src/snd_fx.cpp
   1.153 -    src/sndfile.cpp
   1.154 -    src/sndmix.cpp
   1.155 +check_function_exists("sinf" HAVE_SINF)
   1.156 +if(HAVE_SINF)
   1.157 +  add_definitions(-DHAVE_SINF)
   1.158 +endif()
   1.159 +
   1.160 +if (BUILD_SHARED_LIBS)
   1.161 +  set (LIB_TYPE SHARED)
   1.162 +  if (WIN32 OR CYGWIN)
   1.163 +    add_definitions(-DDLL_EXPORT)
   1.164 +  elseif (HAVE_VISIBILITY_HIDDEN)
   1.165 +    add_definitions(-fvisibility=hidden)
   1.166 +    add_definitions("-DSYM_VISIBILITY")
   1.167 +  endif()
   1.168 +else ()
   1.169 +  set(LIB_TYPE STATIC)
   1.170 +  add_definitions(-DMODPLUG_STATIC)
   1.171 +endif()
   1.172 +
   1.173 +add_library(modplug ${LIB_TYPE}
   1.174 +  src/libmodplug/it_defs.h
   1.175 +  src/libmodplug/sndfile.h
   1.176 +  src/libmodplug/stdafx.h
   1.177 +
   1.178 +  src/fastmix.cpp
   1.179 +  src/load_669.cpp
   1.180 +  src/load_abc.cpp
   1.181 +  src/load_amf.cpp
   1.182 +  src/load_ams.cpp
   1.183 +  src/load_dbm.cpp
   1.184 +  src/load_dmf.cpp
   1.185 +  src/load_dsm.cpp
   1.186 +  src/load_far.cpp
   1.187 +  src/load_it.cpp
   1.188 +  src/load_mdl.cpp
   1.189 +  src/load_med.cpp
   1.190 +  src/load_mid.cpp
   1.191 +  src/load_mod.cpp
   1.192 +  src/load_mt2.cpp
   1.193 +  src/load_mtm.cpp
   1.194 +  src/load_okt.cpp
   1.195 +  src/load_pat.cpp
   1.196 +  src/load_pat.h
   1.197 +  src/load_psm.cpp
   1.198 +  src/load_ptm.cpp
   1.199 +  src/load_s3m.cpp
   1.200 +  src/load_stm.cpp
   1.201 +  src/load_ult.cpp
   1.202 +  src/load_umx.cpp
   1.203 +  src/load_wav.cpp
   1.204 +  src/load_xm.cpp
   1.205 +  src/mmcmp.cpp
   1.206 +  src/modplug.cpp
   1.207 +  src/modplug.h
   1.208 +  src/snd_dsp.cpp
   1.209 +  src/snd_flt.cpp
   1.210 +  src/snd_fx.cpp
   1.211 +  src/sndfile.cpp
   1.212 +  src/sndmix.cpp
   1.213 +  src/tables.h
   1.214  )
   1.215  
   1.216 -# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include_p)
   1.217 -# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
   1.218 -# include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../libogg/include)
   1.219 +if (BUILD_SHARED_LIBS)
   1.220 +  if(APPLE)
   1.221 +    target_link_libraries(modplug -Wl,-undefined,error)
   1.222 +    target_link_libraries(modplug -Wl,-compatibility_version,2.0.0)
   1.223 +    target_link_libraries(modplug -Wl,-current_version,2.0.0)
   1.224 +  else()
   1.225 +    if(HAVE_NO_UNDEFINED)
   1.226 +      target_link_libraries(modplug -Wl,--no-undefined)
   1.227 +    endif()
   1.228 +    set_target_properties(modplug PROPERTIES
   1.229 +                                  VERSION 1.0.0 SOVERSION 1)
   1.230 +  endif()
   1.231 +  if(MATH_LIB)
   1.232 +    target_link_libraries(modplug m)
   1.233 +  endif()
   1.234 +endif()
   1.235  
   1.236 -target_include_directories(modplug PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
   1.237 -target_include_directories(modplug PRIVATE
   1.238 -        ${CMAKE_CURRENT_SOURCE_DIR}/include/libmodplug
   1.239 -        ${CMAKE_CURRENT_SOURCE_DIR}/src
   1.240 -        ${CMAKE_CURRENT_SOURCE_DIR}/src/libmodplug
   1.241 +# install the library:
   1.242 +install(TARGETS modplug DESTINATION lib)
   1.243 +
   1.244 +# install the headers:
   1.245 +install(FILES
   1.246 +  src/modplug.h
   1.247 +  ${HEADERS_CXX}
   1.248 +
   1.249 +  DESTINATION
   1.250 +  include/libmodplug
   1.251  )
   1.252  
   1.253 -install(TARGETS modplug
   1.254 -        LIBRARY DESTINATION "lib"
   1.255 -        ARCHIVE DESTINATION "lib"
   1.256 -        INCLUDES DESTINATION "include")
   1.257 +if (NOT WIN32)
   1.258 +  set(prefix "${CMAKE_INSTALL_PREFIX}")
   1.259 +  set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
   1.260 +  set(libdir "${CMAKE_INSTALL_PREFIX}/lib")
   1.261 +  set(includedir "${CMAKE_INSTALL_PREFIX}/include")
   1.262 +  configure_file(libmodplug.pc.in libmodplug.pc)
   1.263  
   1.264 -install(FILES
   1.265 -        include/libmodplug/modplug.h
   1.266 -        DESTINATION include/libmodplug/)
   1.267 -
   1.268 -
   1.269 +  # install pkg-config file:
   1.270 +  install(FILES "${PROJECT_BINARY_DIR}/libmodplug.pc"
   1.271 +    DESTINATION lib/pkgconfig
   1.272 +  )
   1.273 +endif (NOT WIN32)
     2.1 --- a/external/libmodplug-0.8.9.0/Makefile.am	Wed Nov 27 17:41:28 2019 +0100
     2.2 +++ b/external/libmodplug-0.8.9.0/Makefile.am	Thu Nov 28 03:10:00 2019 +0300
     2.3 @@ -2,7 +2,7 @@
     2.4  
     2.5  SUBDIRS = src
     2.6  
     2.7 -EXTRA_DIST =	 \
     2.8 +EXTRA_DIST = CMakeLists.txt \
     2.9  	AUTHORS COPYING ChangeLog \
    2.10  	INSTALL README TODO
    2.11  
     3.1 --- a/external/libmodplug-0.8.9.0/Makefile.in	Wed Nov 27 17:41:28 2019 +0100
     3.2 +++ b/external/libmodplug-0.8.9.0/Makefile.in	Thu Nov 28 03:10:00 2019 +0300
     3.3 @@ -359,7 +359,7 @@
     3.4  top_srcdir = @top_srcdir@
     3.5  ACLOCAL_AMFLAGS = -I m4
     3.6  SUBDIRS = src
     3.7 -EXTRA_DIST = \
     3.8 +EXTRA_DIST = CMakeLists.txt \
     3.9  	AUTHORS COPYING ChangeLog \
    3.10  	INSTALL README TODO
    3.11  
     4.1 --- a/external/libmodplug-0.8.9.0/configure	Wed Nov 27 17:41:28 2019 +0100
     4.2 +++ b/external/libmodplug-0.8.9.0/configure	Thu Nov 28 03:10:00 2019 +0300
     4.3 @@ -634,6 +634,8 @@
     4.4  LTLIBOBJS
     4.5  LIBOBJS
     4.6  MODPLUG_LIBRARY_VERSION
     4.7 +EXPORT_CXX_FALSE
     4.8 +EXPORT_CXX_TRUE
     4.9  LT_LDFLAGS
    4.10  LT_SYS_LIBRARY_PATH
    4.11  OTOOL64
    4.12 @@ -772,6 +774,10 @@
    4.13  with_gnu_ld
    4.14  with_sysroot
    4.15  enable_libtool_lock
    4.16 +enable_cxx_interface
    4.17 +enable_midi
    4.18 +enable_wav
    4.19 +enable_mmcmp
    4.20  '
    4.21        ac_precious_vars='build_alias
    4.22  host_alias
    4.23 @@ -1418,6 +1424,11 @@
    4.24    --enable-fast-install[=PKGS]
    4.25                            optimize for fast installation [default=yes]
    4.26    --disable-libtool-lock  avoid locking (might break parallel builds)
    4.27 +  --enable-cxx-interface  export C++ interface from library [[default=yes]]
    4.28 +  --enable-midi           compile with midi formats support [[default=no]]
    4.29 +  --enable-wav            compile with wav formats support [[default=no]]
    4.30 +  --enable-mmcmp          compile with mmcmp and pp20 decompression support
    4.31 +                          [[default=no]]
    4.32  
    4.33  Optional Packages:
    4.34    --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
    4.35 @@ -16785,6 +16796,66 @@
    4.36  		;;
    4.37  esac
    4.38  
    4.39 +# Check whether --enable-cxx_interface was given.
    4.40 +if test "${enable_cxx_interface+set}" = set; then :
    4.41 +  enableval=$enable_cxx_interface;
    4.42 +else
    4.43 +  enable_cxx_interface=yes
    4.44 +fi
    4.45 +
    4.46 +if test x$enable_cxx_interface != xyes; then
    4.47 +
    4.48 +$as_echo "#define NO_CXX_EXPORTS 1" >>confdefs.h
    4.49 +
    4.50 +fi
    4.51 + if test x$enable_cxx_interface = xyes; then
    4.52 +  EXPORT_CXX_TRUE=
    4.53 +  EXPORT_CXX_FALSE='#'
    4.54 +else
    4.55 +  EXPORT_CXX_TRUE='#'
    4.56 +  EXPORT_CXX_FALSE=
    4.57 +fi
    4.58 +
    4.59 +
    4.60 +# Check whether --enable-midi was given.
    4.61 +if test "${enable_midi+set}" = set; then :
    4.62 +  enableval=$enable_midi;
    4.63 +else
    4.64 +  enable_midi=no
    4.65 +fi
    4.66 +
    4.67 +if test x$enable_midi = xyes; then
    4.68 +
    4.69 +$as_echo "#define MIDIFMT_SUPPORT 1" >>confdefs.h
    4.70 +
    4.71 +fi
    4.72 +
    4.73 +# Check whether --enable-wav was given.
    4.74 +if test "${enable_wav+set}" = set; then :
    4.75 +  enableval=$enable_wav;
    4.76 +else
    4.77 +  enable_wav=no
    4.78 +fi
    4.79 +
    4.80 +if test x$enable_wav = xyes; then
    4.81 +
    4.82 +$as_echo "#define WAV_SUPPORT 1" >>confdefs.h
    4.83 +
    4.84 +fi
    4.85 +
    4.86 +# Check whether --enable-mmcmp was given.
    4.87 +if test "${enable_mmcmp+set}" = set; then :
    4.88 +  enableval=$enable_mmcmp;
    4.89 +else
    4.90 +  enable_mmcmp=no
    4.91 +fi
    4.92 +
    4.93 +if test x$enable_mmcmp = xyes; then
    4.94 +
    4.95 +$as_echo "#define MMCMP_SUPPORT 1" >>confdefs.h
    4.96 +
    4.97 +fi
    4.98 +
    4.99  # portable types. requires autoconf 2.60
   4.100  # `configure' will check if these are defined in system headers.
   4.101  # if not, it will auto-detect and define them in `config.h'
   4.102 @@ -17035,6 +17106,10 @@
   4.103  Usually this means the macro was only invoked conditionally." "$LINENO" 5
   4.104  fi
   4.105  
   4.106 +if test -z "${EXPORT_CXX_TRUE}" && test -z "${EXPORT_CXX_FALSE}"; then
   4.107 +  as_fn_error $? "conditional \"EXPORT_CXX\" was never defined.
   4.108 +Usually this means the macro was only invoked conditionally." "$LINENO" 5
   4.109 +fi
   4.110  
   4.111  : "${CONFIG_STATUS=./config.status}"
   4.112  ac_write_fail=0
     5.1 --- a/external/libmodplug-0.8.9.0/configure.ac	Wed Nov 27 17:41:28 2019 +0100
     5.2 +++ b/external/libmodplug-0.8.9.0/configure.ac	Thu Nov 28 03:10:00 2019 +0300
     5.3 @@ -82,6 +82,39 @@
     5.4  		;;
     5.5  esac
     5.6  
     5.7 +AC_ARG_ENABLE([cxx_interface],
     5.8 +    [AS_HELP_STRING([--enable-cxx-interface],
     5.9 +                    [export C++ interface from library [[default=yes]]])],,
    5.10 +    [enable_cxx_interface=yes])
    5.11 +if test x$enable_cxx_interface != xyes; then
    5.12 +    AC_DEFINE(NO_CXX_EXPORTS, 1, [Do not export the C++ interface.])
    5.13 +fi
    5.14 +AM_CONDITIONAL(EXPORT_CXX, test x$enable_cxx_interface = xyes)
    5.15 +
    5.16 +AC_ARG_ENABLE([midi],
    5.17 +    [AS_HELP_STRING([--enable-midi],
    5.18 +                    [compile with midi formats support [[default=no]]])],,
    5.19 +    [enable_midi=no])
    5.20 +if test x$enable_midi = xyes; then
    5.21 +    AC_DEFINE(MIDIFMT_SUPPORT, 1, [Enable midi formats support.])
    5.22 +fi
    5.23 +
    5.24 +AC_ARG_ENABLE([wav],
    5.25 +    [AS_HELP_STRING([--enable-wav],
    5.26 +                    [compile with wav formats support [[default=no]]])],,
    5.27 +    [enable_wav=no])
    5.28 +if test x$enable_wav = xyes; then
    5.29 +    AC_DEFINE(WAV_SUPPORT, 1, [Enable wav formats support.])
    5.30 +fi
    5.31 +
    5.32 +AC_ARG_ENABLE([mmcmp],
    5.33 +    [AS_HELP_STRING([--enable-mmcmp],
    5.34 +                    [compile with mmcmp and pp20 decompression support [[default=no]]])],,
    5.35 +    [enable_mmcmp=no])
    5.36 +if test x$enable_mmcmp = xyes; then
    5.37 +    AC_DEFINE(MMCMP_SUPPORT, 1, [Enable mmcmp and pp20 decompression support.])
    5.38 +fi
    5.39 +
    5.40  # portable types. requires autoconf 2.60
    5.41  # `configure' will check if these are defined in system headers.
    5.42  # if not, it will auto-detect and define them in `config.h'
     6.1 --- a/external/libmodplug-0.8.9.0/libmodplug-0.8.9.0.patch	Wed Nov 27 17:41:28 2019 +0100
     6.2 +++ b/external/libmodplug-0.8.9.0/libmodplug-0.8.9.0.patch	Thu Nov 28 03:10:00 2019 +0300
     6.3 @@ -1,4 +1,4 @@
     6.4 -synced with libmodplug git, with furter changes in mainstream git, including:
     6.5 +synced with libmodplug git -- with further changes, including:
     6.6  
     6.7  - don't export cplusplus interface from shared libs. SDL_mixer doesn't use it.
     6.8  - disable wav formats handling: SDL_mixer has its own code for it.
     6.9 @@ -26,7 +26,47 @@
    6.10   
    6.11   CXXFLAGS="$CXXFLAGS -fno-exceptions -Wall -ffast-math -fno-common -D_REENTRANT"
    6.12   
    6.13 -@@ -99,6 +99,6 @@ MODPLUG_LIBRARY_VERSION=1:0:0
    6.14 +@@ -82,6 +82,39 @@ case ${target_os} in
    6.15 + 		;;
    6.16 + esac
    6.17 + 
    6.18 ++AC_ARG_ENABLE([cxx_interface],
    6.19 ++    [AS_HELP_STRING([--enable-cxx-interface],
    6.20 ++                    [export C++ interface from library [[default=yes]]])],,
    6.21 ++    [enable_cxx_interface=yes])
    6.22 ++if test x$enable_cxx_interface != xyes; then
    6.23 ++    AC_DEFINE(NO_CXX_EXPORTS, 1, [Do not export the C++ interface.])
    6.24 ++fi
    6.25 ++AM_CONDITIONAL(EXPORT_CXX, test x$enable_cxx_interface = xyes)
    6.26 ++
    6.27 ++AC_ARG_ENABLE([midi],
    6.28 ++    [AS_HELP_STRING([--enable-midi],
    6.29 ++                    [compile with midi formats support [[default=no]]])],,
    6.30 ++    [enable_midi=no])
    6.31 ++if test x$enable_midi = xyes; then
    6.32 ++    AC_DEFINE(MIDIFMT_SUPPORT, 1, [Enable midi formats support.])
    6.33 ++fi
    6.34 ++
    6.35 ++AC_ARG_ENABLE([wav],
    6.36 ++    [AS_HELP_STRING([--enable-wav],
    6.37 ++                    [compile with wav formats support [[default=no]]])],,
    6.38 ++    [enable_wav=no])
    6.39 ++if test x$enable_wav = xyes; then
    6.40 ++    AC_DEFINE(WAV_SUPPORT, 1, [Enable wav formats support.])
    6.41 ++fi
    6.42 ++
    6.43 ++AC_ARG_ENABLE([mmcmp],
    6.44 ++    [AS_HELP_STRING([--enable-mmcmp],
    6.45 ++                    [compile with mmcmp and pp20 decompression support [[default=no]]])],,
    6.46 ++    [enable_mmcmp=no])
    6.47 ++if test x$enable_mmcmp = xyes; then
    6.48 ++    AC_DEFINE(MMCMP_SUPPORT, 1, [Enable mmcmp and pp20 decompression support.])
    6.49 ++fi
    6.50 ++
    6.51 + # portable types. requires autoconf 2.60
    6.52 + # `configure' will check if these are defined in system headers.
    6.53 + # if not, it will auto-detect and define them in `config.h'
    6.54 +@@ -99,6 +132,6 @@ MODPLUG_LIBRARY_VERSION=1:0:0
    6.55   AC_SUBST(MODPLUG_LIBRARY_VERSION)
    6.56   
    6.57   AC_CONFIG_FILES([Makefile
    6.58 @@ -34,10 +74,256 @@
    6.59  +	  src/Makefile
    6.60   	  libmodplug.pc])
    6.61   AC_OUTPUT
    6.62 +diff -u libmodplug-0.8.9.0/CMakeLists.txt~ libmodplug-0.8.9.0/CMakeLists.txt
    6.63 +--- libmodplug-0.8.9.0/CMakeLists.txt~
    6.64 ++++ libmodplug-0.8.9.0/CMakeLists.txt
    6.65 +@@ -1,19 +1,73 @@
    6.66 + cmake_minimum_required(VERSION 2.8.0)
    6.67 + 
    6.68 + project(libmodplug)
    6.69 ++
    6.70 ++set(VERSION "0.8.9.0")
    6.71 ++
    6.72 ++option(BUILD_SHARED_LIBS "Build Shared Library (DLL)" OFF)
    6.73 ++option(EXPORT_CXX "Export C++ interface from library" OFF)
    6.74 ++option(MIDIFMT_SUPPORT "Enable midi formats support" OFF)
    6.75 ++option(WAV_SUPPORT "Enable wav formats support" OFF)
    6.76 ++option(MMCMP_SUPPORT "Enable mmcmp and pp20 decompression support" OFF)
    6.77 ++
    6.78 + add_definitions(-DMODPLUG_BUILD)
    6.79 ++if(MIDIFMT_SUPPORT)
    6.80 ++  add_definitions(-DMIDIFMT_SUPPORT)
    6.81 ++endif()
    6.82 ++if(WAV_SUPPORT)
    6.83 ++  add_definitions(-DWAV_SUPPORT)
    6.84 ++endif()
    6.85 ++if(MMCMP_SUPPORT)
    6.86 ++  add_definitions(-DMMCMP_SUPPORT)
    6.87 ++endif()
    6.88 ++if(NOT EXPORT_CXX)
    6.89 ++  add_definitions(-DNO_CXX_EXPORTS)
    6.90 ++else()
    6.91 ++  set(HEADERS_CXX
    6.92 ++      src/libmodplug/it_defs.h
    6.93 ++      src/libmodplug/sndfile.h
    6.94 ++      src/libmodplug/stdafx.h)
    6.95 ++endif()
    6.96 + 
    6.97 + include (CheckFunctionExists)
    6.98 + include (CheckIncludeFile)
    6.99 ++include (CheckCCompilerFlag)
   6.100 ++include (CheckCSourceCompiles)
   6.101 ++include (TestBigEndian)
   6.102 ++
   6.103 ++TEST_BIG_ENDIAN(WORDS_BIGENDIAN)
   6.104 ++if(WORDS_BIGENDIAN)
   6.105 ++  add_definitions(-DWORDS_BIGENDIAN=1)
   6.106 ++endif()
   6.107 ++
   6.108 ++if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
   6.109 ++  add_definitions(-Wall)
   6.110 ++  # check symbol visibility attributes
   6.111 ++  set(OLD_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
   6.112 ++  if(NOT WIN32 AND NOT CYGWIN)
   6.113 ++    set(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS} -Werror")
   6.114 ++    check_c_source_compiles("int foo(void) __attribute__((visibility(\"default\")));
   6.115 ++                             int main(void) {return 0;}" HAVE_VISIBILITY_DEFAULT)
   6.116 ++    if(HAVE_VISIBILITY_DEFAULT)
   6.117 ++      check_c_compiler_flag(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN)
   6.118 ++    endif()
   6.119 ++  endif()
   6.120 ++  set(CMAKE_REQUIRED_FLAGS "-Wl,--no-undefined")
   6.121 ++  check_c_compiler_flag("" HAVE_NO_UNDEFINED)
   6.122 ++  set(CMAKE_REQUIRED_FLAGS "${OLD_REQUIRED_FLAGS}")
   6.123 ++endif()
   6.124 + 
   6.125 + include_directories(AFTER
   6.126 +   src
   6.127 +   src/libmodplug
   6.128 +   ${PROJECT_BINARY_DIR}
   6.129 +-  )
   6.130 ++)
   6.131 + 
   6.132 +-if (UNIX)
   6.133 +-  set (CMAKE_REQUIRED_LIBRARIES m)
   6.134 ++if(UNIX AND NOT APPLE)
   6.135 ++  find_library(MATH_LIB m)
   6.136 ++  if(MATH_LIB)
   6.137 ++    set(CMAKE_REQUIRED_LIBRARIES m)
   6.138 ++  endif()
   6.139 + endif()
   6.140 + 
   6.141 + if (WIN32)
   6.142 +@@ -21,58 +75,28 @@ if (WIN32)
   6.143 +   add_definitions(-DNOMINMAX)
   6.144 + endif()
   6.145 + 
   6.146 +-if (WIN32 AND NOT (MINGW OR MSYS))
   6.147 +-  set(MSINTTYPES_PATH "$ENV{MSINTTYPES_PATH}" CACHE PATH "search path for inttypes.h and stdint.h")
   6.148 +-
   6.149 +-  find_path(STDINT_INCLUDE_DIR
   6.150 +-    stdint.h
   6.151 +-    PATHS
   6.152 +-    ${MSINTTYPES_PATH})
   6.153 +-
   6.154 +-  if (STDINT_INCLUDE_DIR)
   6.155 +-    add_definitions(-DHAVE_STDINT_H)
   6.156 +-    include_directories(AFTER "${STDINT_INCLUDE_DIR}")
   6.157 +-  endif()
   6.158 +-
   6.159 +-  find_path(INTTYPES_INCLUDE_DIR
   6.160 +-    inttypes.h
   6.161 +-    PATHS
   6.162 +-    ${MSINTTYPES_PATH})
   6.163 +-
   6.164 +-  if (INTTYPES_INCLUDE_DIR)
   6.165 +-    add_definitions(-DHAVE_INTTYPES_H)
   6.166 +-    include_directories(AFTER "${INTTYPES_INCLUDE_DIR}")
   6.167 +-  endif()
   6.168 +-
   6.169 +-  if (NOT STDINT_INCLUDE_DIR OR NOT INTTYPES_INCLUDE_DIR)
   6.170 +-    message(WARNING
   6.171 +-      "Compilation may fail if inttypes.h is not natively supported by the compiler."
   6.172 +-      "You can get inttypes.h from http://code.google.com/p/msinttypes/")
   6.173 +-  endif()
   6.174 +-else()
   6.175 +-  check_include_file("stdint.h" HAVE_STDINT)
   6.176 +-  if (HAVE_STDINT)
   6.177 +-    add_definitions(-DHAVE_STDINT_H)
   6.178 +-  endif()
   6.179 ++check_include_file("stdint.h" HAVE_STDINT)
   6.180 ++if (HAVE_STDINT)
   6.181 ++  add_definitions(-DHAVE_STDINT_H)
   6.182 + endif()
   6.183 + 
   6.184 +-check_function_exists("setenv" HAVE_SETENV)
   6.185 + check_function_exists("sinf" HAVE_SINF)
   6.186 +-
   6.187 +-# Allow the developer to select if Dynamic or Static libraries are built
   6.188 +-option(BUILD_SHARED_LIBS "Build Shared Library (DLL)" OFF)
   6.189 +-
   6.190 +-# Set the LIB_TYPE variable to STATIC
   6.191 +-set(LIB_TYPE STATIC)
   6.192 ++if(HAVE_SINF)
   6.193 ++  add_definitions(-DHAVE_SINF)
   6.194 ++endif()
   6.195 + 
   6.196 + if (BUILD_SHARED_LIBS)
   6.197 +-  # User wants to build Dynamic Libraries,
   6.198 +-  # so change the LIB_TYPE variable to CMake keyword 'SHARED'
   6.199 +   set (LIB_TYPE SHARED)
   6.200 +-  add_definitions(-DDLL_EXPORT)
   6.201 +-else (BUILD_SHARED_LIBS)
   6.202 ++  if (WIN32 OR CYGWIN)
   6.203 ++    add_definitions(-DDLL_EXPORT)
   6.204 ++  elseif (HAVE_VISIBILITY_HIDDEN)
   6.205 ++    add_definitions(-fvisibility=hidden)
   6.206 ++    add_definitions("-DSYM_VISIBILITY")
   6.207 ++  endif()
   6.208 ++else ()
   6.209 ++  set(LIB_TYPE STATIC)
   6.210 +   add_definitions(-DMODPLUG_STATIC)
   6.211 +-endif (BUILD_SHARED_LIBS)
   6.212 ++endif()
   6.213 + 
   6.214 + add_library(modplug ${LIB_TYPE}
   6.215 +   src/libmodplug/it_defs.h
   6.216 +@@ -89,7 +113,6 @@ add_library(modplug ${LIB_TYPE}
   6.217 +   src/load_dsm.cpp
   6.218 +   src/load_far.cpp
   6.219 +   src/load_it.cpp
   6.220 +-  src/load_j2b.cpp
   6.221 +   src/load_mdl.cpp
   6.222 +   src/load_med.cpp
   6.223 +   src/load_mid.cpp
   6.224 +@@ -116,30 +139,36 @@ add_library(modplug ${LIB_TYPE}
   6.225 +   src/sndfile.cpp
   6.226 +   src/sndmix.cpp
   6.227 +   src/tables.h
   6.228 +-  )
   6.229 ++)
   6.230 ++
   6.231 ++if (BUILD_SHARED_LIBS)
   6.232 ++  if(APPLE)
   6.233 ++    target_link_libraries(modplug -Wl,-undefined,error)
   6.234 ++    target_link_libraries(modplug -Wl,-compatibility_version,2.0.0)
   6.235 ++    target_link_libraries(modplug -Wl,-current_version,2.0.0)
   6.236 ++  else()
   6.237 ++    if(HAVE_NO_UNDEFINED)
   6.238 ++      target_link_libraries(modplug -Wl,--no-undefined)
   6.239 ++    endif()
   6.240 ++    set_target_properties(modplug PROPERTIES
   6.241 ++                                  VERSION 1.0.0 SOVERSION 1)
   6.242 ++  endif()
   6.243 ++  if(MATH_LIB)
   6.244 ++    target_link_libraries(modplug m)
   6.245 ++  endif()
   6.246 ++endif()
   6.247 + 
   6.248 + # install the library:
   6.249 + install(TARGETS modplug DESTINATION lib)
   6.250 + 
   6.251 +-# incstall the headers:
   6.252 ++# install the headers:
   6.253 + install(FILES
   6.254 +-  src/libmodplug/it_defs.h
   6.255 +-  src/libmodplug/sndfile.h
   6.256 +-  src/libmodplug/stdafx.h
   6.257 +   src/modplug.h
   6.258 ++  ${HEADERS_CXX}
   6.259 + 
   6.260 +   DESTINATION
   6.261 +   include/libmodplug
   6.262 +-  )
   6.263 +-
   6.264 +-set(VERSION "0.8.8.5")
   6.265 +-
   6.266 +-if(HAVE_SETENV)
   6.267 +-  add_definitions(-DHAVE_SETENV)
   6.268 +-endif(HAVE_SETENV)
   6.269 +-if(HAVE_SINF)
   6.270 +-  add_definitions(-DHAVE_SINF)
   6.271 +-endif(HAVE_SINF)
   6.272 ++)
   6.273 + 
   6.274 + if (NOT WIN32)
   6.275 +   set(prefix "${CMAKE_INSTALL_PREFIX}")
   6.276  diff -u libmodplug-0.8.9.0/configure~ libmodplug-0.8.9.0/configure
   6.277  --- libmodplug-0.8.9.0/configure~
   6.278  +++ libmodplug-0.8.9.0/configure
   6.279 -@@ -16702,13 +16702,12 @@ fi
   6.280 +@@ -634,6 +634,8 @@ am__EXEEXT_TRUE
   6.281 + LTLIBOBJS
   6.282 + LIBOBJS
   6.283 + MODPLUG_LIBRARY_VERSION
   6.284 ++EXPORT_CXX_FALSE
   6.285 ++EXPORT_CXX_TRUE
   6.286 + LT_LDFLAGS
   6.287 + LT_SYS_LIBRARY_PATH
   6.288 + OTOOL64
   6.289 +@@ -772,6 +774,10 @@ with_aix_soname
   6.290 + with_gnu_ld
   6.291 + with_sysroot
   6.292 + enable_libtool_lock
   6.293 ++enable_cxx_interface
   6.294 ++enable_midi
   6.295 ++enable_wav
   6.296 ++enable_mmcmp
   6.297 + '
   6.298 +       ac_precious_vars='build_alias
   6.299 + host_alias
   6.300 +@@ -1418,6 +1424,11 @@ Optional Features:
   6.301 +   --enable-fast-install[=PKGS]
   6.302 +                           optimize for fast installation [default=yes]
   6.303 +   --disable-libtool-lock  avoid locking (might break parallel builds)
   6.304 ++  --enable-cxx-interface  export C++ interface from library [[default=yes]]
   6.305 ++  --enable-midi           compile with midi formats support [[default=no]]
   6.306 ++  --enable-wav            compile with wav formats support [[default=no]]
   6.307 ++  --enable-mmcmp          compile with mmcmp and pp20 decompression support
   6.308 ++                          [[default=no]]
   6.309 + 
   6.310 + Optional Packages:
   6.311 +   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
   6.312 +@@ -16702,13 +16713,12 @@ fi
   6.313   
   6.314   done
   6.315   
   6.316 @@ -55,6 +341,108 @@
   6.317   _ACEOF
   6.318   
   6.319   fi
   6.320 +@@ -16786,6 +16796,66 @@ case ${target_os} in
   6.321 + 		;;
   6.322 + esac
   6.323 + 
   6.324 ++# Check whether --enable-cxx_interface was given.
   6.325 ++if test "${enable_cxx_interface+set}" = set; then :
   6.326 ++  enableval=$enable_cxx_interface;
   6.327 ++else
   6.328 ++  enable_cxx_interface=yes
   6.329 ++fi
   6.330 ++
   6.331 ++if test x$enable_cxx_interface != xyes; then
   6.332 ++
   6.333 ++$as_echo "#define NO_CXX_EXPORTS 1" >>confdefs.h
   6.334 ++
   6.335 ++fi
   6.336 ++ if test x$enable_cxx_interface = xyes; then
   6.337 ++  EXPORT_CXX_TRUE=
   6.338 ++  EXPORT_CXX_FALSE='#'
   6.339 ++else
   6.340 ++  EXPORT_CXX_TRUE='#'
   6.341 ++  EXPORT_CXX_FALSE=
   6.342 ++fi
   6.343 ++
   6.344 ++
   6.345 ++# Check whether --enable-midi was given.
   6.346 ++if test "${enable_midi+set}" = set; then :
   6.347 ++  enableval=$enable_midi;
   6.348 ++else
   6.349 ++  enable_midi=no
   6.350 ++fi
   6.351 ++
   6.352 ++if test x$enable_midi = xyes; then
   6.353 ++
   6.354 ++$as_echo "#define MIDIFMT_SUPPORT 1" >>confdefs.h
   6.355 ++
   6.356 ++fi
   6.357 ++
   6.358 ++# Check whether --enable-wav was given.
   6.359 ++if test "${enable_wav+set}" = set; then :
   6.360 ++  enableval=$enable_wav;
   6.361 ++else
   6.362 ++  enable_wav=no
   6.363 ++fi
   6.364 ++
   6.365 ++if test x$enable_wav = xyes; then
   6.366 ++
   6.367 ++$as_echo "#define WAV_SUPPORT 1" >>confdefs.h
   6.368 ++
   6.369 ++fi
   6.370 ++
   6.371 ++# Check whether --enable-mmcmp was given.
   6.372 ++if test "${enable_mmcmp+set}" = set; then :
   6.373 ++  enableval=$enable_mmcmp;
   6.374 ++else
   6.375 ++  enable_mmcmp=no
   6.376 ++fi
   6.377 ++
   6.378 ++if test x$enable_mmcmp = xyes; then
   6.379 ++
   6.380 ++$as_echo "#define MMCMP_SUPPORT 1" >>confdefs.h
   6.381 ++
   6.382 ++fi
   6.383 ++
   6.384 + # portable types. requires autoconf 2.60
   6.385 + # `configure' will check if these are defined in system headers.
   6.386 + # if not, it will auto-detect and define them in `config.h'
   6.387 +@@ -17036,6 +17106,10 @@ if test -z "${am__fastdepCXX_TRUE}" && t
   6.388 + Usually this means the macro was only invoked conditionally." "$LINENO" 5
   6.389 + fi
   6.390 + 
   6.391 ++if test -z "${EXPORT_CXX_TRUE}" && test -z "${EXPORT_CXX_FALSE}"; then
   6.392 ++  as_fn_error $? "conditional \"EXPORT_CXX\" was never defined.
   6.393 ++Usually this means the macro was only invoked conditionally." "$LINENO" 5
   6.394 ++fi
   6.395 + 
   6.396 + : "${CONFIG_STATUS=./config.status}"
   6.397 + ac_write_fail=0
   6.398 +diff -u libmodplug-0.8.9.0/Makefile.am~ libmodplug-0.8.9.0b/Makefile.am
   6.399 +--- libmodplug-0.8.9.0/Makefile.am
   6.400 ++++ libmodplug-0.8.9.0/Makefile.am
   6.401 +@@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I m4
   6.402 + 
   6.403 + SUBDIRS = src
   6.404 + 
   6.405 +-EXTRA_DIST =	 \
   6.406 ++EXTRA_DIST = CMakeLists.txt \
   6.407 + 	AUTHORS COPYING ChangeLog \
   6.408 + 	INSTALL README TODO
   6.409 + 
   6.410 +diff -u libmodplug-0.8.9.0/Makefile.in~ libmodplug-0.8.9.0b/Makefile.in
   6.411 +--- libmodplug-0.8.9.0/Makefile.in
   6.412 ++++ libmodplug-0.8.9.0/Makefile.in
   6.413 +@@ -359,7 +359,7 @@ top_builddir = @top_builddir@
   6.414 + top_srcdir = @top_srcdir@
   6.415 + ACLOCAL_AMFLAGS = -I m4
   6.416 + SUBDIRS = src
   6.417 +-EXTRA_DIST = \
   6.418 ++EXTRA_DIST = CMakeLists.txt \
   6.419 + 	AUTHORS COPYING ChangeLog \
   6.420 + 	INSTALL README TODO
   6.421 + 
   6.422  diff -u libmodplug-0.8.9.0/src/config.h.in~ libmodplug-0.8.9.0/src/config.h.in
   6.423  --- libmodplug-0.8.9.0/src/config.h.in~
   6.424  +++ libmodplug-0.8.9.0/src/config.h.in
   6.425 @@ -68,6 +456,32 @@
   6.426   /* Define to 1 if you have the `sinf' function. */
   6.427   #undef HAVE_SINF
   6.428   
   6.429 +@@ -45,6 +42,15 @@
   6.430 + /* Define to the sub-directory where libtool stores uninstalled libraries. */
   6.431 + #undef LT_OBJDIR
   6.432 + 
   6.433 ++/* Enable midi formats support. */
   6.434 ++#undef MIDIFMT_SUPPORT
   6.435 ++
   6.436 ++/* Enable mmcmp and pp20 decompression support. */
   6.437 ++#undef MMCMP_SUPPORT
   6.438 ++
   6.439 ++/* Do not export the C++ interface. */
   6.440 ++#undef NO_CXX_EXPORTS
   6.441 ++
   6.442 + /* Name of package */
   6.443 + #undef PACKAGE
   6.444 + 
   6.445 +@@ -72,6 +78,9 @@
   6.446 + /* Version number of package */
   6.447 + #undef VERSION
   6.448 + 
   6.449 ++/* Enable wav formats support. */
   6.450 ++#undef WAV_SUPPORT
   6.451 ++
   6.452 + /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
   6.453 +    significant byte first (like Motorola and SPARC, unlike Intel). */
   6.454 + #if defined AC_APPLE_UNIVERSAL_BUILD
   6.455  diff -u libmodplug-0.8.9.0/src/fastmix.cpp~ libmodplug-0.8.9.0/src/fastmix.cpp
   6.456  --- libmodplug-0.8.9.0/src/fastmix.cpp~
   6.457  +++ libmodplug-0.8.9.0/src/fastmix.cpp
   6.458 @@ -290,11 +704,12 @@
   6.459   // Channel Struct
   6.460   typedef struct _MODCHANNEL
   6.461   {
   6.462 -@@ -427,11 +417,9 @@ typedef struct _MODCHANNEL
   6.463 +@@ -427,11 +417,10 @@ typedef struct _MODCHANNEL
   6.464   	BYTE nRowNote, nRowInstr;
   6.465   	BYTE nRowVolCmd, nRowVolume;
   6.466   	BYTE nRowCommand, nRowParam;
   6.467  -	BYTE nLeftVU, nRightVU;
   6.468 ++	BYTE nLeftVU, nRightVU; /* NOT USED! */
   6.469   	BYTE nActiveMacro, nPadding;
   6.470   } MODCHANNEL;
   6.471   
   6.472 @@ -302,7 +717,7 @@
   6.473   typedef struct _MODCHANNELSETTINGS
   6.474   {
   6.475   	UINT nPan;
   6.476 -@@ -441,7 +429,6 @@ typedef struct _MODCHANNELSETTINGS
   6.477 +@@ -441,7 +430,6 @@ typedef struct _MODCHANNELSETTINGS
   6.478           char szName[MAX_CHANNELNAME];        // changed from CHAR
   6.479   } MODCHANNELSETTINGS;
   6.480   
   6.481 @@ -310,7 +725,7 @@
   6.482   typedef struct _MODCOMMAND
   6.483   {
   6.484   	BYTE note;
   6.485 -@@ -456,7 +443,7 @@ typedef struct _MODCOMMAND
   6.486 +@@ -456,7 +444,7 @@ typedef struct _MODCOMMAND
   6.487   // Mix Plugins
   6.488   #define MIXPLUG_MIXREADY			0x01	// Set when cleared
   6.489   
   6.490 @@ -319,7 +734,7 @@
   6.491   {
   6.492   public:
   6.493   	virtual ~IMixPlugin() {};
   6.494 -@@ -520,7 +507,6 @@ enum {
   6.495 +@@ -520,7 +508,6 @@ enum {
   6.496   	MIDIOUT_PROGRAM,
   6.497   };
   6.498   
   6.499 @@ -327,7 +742,7 @@
   6.500   typedef struct MODMIDICFG
   6.501   {
   6.502           char szMidiGlb[9*32];      // changed from CHAR
   6.503 -@@ -533,9 +519,8 @@ typedef struct MODMIDICFG
   6.504 +@@ -533,9 +520,8 @@ typedef struct MODMIDICFG
   6.505   typedef VOID (* LPSNDMIXHOOKPROC)(int *, unsigned long, unsigned long); // buffer, samples, channels
   6.506   
   6.507   
   6.508 @@ -338,30 +753,17 @@
   6.509   //==============
   6.510   {
   6.511   public:	// Static Members
   6.512 -@@ -638,7 +623,9 @@ public:
   6.513 - 	BOOL ReadIT(LPCBYTE lpStream, DWORD dwMemLength);
   6.514 - 	BOOL Read669(LPCBYTE lpStream, DWORD dwMemLength);
   6.515 - 	BOOL ReadUlt(LPCBYTE lpStream, DWORD dwMemLength);
   6.516 -+#ifdef WAV_SUPPORT
   6.517 - 	BOOL ReadWav(LPCBYTE lpStream, DWORD dwMemLength);
   6.518 -+#endif
   6.519 - 	BOOL ReadDSM(LPCBYTE lpStream, DWORD dwMemLength);
   6.520 - 	BOOL ReadFAR(LPCBYTE lpStream, DWORD dwMemLength);
   6.521 - 	BOOL ReadAMS(LPCBYTE lpStream, DWORD dwMemLength);
   6.522 -@@ -651,29 +638,19 @@ public:
   6.523 +@@ -651,7 +637,6 @@ public:
   6.524   	BOOL ReadAMF(LPCBYTE lpStream, DWORD dwMemLength);
   6.525   	BOOL ReadMT2(LPCBYTE lpStream, DWORD dwMemLength);
   6.526   	BOOL ReadPSM(LPCBYTE lpStream, DWORD dwMemLength);
   6.527  -	BOOL ReadJ2B(LPCBYTE lpStream, DWORD dwMemLength);
   6.528   	BOOL ReadUMX(LPCBYTE lpStream, DWORD dwMemLength);
   6.529 -+#ifdef MIDIFMT_SUPPORT
   6.530   	BOOL ReadABC(LPCBYTE lpStream, DWORD dwMemLength);
   6.531   	BOOL TestABC(LPCBYTE lpStream, DWORD dwMemLength);
   6.532 - 	BOOL ReadMID(LPCBYTE lpStream, DWORD dwMemLength);
   6.533 - 	BOOL TestMID(LPCBYTE lpStream, DWORD dwMemLength);
   6.534 +@@ -660,20 +645,9 @@ public:
   6.535   	BOOL ReadPAT(LPCBYTE lpStream, DWORD dwMemLength);
   6.536   	BOOL TestPAT(LPCBYTE lpStream, DWORD dwMemLength);
   6.537 -+#endif
   6.538   	// Save Functions
   6.539  -#ifndef MODPLUG_NO_FILESAVE
   6.540  -	UINT WriteSample(FILE *f, MODINSTRUMENT *pins, UINT nFlags, UINT nMaxLen=0);
   6.541 @@ -380,7 +782,7 @@
   6.542   
   6.543   public:
   6.544   	// Real-time sound functions
   6.545 -@@ -759,8 +736,7 @@ public:
   6.546 +@@ -759,8 +733,7 @@ public:
   6.547   	BOOL IsValidBackwardJump(UINT nStartOrder, UINT nStartRow, UINT nJumpOrder, UINT nJumpRow) const;
   6.548   	// Read/Write sample functions
   6.549   	signed char GetDeltaValue(signed char prev, UINT n) const { return (signed char)(prev + CompressionTable[n & 0x0F]); }
   6.550 @@ -390,7 +792,7 @@
   6.551   	UINT ReadSample(MODINSTRUMENT *pIns, UINT nFlags, LPCSTR pMemFile, DWORD dwMemLength);
   6.552   	BOOL DestroySample(UINT nSample);
   6.553   	BOOL DestroyInstrument(UINT nInstr);
   6.554 -@@ -803,11 +779,6 @@ public:
   6.555 +@@ -803,11 +776,6 @@ public:
   6.556   	static UINT Normalize24BitBuffer(LPBYTE pbuffer, UINT cbsizebytes, DWORD lmax24, DWORD dwByteInc);
   6.557   };
   6.558   
   6.559 @@ -402,7 +804,7 @@
   6.560   //////////////////////////////////////////////////////////
   6.561   // WAVE format information
   6.562   
   6.563 -@@ -848,7 +819,6 @@ typedef struct WAVEFILEHEADER
   6.564 +@@ -848,7 +816,6 @@ typedef struct WAVEFILEHEADER
   6.565   	DWORD id_WAVE;
   6.566   } WAVEFILEHEADER;
   6.567   
   6.568 @@ -410,7 +812,7 @@
   6.569   typedef struct WAVEFORMATHEADER
   6.570   {
   6.571   	DWORD id_fmt;		// "fmt "
   6.572 -@@ -861,14 +831,12 @@ typedef struct WAVEFORMATHEADER
   6.573 +@@ -861,14 +828,12 @@ typedef struct WAVEFORMATHEADER
   6.574   	WORD bitspersample;	// bits per sample (8/16)
   6.575   } WAVEFORMATHEADER;
   6.576   
   6.577 @@ -425,7 +827,7 @@
   6.578   typedef struct WAVESMPLHEADER
   6.579   {
   6.580   	// SMPL
   6.581 -@@ -885,7 +853,6 @@ typedef struct WAVESMPLHEADER
   6.582 +@@ -885,7 +850,6 @@ typedef struct WAVESMPLHEADER
   6.583   	DWORD cbSamplerData;
   6.584   } WAVESMPLHEADER;
   6.585   
   6.586 @@ -433,7 +835,7 @@
   6.587   typedef struct SAMPLELOOPSTRUCT
   6.588   {
   6.589   	DWORD dwIdentifier;
   6.590 -@@ -896,14 +863,12 @@ typedef struct SAMPLELOOPSTRUCT
   6.591 +@@ -896,14 +860,12 @@ typedef struct SAMPLELOOPSTRUCT
   6.592   	DWORD dwPlayCount;		// Loop Count, 0=infinite
   6.593   } SAMPLELOOPSTRUCT;
   6.594   
   6.595 @@ -448,7 +850,7 @@
   6.596   typedef struct WAVELISTHEADER
   6.597   {
   6.598   	DWORD list_id;	// "LIST" -> 0x5453494C
   6.599 -@@ -911,7 +876,6 @@ typedef struct WAVELISTHEADER
   6.600 +@@ -911,7 +873,6 @@ typedef struct WAVELISTHEADER
   6.601   	DWORD info;		// "INFO"
   6.602   } WAVELISTHEADER;
   6.603   
   6.604 @@ -456,7 +858,7 @@
   6.605   typedef struct WAVEEXTRAHEADER
   6.606   {
   6.607   	DWORD xtra_id;	// "xtra"	-> 0x61727478
   6.608 -@@ -943,7 +907,7 @@ typedef struct WAVEEXTRAHEADER
   6.609 +@@ -943,7 +904,7 @@ typedef struct WAVEEXTRAHEADER
   6.610   #define AGC_UNITY			(1 << AGC_PRECISION)
   6.611   
   6.612   // Calling conventions
   6.613 @@ -465,7 +867,7 @@
   6.614   #define MPPASMCALL	__cdecl
   6.615   #define MPPFASTCALL	__fastcall
   6.616   #else
   6.617 -@@ -958,6 +922,9 @@ int _muldiv(long a, long b, long c);
   6.618 +@@ -958,6 +919,9 @@ int _muldiv(long a, long b, long c);
   6.619   int _muldivr(long a, long b, long c);
   6.620   
   6.621   
   6.622 @@ -478,15 +880,8 @@
   6.623  diff -u libmodplug-0.8.9.0/src/libmodplug/stdafx.h~ libmodplug-0.8.9.0/src/libmodplug/stdafx.h
   6.624  --- libmodplug-0.8.9.0/src/libmodplug/stdafx.h~
   6.625  +++ libmodplug-0.8.9.0/src/libmodplug/stdafx.h
   6.626 -@@ -21,13 +21,18 @@
   6.627 - # include <stdint.h>
   6.628 - #endif
   6.629 +@@ -23,11 +23,11 @@
   6.630   
   6.631 -+/*#define CXX_INTERFACE*/ /* export C++ interface from dll. */
   6.632 -+/*#define MIDIFMT_SUPPORT*/
   6.633 -+/*#define WAV_SUPPORT*/
   6.634 -+/*#define MMCMP_SUPPORT*/
   6.635 -+
   6.636   /* disable AGC and FILESAVE for all targets for uniformity. */
   6.637   #define NO_AGC
   6.638  -#define MODPLUG_NO_FILESAVE
   6.639 @@ -499,7 +894,7 @@
   6.640   #pragma warning (disable:4201)
   6.641   #pragma warning (disable:4514)
   6.642   #endif
   6.643 -@@ -38,7 +43,16 @@
   6.644 +@@ -38,7 +38,16 @@
   6.645   #include <mmsystem.h>
   6.646   #include <stdio.h>
   6.647   #include <malloc.h>
   6.648 @@ -516,7 +911,7 @@
   6.649   
   6.650   #define srandom(_seed)  srand(_seed)
   6.651   #define random()        rand()
   6.652 -@@ -51,7 +65,9 @@ inline void ProcessPlugins(int n) {}
   6.653 +@@ -51,7 +60,9 @@ inline void ProcessPlugins(int n) {}
   6.654   #define strcasecmp(a,b)     _stricmp(a,b)
   6.655   #define strncasecmp(a,b,c)  _strnicmp(a,b,c)
   6.656   
   6.657 @@ -526,7 +921,7 @@
   6.658   
   6.659   #ifndef isblank
   6.660   #define isblank(c) ((c) == ' ' || (c) == '\t')
   6.661 -@@ -66,6 +82,11 @@ inline void ProcessPlugins(int n) {}
   6.662 +@@ -66,6 +77,11 @@ inline void ProcessPlugins(int n) {}
   6.663   #include <malloc.h>
   6.664   #endif
   6.665   
   6.666 @@ -538,7 +933,7 @@
   6.667   typedef int8_t CHAR;
   6.668   typedef uint8_t UCHAR;
   6.669   typedef uint8_t* PUCHAR;
   6.670 -@@ -88,12 +109,6 @@ typedef const char* LPCSTR;
   6.671 +@@ -88,12 +104,6 @@ typedef const char* LPCSTR;
   6.672   typedef void* PVOID;
   6.673   typedef void VOID;
   6.674   
   6.675 @@ -551,7 +946,7 @@
   6.676   #define LPCTSTR LPCSTR
   6.677   #define lstrcpyn strncpy
   6.678   #define lstrcpy strcpy
   6.679 -@@ -132,10 +147,22 @@ inline void ProcessPlugins(int n) {}
   6.680 +@@ -132,10 +142,22 @@ inline void ProcessPlugins(int n) {}
   6.681   # else
   6.682   #   define MODPLUG_EXPORT __declspec(dllimport)			/* using libmodplug dll for windows */
   6.683   # endif
   6.684 @@ -567,7 +962,7 @@
   6.685   #define MODPLUG_EXPORT
   6.686   #endif
   6.687   
   6.688 -+#if defined(CXX_INTERFACE)
   6.689 ++#if !defined(NO_CXX_EXPORTS)
   6.690  +#define MODPLUG_EXPORTPP	MODPLUG_EXPORT
   6.691  +#else
   6.692  +#define MODPLUG_EXPORTPP
   6.693 @@ -619,11 +1014,19 @@
   6.694  diff -u libmodplug-0.8.9.0/src/load_abc.cpp~ libmodplug-0.8.9.0/src/load_abc.cpp
   6.695  --- libmodplug-0.8.9.0/src/load_abc.cpp~
   6.696  +++ libmodplug-0.8.9.0/src/load_abc.cpp
   6.697 -@@ -37,9 +37,11 @@
   6.698 +@@ -37,9 +37,19 @@
   6.699   #include "stdafx.h"
   6.700   #include "sndfile.h"
   6.701   
   6.702 -+#ifdef MIDIFMT_SUPPORT
   6.703 ++#ifndef MIDIFMT_SUPPORT
   6.704 ++BOOL CSoundFile::TestABC(const BYTE *lpStream, DWORD dwMemLength) {
   6.705 ++	return FALSE;
   6.706 ++}
   6.707 ++BOOL CSoundFile::ReadABC(const BYTE *lpStream, DWORD dwMemLength) {
   6.708 ++	return FALSE;
   6.709 ++}
   6.710 ++
   6.711 ++#else
   6.712  +
   6.713   #include "load_pat.h"
   6.714   
   6.715 @@ -632,7 +1035,7 @@
   6.716   #define putenv _putenv
   6.717   #define strdup _strdup
   6.718   #endif
   6.719 -@@ -256,16 +258,6 @@ static void abc_add_setjumploop(ABCHANDL
   6.720 +@@ -256,16 +266,6 @@ static void abc_add_setjumploop(ABCHANDL
   6.721   static uint32_t abc_pattracktime(ABCHANDLE *h, uint32_t tracktime);
   6.722   static int abc_patno(ABCHANDLE *h, uint32_t tracktime);
   6.723   
   6.724 @@ -649,7 +1052,7 @@
   6.725   
   6.726   static int abc_isvalidchar(char c) {
   6.727   	return(isalpha(c) || isdigit(c) || isspace(c) || c == '%' || c == ':');
   6.728 -@@ -403,7 +395,7 @@ static void abc_dumptracks(ABCHANDLE *h,
   6.729 +@@ -403,7 +403,7 @@ static void abc_dumptracks(ABCHANDLE *h,
   6.730   	}
   6.731   }
   6.732   
   6.733 @@ -658,7 +1061,7 @@
   6.734   #undef _mm_free
   6.735   #endif
   6.736   
   6.737 -@@ -1484,7 +1476,7 @@ static void	abc_add_chord(const char *p,
   6.738 +@@ -1484,7 +1484,7 @@ static void	abc_add_chord(const char *p,
   6.739   			d[chordnote] = i;
   6.740   			break;
   6.741   		}
   6.742 @@ -667,7 +1070,7 @@
   6.743   	switch(*p) {
   6.744   		case 'b':
   6.745   			d[chordnote]--;
   6.746 -@@ -1506,7 +1498,7 @@ static void	abc_add_chord(const char *p,
   6.747 +@@ -1506,7 +1506,7 @@ static void	abc_add_chord(const char *p,
   6.748   				d[chordbase] = i;
   6.749   				break;
   6.750   			}
   6.751 @@ -676,7 +1079,7 @@
   6.752   		switch(*p) {
   6.753   			case 'b':
   6.754   				d[chordbase]--;
   6.755 -@@ -2345,9 +2337,9 @@ BOOL CSoundFile::TestABC(const BYTE *lpS
   6.756 +@@ -2345,9 +2345,9 @@ BOOL CSoundFile::TestABC(const BYTE *lpS
   6.757   // =====================================================================================
   6.758   static ABCHANDLE *ABC_Init(void)
   6.759   {
   6.760 @@ -687,7 +1090,7 @@
   6.761   	retval = (ABCHANDLE *)calloc(1,sizeof(ABCHANDLE));
   6.762   	if( !retval ) return NULL;
   6.763   	retval->track       = NULL;
   6.764 -@@ -2365,16 +2357,16 @@ static ABCHANDLE *ABC_Init(void)
   6.765 +@@ -2365,16 +2365,16 @@ static ABCHANDLE *ABC_Init(void)
   6.766   			retval->pickrandom = atoi(p);
   6.767   		if( *p == '-' ) {
   6.768   			retval->pickrandom = atoi(p+1)-1; // xmms preloads the file
   6.769 @@ -708,7 +1111,7 @@
   6.770   	}
   6.771   	return retval;
   6.772   }
   6.773 -@@ -2643,10 +2635,11 @@ static int ABC_ReadPatterns(MODCOMMAND *
   6.774 +@@ -2643,10 +2643,11 @@ static int ABC_ReadPatterns(MODCOMMAND *
   6.775   static int ABC_Key(const char *p)
   6.776   {
   6.777   	int i,j;
   6.778 @@ -721,7 +1124,7 @@
   6.779   	for( i=0; i<8 && *p && *p != ']'; p++ ) {
   6.780   		if( isspace(*p) ) {
   6.781   			while( isspace(*p) ) p++;
   6.782 -@@ -2939,9 +2932,10 @@ static void abc_MIDI_voice(const char *p
   6.783 +@@ -2939,9 +2940,10 @@ static void abc_MIDI_voice(const char *p
   6.784   static void abc_MIDI_chordname(const char *p)
   6.785   {
   6.786   	char name[20];
   6.787 @@ -734,7 +1137,7 @@
   6.788   	i = 0;
   6.789   	while ((i < 19) && (*p != ' ') && (*p != '\0')) {
   6.790   		name[i] = *p;
   6.791 -@@ -2953,9 +2947,12 @@ static void abc_MIDI_chordname(const cha
   6.792 +@@ -2953,9 +2955,12 @@ static void abc_MIDI_chordname(const cha
   6.793   		abc_message("Failure: Bad format for chordname command, %s", p);
   6.794   	}
   6.795   	else {
   6.796 @@ -748,7 +1151,7 @@
   6.797   			p += abc_getnumber(p, &notes[i]);
   6.798   			i = i + 1;
   6.799   		}
   6.800 -@@ -4878,3 +4875,4 @@ BOOL CSoundFile::ReadABC(const uint8_t *
   6.801 +@@ -4878,3 +4883,4 @@ BOOL CSoundFile::ReadABC(const uint8_t *
   6.802   	ABC_Cleanup(h);	// we dont need it anymore
   6.803   	return 1;
   6.804   }
   6.805 @@ -1534,17 +1937,25 @@
   6.806  diff -u libmodplug-0.8.9.0/src/load_mid.cpp~ libmodplug-0.8.9.0/src/load_mid.cpp
   6.807  --- libmodplug-0.8.9.0/src/load_mid.cpp~
   6.808  +++ libmodplug-0.8.9.0/src/load_mid.cpp
   6.809 -@@ -35,6 +35,9 @@
   6.810 +@@ -35,6 +35,17 @@
   6.811   
   6.812   #include "stdafx.h"
   6.813   #include "sndfile.h"
   6.814  +
   6.815 -+#ifdef MIDIFMT_SUPPORT
   6.816 ++#ifndef MIDIFMT_SUPPORT
   6.817 ++BOOL CSoundFile::TestMID(const BYTE *lpStream, DWORD dwMemLength) {
   6.818 ++	return FALSE;
   6.819 ++}
   6.820 ++BOOL CSoundFile::ReadMID(const BYTE *lpStream, DWORD dwMemLength) {
   6.821 ++	return FALSE;
   6.822 ++}
   6.823 ++
   6.824 ++#else
   6.825  +
   6.826   #define PAN_LEFT    0x30
   6.827   #define PAN_RIGHT   0xD0
   6.828   #define MAX_POLYPHONY 16  // max notes in one midi channel
   6.829 -@@ -88,11 +91,11 @@ typedef struct _MIDTRACK
   6.830 +@@ -88,11 +99,11 @@ typedef struct _MIDTRACK
   6.831   	BYTE instr;	// current instrument for this track
   6.832   } MIDTRACK;
   6.833   
   6.834 @@ -1558,7 +1969,7 @@
   6.835   #define _mm_fseek(f,pos,whence)			fseek(f,pos,whence)
   6.836   #define _mm_read_UBYTES(buf,sz,f)		fread(buf,sz,1,f)
   6.837   #define _mm_read_SBYTES(buf,sz,f)		fread(buf,sz,1,f)
   6.838 -@@ -256,18 +259,18 @@ static void mid_adjust_for_optimal_tempo
   6.839 +@@ -256,18 +267,18 @@ static void mid_adjust_for_optimal_tempo
   6.840   static MIDEVENT *mid_new_event(MIDHANDLE *h)
   6.841   // =====================================================================================
   6.842   {
   6.843 @@ -1588,7 +1999,7 @@
   6.844   }
   6.845   
   6.846   // =====================================================================================
   6.847 -@@ -1582,3 +1585,4 @@ BOOL CSoundFile::ReadMID(const BYTE *lpS
   6.848 +@@ -1582,3 +1593,4 @@ BOOL CSoundFile::ReadMID(const BYTE *lpS
   6.849   	avoid_reentry = 0; // it is safe now, I'm finished
   6.850   	return TRUE;
   6.851   }
   6.852 @@ -1880,7 +2291,7 @@
   6.853  diff -u libmodplug-0.8.9.0/src/load_pat.cpp~ libmodplug-0.8.9.0/src/load_pat.cpp
   6.854  --- libmodplug-0.8.9.0/src/load_pat.cpp~
   6.855  +++ libmodplug-0.8.9.0/src/load_pat.cpp
   6.856 -@@ -33,36 +33,39 @@
   6.857 +@@ -33,36 +33,47 @@
   6.858   #include <string.h>
   6.859   #include <math.h>
   6.860   #include <ctype.h>
   6.861 @@ -1898,7 +2309,15 @@
   6.862   
   6.863  -#include "stdafx.h"
   6.864  -#include "sndfile.h"
   6.865 -+#ifdef MIDIFMT_SUPPORT
   6.866 ++#ifndef MIDIFMT_SUPPORT
   6.867 ++BOOL CSoundFile::TestPAT(const BYTE *lpStream, DWORD dwMemLength) {
   6.868 ++	return FALSE;
   6.869 ++}
   6.870 ++BOOL CSoundFile::ReadPAT(const BYTE *lpStream, DWORD dwMemLength) {
   6.871 ++	return FALSE;
   6.872 ++}
   6.873 ++
   6.874 ++#else
   6.875   
   6.876   #include "load_pat.h"
   6.877   
   6.878 @@ -1928,7 +2347,7 @@
   6.879   
   6.880   #pragma pack(1)
   6.881   
   6.882 -@@ -272,7 +275,7 @@ typedef float (*PAT_SAMPLE_FUN)(int);
   6.883 +@@ -272,7 +283,7 @@ typedef float (*PAT_SAMPLE_FUN)(int);
   6.884   
   6.885   static PAT_SAMPLE_FUN pat_fun[] = { pat_sinus, pat_square, pat_sawtooth };
   6.886   
   6.887 @@ -1937,7 +2356,7 @@
   6.888   #undef _mm_free
   6.889   #endif
   6.890   
   6.891 -@@ -764,10 +767,7 @@ BOOL CSoundFile::TestPAT(const BYTE *lpS
   6.892 +@@ -764,10 +775,7 @@ BOOL CSoundFile::TestPAT(const BYTE *lpS
   6.893   // =====================================================================================
   6.894   static PATHANDLE *PAT_Init(void)
   6.895   {
   6.896 @@ -1949,7 +2368,7 @@
   6.897   }
   6.898   
   6.899   // =====================================================================================
   6.900 -@@ -1259,3 +1259,4 @@ BOOL CSoundFile::ReadPAT(const BYTE *lpS
   6.901 +@@ -1259,3 +1267,4 @@ BOOL CSoundFile::ReadPAT(const BYTE *lpS
   6.902   	PAT_Cleanup(h);	// we dont need it anymore
   6.903   	return 1;
   6.904   }
   6.905 @@ -2895,16 +3314,25 @@
   6.906  diff -u libmodplug-0.8.9.0/src/load_wav.cpp~ libmodplug-0.8.9.0/src/load_wav.cpp
   6.907  --- libmodplug-0.8.9.0/src/load_wav.cpp~
   6.908  +++ libmodplug-0.8.9.0/src/load_wav.cpp
   6.909 -@@ -7,6 +7,8 @@
   6.910 +@@ -7,6 +7,12 @@
   6.911   #include "stdafx.h"
   6.912   #include "sndfile.h"
   6.913   
   6.914 -+#ifdef WAV_SUPPORT
   6.915 ++#ifndef WAV_SUPPORT
   6.916 ++BOOL CSoundFile::ReadWav(const BYTE *lpStream,DWORD dwMemLength) {
   6.917 ++	return FALSE;
   6.918 ++}
   6.919 ++#else
   6.920  +
   6.921   #ifndef WAVE_FORMAT_EXTENSIBLE
   6.922   #define WAVE_FORMAT_EXTENSIBLE	0xFFFE
   6.923   #endif
   6.924 -@@ -144,14 +146,12 @@ BOOL CSoundFile::ReadWav(const BYTE *lpS
   6.925 +@@ -139,19 +145,16 @@ BOOL CSoundFile::ReadWav(const BYTE *lpS
   6.926 + 	return TRUE;
   6.927 + }
   6.928 + 
   6.929 +-
   6.930 + ////////////////////////////////////////////////////////////////////////
   6.931   // IMA ADPCM Support
   6.932   
   6.933   #pragma pack(1)
   6.934 @@ -2919,7 +3347,7 @@
   6.935   #pragma pack()
   6.936   
   6.937   static const int gIMAUnpackTable[90] =
   6.938 -@@ -170,7 +170,6 @@ static const int gIMAUnpackTable[90] =
   6.939 +@@ -170,7 +173,6 @@ static const int gIMAUnpackTable[90] =
   6.940     32767, 0
   6.941   };
   6.942   
   6.943 @@ -2927,7 +3355,7 @@
   6.944   BOOL IMAADPCMUnpack16(signed short *pdest, UINT nLen, LPBYTE psrc, DWORD dwBytes, UINT pkBlkAlign)
   6.945   //------------------------------------------------------------------------------------------------
   6.946   {
   6.947 -@@ -215,3 +214,4 @@ BOOL IMAADPCMUnpack16(signed short *pdes
   6.948 +@@ -215,3 +217,4 @@ BOOL IMAADPCMUnpack16(signed short *pdes
   6.949   	}
   6.950   	return TRUE;
   6.951   }
   6.952 @@ -3295,10 +3723,33 @@
   6.953                           load_mt2.cpp       \
   6.954                           load_psm.cpp       \
   6.955                           load_abc.cpp       \
   6.956 +@@ -45,6 +44,8 @@ libmodplug_la_SOURCES = tables.h        
   6.957 + 
   6.958 + libmodplugincludedir = $(includedir)/libmodplug
   6.959 + 
   6.960 +-
   6.961 +-libmodpluginclude_HEADERS = libmodplug/stdafx.h libmodplug/sndfile.h libmodplug/it_defs.h modplug.h
   6.962 ++if EXPORT_CXX
   6.963 ++HEADERS_CXX = libmodplug/stdafx.h libmodplug/sndfile.h libmodplug/it_defs.h
   6.964 ++endif
   6.965 ++libmodpluginclude_HEADERS = modplug.h $(HEADERS_CXX)
   6.966 + noinst_HEADERS = load_pat.h
   6.967  diff -u libmodplug-0.8.9.0/src/Makefile.in~ libmodplug-0.8.9.0/src/Makefile.in
   6.968  --- libmodplug-0.8.9.0/src/Makefile.in~
   6.969  +++ libmodplug-0.8.9.0/src/Makefile.in
   6.970 -@@ -139,8 +139,8 @@ am_libmodplug_la_OBJECTS = sndmix.lo snd
   6.971 +@@ -97,8 +97,9 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/l
   6.972 + 	$(top_srcdir)/configure.ac
   6.973 + am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
   6.974 + 	$(ACLOCAL_M4)
   6.975 +-DIST_COMMON = $(srcdir)/Makefile.am $(libmodpluginclude_HEADERS) \
   6.976 +-	$(noinst_HEADERS) $(am__DIST_COMMON)
   6.977 ++DIST_COMMON = $(srcdir)/Makefile.am \
   6.978 ++	$(am__libmodpluginclude_HEADERS_DIST) $(noinst_HEADERS) \
   6.979 ++	$(am__DIST_COMMON)
   6.980 + mkinstalldirs = $(install_sh) -d
   6.981 + CONFIG_HEADER = config.h
   6.982 + CONFIG_CLEAN_FILES =
   6.983 +@@ -139,8 +140,8 @@ am_libmodplug_la_OBJECTS = sndmix.lo snd
   6.984   	load_umx.lo load_ult.lo load_stm.lo load_s3m.lo load_ptm.lo \
   6.985   	load_okt.lo load_mtm.lo load_mod.lo load_med.lo load_mdl.lo \
   6.986   	load_it.lo load_far.lo load_dsm.lo load_dmf.lo load_dbm.lo \
   6.987 @@ -3309,7 +3760,16 @@
   6.988   libmodplug_la_OBJECTS = $(am_libmodplug_la_OBJECTS)
   6.989   AM_V_lt = $(am__v_lt_@AM_V@)
   6.990   am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
   6.991 -@@ -392,7 +392,6 @@ libmodplug_la_SOURCES = tables.h        
   6.992 +@@ -209,6 +210,8 @@ am__can_run_installinfo = \
   6.993 +     n|no|NO) false;; \
   6.994 +     *) (install-info --version) >/dev/null 2>&1;; \
   6.995 +   esac
   6.996 ++am__libmodpluginclude_HEADERS_DIST = modplug.h libmodplug/stdafx.h \
   6.997 ++	libmodplug/sndfile.h libmodplug/it_defs.h
   6.998 + HEADERS = $(libmodpluginclude_HEADERS) $(noinst_HEADERS)
   6.999 + am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
  6.1000 + 	$(LISP)config.h.in
  6.1001 +@@ -392,7 +395,6 @@ libmodplug_la_SOURCES = tables.h        
  6.1002                           load_ams.cpp       \
  6.1003                           load_amf.cpp       \
  6.1004                           load_669.cpp       \
  6.1005 @@ -3317,7 +3777,17 @@
  6.1006                           load_mt2.cpp       \
  6.1007                           load_psm.cpp       \
  6.1008                           load_abc.cpp       \
  6.1009 -@@ -507,7 +506,6 @@ distclean-compile:
  6.1010 +@@ -401,7 +403,8 @@ libmodplug_la_SOURCES = tables.h        
  6.1011 +                         modplug.cpp
  6.1012 + 
  6.1013 + libmodplugincludedir = $(includedir)/libmodplug
  6.1014 +-libmodpluginclude_HEADERS = libmodplug/stdafx.h libmodplug/sndfile.h libmodplug/it_defs.h modplug.h
  6.1015 ++@EXPORT_CXX_TRUE@HEADERS_CXX = libmodplug/stdafx.h libmodplug/sndfile.h libmodplug/it_defs.h
  6.1016 ++libmodpluginclude_HEADERS = modplug.h $(HEADERS_CXX)
  6.1017 + noinst_HEADERS = load_pat.h
  6.1018 + all: config.h
  6.1019 + 	$(MAKE) $(AM_MAKEFLAGS) all-am
  6.1020 +@@ -507,7 +510,6 @@ distclean-compile:
  6.1021   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_dsm.Plo@am__quote@
  6.1022   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_far.Plo@am__quote@
  6.1023   @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_it.Plo@am__quote@
     7.1 --- a/external/libmodplug-0.8.9.0/src/Makefile.am	Wed Nov 27 17:41:28 2019 +0100
     7.2 +++ b/external/libmodplug-0.8.9.0/src/Makefile.am	Thu Nov 28 03:10:00 2019 +0300
     7.3 @@ -44,6 +44,8 @@
     7.4  
     7.5  libmodplugincludedir = $(includedir)/libmodplug
     7.6  
     7.7 -
     7.8 -libmodpluginclude_HEADERS = libmodplug/stdafx.h libmodplug/sndfile.h libmodplug/it_defs.h modplug.h
     7.9 +if EXPORT_CXX
    7.10 +HEADERS_CXX = libmodplug/stdafx.h libmodplug/sndfile.h libmodplug/it_defs.h
    7.11 +endif
    7.12 +libmodpluginclude_HEADERS = modplug.h $(HEADERS_CXX)
    7.13  noinst_HEADERS = load_pat.h
     8.1 --- a/external/libmodplug-0.8.9.0/src/Makefile.in	Wed Nov 27 17:41:28 2019 +0100
     8.2 +++ b/external/libmodplug-0.8.9.0/src/Makefile.in	Thu Nov 28 03:10:00 2019 +0300
     8.3 @@ -97,8 +97,9 @@
     8.4  	$(top_srcdir)/configure.ac
     8.5  am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
     8.6  	$(ACLOCAL_M4)
     8.7 -DIST_COMMON = $(srcdir)/Makefile.am $(libmodpluginclude_HEADERS) \
     8.8 -	$(noinst_HEADERS) $(am__DIST_COMMON)
     8.9 +DIST_COMMON = $(srcdir)/Makefile.am \
    8.10 +	$(am__libmodpluginclude_HEADERS_DIST) $(noinst_HEADERS) \
    8.11 +	$(am__DIST_COMMON)
    8.12  mkinstalldirs = $(install_sh) -d
    8.13  CONFIG_HEADER = config.h
    8.14  CONFIG_CLEAN_FILES =
    8.15 @@ -209,6 +210,8 @@
    8.16      n|no|NO) false;; \
    8.17      *) (install-info --version) >/dev/null 2>&1;; \
    8.18    esac
    8.19 +am__libmodpluginclude_HEADERS_DIST = modplug.h libmodplug/stdafx.h \
    8.20 +	libmodplug/sndfile.h libmodplug/it_defs.h
    8.21  HEADERS = $(libmodpluginclude_HEADERS) $(noinst_HEADERS)
    8.22  am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
    8.23  	$(LISP)config.h.in
    8.24 @@ -400,7 +403,8 @@
    8.25                          modplug.cpp
    8.26  
    8.27  libmodplugincludedir = $(includedir)/libmodplug
    8.28 -libmodpluginclude_HEADERS = libmodplug/stdafx.h libmodplug/sndfile.h libmodplug/it_defs.h modplug.h
    8.29 +@EXPORT_CXX_TRUE@HEADERS_CXX = libmodplug/stdafx.h libmodplug/sndfile.h libmodplug/it_defs.h
    8.30 +libmodpluginclude_HEADERS = modplug.h $(HEADERS_CXX)
    8.31  noinst_HEADERS = load_pat.h
    8.32  all: config.h
    8.33  	$(MAKE) $(AM_MAKEFLAGS) all-am
     9.1 --- a/external/libmodplug-0.8.9.0/src/config.h.in	Wed Nov 27 17:41:28 2019 +0100
     9.2 +++ b/external/libmodplug-0.8.9.0/src/config.h.in	Thu Nov 28 03:10:00 2019 +0300
     9.3 @@ -42,6 +42,15 @@
     9.4  /* Define to the sub-directory where libtool stores uninstalled libraries. */
     9.5  #undef LT_OBJDIR
     9.6  
     9.7 +/* Enable midi formats support. */
     9.8 +#undef MIDIFMT_SUPPORT
     9.9 +
    9.10 +/* Enable mmcmp and pp20 decompression support. */
    9.11 +#undef MMCMP_SUPPORT
    9.12 +
    9.13 +/* Do not export the C++ interface. */
    9.14 +#undef NO_CXX_EXPORTS
    9.15 +
    9.16  /* Name of package */
    9.17  #undef PACKAGE
    9.18  
    9.19 @@ -69,6 +78,9 @@
    9.20  /* Version number of package */
    9.21  #undef VERSION
    9.22  
    9.23 +/* Enable wav formats support. */
    9.24 +#undef WAV_SUPPORT
    9.25 +
    9.26  /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    9.27     significant byte first (like Motorola and SPARC, unlike Intel). */
    9.28  #if defined AC_APPLE_UNIVERSAL_BUILD
    10.1 --- a/external/libmodplug-0.8.9.0/src/libmodplug/sndfile.h	Wed Nov 27 17:41:28 2019 +0100
    10.2 +++ b/external/libmodplug-0.8.9.0/src/libmodplug/sndfile.h	Thu Nov 28 03:10:00 2019 +0300
    10.3 @@ -417,6 +417,7 @@
    10.4  	BYTE nRowNote, nRowInstr;
    10.5  	BYTE nRowVolCmd, nRowVolume;
    10.6  	BYTE nRowCommand, nRowParam;
    10.7 +	BYTE nLeftVU, nRightVU; /* NOT USED! */
    10.8  	BYTE nActiveMacro, nPadding;
    10.9  } MODCHANNEL;
   10.10  
   10.11 @@ -623,9 +624,7 @@
   10.12  	BOOL ReadIT(LPCBYTE lpStream, DWORD dwMemLength);
   10.13  	BOOL Read669(LPCBYTE lpStream, DWORD dwMemLength);
   10.14  	BOOL ReadUlt(LPCBYTE lpStream, DWORD dwMemLength);
   10.15 -#ifdef WAV_SUPPORT
   10.16  	BOOL ReadWav(LPCBYTE lpStream, DWORD dwMemLength);
   10.17 -#endif
   10.18  	BOOL ReadDSM(LPCBYTE lpStream, DWORD dwMemLength);
   10.19  	BOOL ReadFAR(LPCBYTE lpStream, DWORD dwMemLength);
   10.20  	BOOL ReadAMS(LPCBYTE lpStream, DWORD dwMemLength);
   10.21 @@ -639,14 +638,12 @@
   10.22  	BOOL ReadMT2(LPCBYTE lpStream, DWORD dwMemLength);
   10.23  	BOOL ReadPSM(LPCBYTE lpStream, DWORD dwMemLength);
   10.24  	BOOL ReadUMX(LPCBYTE lpStream, DWORD dwMemLength);
   10.25 -#ifdef MIDIFMT_SUPPORT
   10.26  	BOOL ReadABC(LPCBYTE lpStream, DWORD dwMemLength);
   10.27  	BOOL TestABC(LPCBYTE lpStream, DWORD dwMemLength);
   10.28  	BOOL ReadMID(LPCBYTE lpStream, DWORD dwMemLength);
   10.29  	BOOL TestMID(LPCBYTE lpStream, DWORD dwMemLength);
   10.30  	BOOL ReadPAT(LPCBYTE lpStream, DWORD dwMemLength);
   10.31  	BOOL TestPAT(LPCBYTE lpStream, DWORD dwMemLength);
   10.32 -#endif
   10.33  	// Save Functions
   10.34  	// MOD Convert function
   10.35  	void ConvertModCommand(MODCOMMAND *) const;
    11.1 --- a/external/libmodplug-0.8.9.0/src/libmodplug/stdafx.h	Wed Nov 27 17:41:28 2019 +0100
    11.2 +++ b/external/libmodplug-0.8.9.0/src/libmodplug/stdafx.h	Thu Nov 28 03:10:00 2019 +0300
    11.3 @@ -21,11 +21,6 @@
    11.4  # include <stdint.h>
    11.5  #endif
    11.6  
    11.7 -/*#define CXX_INTERFACE*/ /* export C++ interface from dll. */
    11.8 -/*#define MIDIFMT_SUPPORT*/
    11.9 -/*#define WAV_SUPPORT*/
   11.10 -/*#define MMCMP_SUPPORT*/
   11.11 -
   11.12  /* disable AGC and FILESAVE for all targets for uniformity. */
   11.13  #define NO_AGC
   11.14  /*#define NO_FILTER */
   11.15 @@ -159,7 +154,7 @@
   11.16  #define MODPLUG_EXPORT
   11.17  #endif
   11.18  
   11.19 -#if defined(CXX_INTERFACE)
   11.20 +#if !defined(NO_CXX_EXPORTS)
   11.21  #define MODPLUG_EXPORTPP	MODPLUG_EXPORT
   11.22  #else
   11.23  #define MODPLUG_EXPORTPP
    12.1 --- a/external/libmodplug-0.8.9.0/src/load_abc.cpp	Wed Nov 27 17:41:28 2019 +0100
    12.2 +++ b/external/libmodplug-0.8.9.0/src/load_abc.cpp	Thu Nov 28 03:10:00 2019 +0300
    12.3 @@ -37,7 +37,15 @@
    12.4  #include "stdafx.h"
    12.5  #include "sndfile.h"
    12.6  
    12.7 -#ifdef MIDIFMT_SUPPORT
    12.8 +#ifndef MIDIFMT_SUPPORT
    12.9 +BOOL CSoundFile::TestABC(const BYTE *lpStream, DWORD dwMemLength) {
   12.10 +	return FALSE;
   12.11 +}
   12.12 +BOOL CSoundFile::ReadABC(const BYTE *lpStream, DWORD dwMemLength) {
   12.13 +	return FALSE;
   12.14 +}
   12.15 +
   12.16 +#else
   12.17  
   12.18  #include "load_pat.h"
   12.19  
    13.1 --- a/external/libmodplug-0.8.9.0/src/load_mid.cpp	Wed Nov 27 17:41:28 2019 +0100
    13.2 +++ b/external/libmodplug-0.8.9.0/src/load_mid.cpp	Thu Nov 28 03:10:00 2019 +0300
    13.3 @@ -36,7 +36,15 @@
    13.4  #include "stdafx.h"
    13.5  #include "sndfile.h"
    13.6  
    13.7 -#ifdef MIDIFMT_SUPPORT
    13.8 +#ifndef MIDIFMT_SUPPORT
    13.9 +BOOL CSoundFile::TestMID(const BYTE *lpStream, DWORD dwMemLength) {
   13.10 +	return FALSE;
   13.11 +}
   13.12 +BOOL CSoundFile::ReadMID(const BYTE *lpStream, DWORD dwMemLength) {
   13.13 +	return FALSE;
   13.14 +}
   13.15 +
   13.16 +#else
   13.17  
   13.18  #define PAN_LEFT    0x30
   13.19  #define PAN_RIGHT   0xD0
    14.1 --- a/external/libmodplug-0.8.9.0/src/load_pat.cpp	Wed Nov 27 17:41:28 2019 +0100
    14.2 +++ b/external/libmodplug-0.8.9.0/src/load_pat.cpp	Thu Nov 28 03:10:00 2019 +0300
    14.3 @@ -44,7 +44,15 @@
    14.4  #define PATH_MAX 256
    14.5  #endif
    14.6  
    14.7 -#ifdef MIDIFMT_SUPPORT
    14.8 +#ifndef MIDIFMT_SUPPORT
    14.9 +BOOL CSoundFile::TestPAT(const BYTE *lpStream, DWORD dwMemLength) {
   14.10 +	return FALSE;
   14.11 +}
   14.12 +BOOL CSoundFile::ReadPAT(const BYTE *lpStream, DWORD dwMemLength) {
   14.13 +	return FALSE;
   14.14 +}
   14.15 +
   14.16 +#else
   14.17  
   14.18  #include "load_pat.h"
   14.19  
    15.1 --- a/external/libmodplug-0.8.9.0/src/load_wav.cpp	Wed Nov 27 17:41:28 2019 +0100
    15.2 +++ b/external/libmodplug-0.8.9.0/src/load_wav.cpp	Thu Nov 28 03:10:00 2019 +0300
    15.3 @@ -7,7 +7,11 @@
    15.4  #include "stdafx.h"
    15.5  #include "sndfile.h"
    15.6  
    15.7 -#ifdef WAV_SUPPORT
    15.8 +#ifndef WAV_SUPPORT
    15.9 +BOOL CSoundFile::ReadWav(const BYTE *lpStream,DWORD dwMemLength) {
   15.10 +	return FALSE;
   15.11 +}
   15.12 +#else
   15.13  
   15.14  #ifndef WAVE_FORMAT_EXTENSIBLE
   15.15  #define WAVE_FORMAT_EXTENSIBLE	0xFFFE
   15.16 @@ -141,7 +145,6 @@
   15.17  	return TRUE;
   15.18  }
   15.19  
   15.20 -
   15.21  ////////////////////////////////////////////////////////////////////////
   15.22  // IMA ADPCM Support
   15.23