From ab10702d1237927a6692b4c3f714eda031e6c68d Mon Sep 17 00:00:00 2001 From: Benau Date: Mon, 13 Mar 2017 12:12:51 +0800 Subject: [PATCH] Try to fix build --- lib/graphics_utils/CMakeLists.txt | 2 +- lib/graphics_utils/mipmap/cpusimd.c | 7 +++++-- lib/graphics_utils/mipmap/imgresize.c | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/graphics_utils/CMakeLists.txt b/lib/graphics_utils/CMakeLists.txt index fa8efa49e..5f4423423 100644 --- a/lib/graphics_utils/CMakeLists.txt +++ b/lib/graphics_utils/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 2.6) if (UNIX OR MINGW) - add_definitions(-O3 -msse -msse2 -msse3 -mssse3 -msse4.1 -mavx -ffast-math) + add_definitions(-O3) endif() add_library(graphics_utils STATIC mipmap/cpusimd.c diff --git a/lib/graphics_utils/mipmap/cpusimd.c b/lib/graphics_utils/mipmap/cpusimd.c index 74e0b8be6..ed8f67159 100644 --- a/lib/graphics_utils/mipmap/cpusimd.c +++ b/lib/graphics_utils/mipmap/cpusimd.c @@ -41,12 +41,15 @@ #include #include -#include - #include "cpusimd.h" +#ifndef M_PI + #define M_PI 3.14159265358979323846 +#endif + + //// diff --git a/lib/graphics_utils/mipmap/imgresize.c b/lib/graphics_utils/mipmap/imgresize.c index ae81f3bf8..2433c8810 100644 --- a/lib/graphics_utils/mipmap/imgresize.c +++ b/lib/graphics_utils/mipmap/imgresize.c @@ -58,7 +58,11 @@ #if defined(__GNUC__) || defined(__INTEL_COMPILER) || defined(__clang__) #define CC_ALWAYSINLINE __attribute__((always_inline)) - #define CC_RESTRICT restrict + #if __STDC_VERSION__ >= 199901L + #define CC_RESTRICT restrict + #else + #define CC_RESTRICT + #endif #elif defined(_MSC_VER) #define CC_ALWAYSINLINE __forceinline #define CC_RESTRICT __restrict