1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-08-10 23:24:06 +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
#endif
#define __forceinline
#define alloca __builtin_alloca
#ifndef alloca
#define alloca __builtin_alloca
#endif
#elif !defined(_MSC_VER)
#if __GNUC__
#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 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 xA, yA, xB, yB, xC, yC;
#endif
sincos(4*M_PI/n, &sA, &cA);
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)
{
int n2 = n >> 1, i;
#ifdef __MINGW64__
double s, c, x, y;
#else
float s, c, x, y;
#endif
sincos(0.5f / n2 * 0.5f * M_PI, &s, &c);
x = c;
y = s;