mirror of
https://github.com/moonlight-stream/moonlight-common-c.git
synced 2026-06-17 14:21:30 +00:00
Merge pull request #36 from d3m3vilurr/refix-alloca
Add NEED_ALLOCA macro
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
#include "rs.h"
|
#include "rs.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
#define NEED_ALLOCA
|
||||||
#define alloca(x) _alloca(x)
|
#define alloca(x) _alloca(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -225,10 +226,17 @@ static int invert_mat(gf *src, int k) {
|
|||||||
int irow, icol, row, col, i, ix;
|
int irow, icol, row, col, i, ix;
|
||||||
|
|
||||||
int error = 1;
|
int error = 1;
|
||||||
|
#ifdef NEED_ALLOCA
|
||||||
int *indxc = alloca(k*sizeof(int));
|
int *indxc = alloca(k*sizeof(int));
|
||||||
int *indxr = alloca(k*sizeof(int));
|
int *indxr = alloca(k*sizeof(int));
|
||||||
int *ipiv = alloca(k*sizeof(int));
|
int *ipiv = alloca(k*sizeof(int));
|
||||||
gf *id_row = alloca(k*sizeof(gf));
|
gf *id_row = alloca(k*sizeof(gf));
|
||||||
|
#else
|
||||||
|
int indxc[k];
|
||||||
|
int indxr[k];
|
||||||
|
int ipiv[k];
|
||||||
|
gf id_row[k];
|
||||||
|
#endif
|
||||||
|
|
||||||
memset(id_row, 0, k*sizeof(gf));
|
memset(id_row, 0, k*sizeof(gf));
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user