1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-12 08:04:09 +02:00

Fix stb_vorbis on msys2 and mingw (#146)

This commit is contained in:
Alfredo Monclus
2018-12-09 04:08:07 -03:00
committed by Timur Gagiev
parent 51a0a081d6
commit 3d560a10be

View File

@@ -581,7 +581,9 @@ enum STBVorbisError
#undef __forceinline #undef __forceinline
#endif #endif
#define __forceinline #define __forceinline
#ifndef alloca
#define alloca __builtin_alloca #define alloca __builtin_alloca
#endif
#elif !defined(_MSC_VER) #elif !defined(_MSC_VER)
#if __GNUC__ #if __GNUC__
#define __forceinline inline #define __forceinline inline
@@ -1236,8 +1238,13 @@ static void compute_twiddle_factors(int n, float *A, float *B, float *C)
{ {
int n4 = n >> 2, n8 = n >> 3; int n4 = n >> 2, n8 = n >> 3;
int k, k2; int k, k2;
#ifdef __MINGW64__
double sA, cA, sB, cB, sC, cC;
double xA, yA, xB, yB, xC, yC;
#else
float sA, cA, sB, cB, sC, cC; float sA, cA, sB, cB, sC, cC;
float xA, yA, xB, yB, xC, yC; float xA, yA, xB, yB, xC, yC;
#endif
sincos(4*M_PI/n, &sA, &cA); sincos(4*M_PI/n, &sA, &cA);
sincos(M_PI/n/2, &sB, &cB); sincos(M_PI/n/2, &sB, &cB);
@@ -1277,7 +1284,12 @@ static void compute_twiddle_factors(int n, float *A, float *B, float *C)
static void compute_window(int n, float *window) static void compute_window(int n, float *window)
{ {
int n2 = n >> 1, i; int n2 = n >> 1, i;
#ifdef __MINGW64__
double s, c, x, y;
#else
float s, c, x, y; float s, c, x, y;
#endif
sincos(0.5f / n2 * 0.5f * M_PI, &s, &c); sincos(0.5f / n2 * 0.5f * M_PI, &s, &c);
x = c; x = c;
y = s; y = s;