diff options
author | Daniil Cherednik <dan.cherednik@gmail.com> | 2016-09-25 00:46:12 +0300 |
---|---|---|
committer | Daniil Cherednik <dan.cherednik@gmail.com> | 2016-09-25 00:46:12 +0300 |
commit | bfd0ae706ea86fb296857057e0178b77301b9093 (patch) | |
tree | 2814d0faeffe80e71a1c1c0dafaaaa3c655bbdfb /src | |
parent | 302636b1d7704b349addcf73cd159c684a85a94d (diff) | |
download | atracdenc-bfd0ae706ea86fb296857057e0178b77301b9093.tar.gz |
fix compilation errors in case of building without ut
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 14 | ||||
-rw-r--r-- | src/config.h | 5 | ||||
-rw-r--r-- | src/mdct/vorbis_impl/mdct.c | 1 |
3 files changed, 20 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index c9c797a..d00e6c7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,5 +1,19 @@ CMAKE_MINIMUM_REQUIRED(VERSION 2.8) +macro(use_11) + if (CMAKE_VERSION VERSION_LESS "3.1") + message ("cmake version: " ${CMAKE_VERSION} " --std arguments will be forced") + + set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}" CACHE STRING "" FORCE) + set (CMAKE_C_FLAGS "-std=c11 ${CMAKE_C_FLAGS}" CACHE STRING "" FORCE) + else () + set (CMAKE_CXX_STANDARD 11) + set (CMAKE_C_STANDARD 11) + endif () +endmacro(use_11) + +use_11() + #add_definitions( "-Wall -O2 -g -Rpass-analysis=loop-vectorize" ) #set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -fsanitize=address -fno-omit-frame-pointer") diff --git a/src/config.h b/src/config.h index 698b865..f9022a9 100644 --- a/src/config.h +++ b/src/config.h @@ -7,3 +7,8 @@ typedef double TFloat; #else typedef float TFloat; #endif + + +#ifndef M_PI +#define M_PI (3.14159265358979323846) +#endif diff --git a/src/mdct/vorbis_impl/mdct.c b/src/mdct/vorbis_impl/mdct.c index baa7b43..384cf5c 100644 --- a/src/mdct/vorbis_impl/mdct.c +++ b/src/mdct/vorbis_impl/mdct.c @@ -37,6 +37,7 @@ */ #include "mdct.h" +#include <alloca.h> /** * Allocates and initializes lookup tables in the MDCT context. |