From 4f0d98b850a561506401cd9e83808ab78fff9b75 Mon Sep 17 00:00:00 2001 From: Casey Langen Date: Tue, 13 Dec 2016 20:40:48 -0800 Subject: [PATCH] Fixed OSX compile. --- CMakeLists.txt | 2 +- src/contrib/nomaddecoder/CMakeLists.txt | 8 ++++++-- src/contrib/nomaddecoder/nomad/nomad.c | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0f75b38e9..00ca71d50 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -80,7 +80,7 @@ add_subdirectory(src/musikbox) add_subdirectory(src/contrib/taglib_plugin) add_subdirectory(src/contrib/m4adecoder) add_subdirectory(src/contrib/oggdecoder) -add_subdirectory(src/contrib/mpg123decoder) +add_subdirectory(src/contrib/nomaddecoder) add_subdirectory(src/contrib/flacdecoder) add_dependencies(taglibreader taglib) diff --git a/src/contrib/nomaddecoder/CMakeLists.txt b/src/contrib/nomaddecoder/CMakeLists.txt index 7f6bf1cf5..45e50c5bd 100644 --- a/src/contrib/nomaddecoder/CMakeLists.txt +++ b/src/contrib/nomaddecoder/CMakeLists.txt @@ -20,10 +20,14 @@ set (nomaddecoder_SOURCES ) include_directories ( - "${nomaddecoder_SOURCE_DIR}/mad" - "${nomaddecoder_SOURCE_DIR}/nomad" + "${CMAKE_CURRENT_SOURCE_DIR}/mad" + "${CMAKE_CURRENT_SOURCE_DIR}/nomad" ) +add_definitions(-DFPM_DEFAULT) +add_definitions(-DASO_ZEROCHECK) +add_definitions(-DHAVE_CONFIG_H) + add_library(nomaddecoder SHARED ${nomaddecoder_SOURCES}) target_link_libraries(nomaddecoder ${musikbox_LINK_LIBS}) diff --git a/src/contrib/nomaddecoder/nomad/nomad.c b/src/contrib/nomaddecoder/nomad/nomad.c index 17bda21c2..490432b36 100644 --- a/src/contrib/nomaddecoder/nomad/nomad.c +++ b/src/contrib/nomaddecoder/nomad/nomad.c @@ -38,6 +38,7 @@ #ifndef WIN32 #include +#include #endif #define INPUT_BUFFER_SIZE (5 * 8192) @@ -730,7 +731,7 @@ next_frame: buffer[j++] = (sample >> 8) & 0xff; } else { /* SAMPLE_FORMAT_32_BIT_FLOAT */ - ((float*)buffer)[j++] = ((float) sample / (float) SHRT_MIN) + 0.5f; + ((float*) buffer)[j++] = ((float) sample / (float) SHRT_MIN) + 0.5f; } if (nomad->info.channels == 2) { @@ -741,7 +742,7 @@ next_frame: buffer[j++] = (sample >> 8) & 0xff; } else { /* SAMPLE_FORMAT_32_BIT_FLOAT */ - ((float*)buffer)[j++] = ((float)sample / (float)SHRT_MIN) + 0.5f; + ((float*) buffer)[j++] = ((float) sample / (float) SHRT_MIN) + 0.5f; } } }