Revision 28:b1bc4d045a4b TestDefaults.cpp

View differences:

TestDefaults.cpp
48 48
#include <cmath>
49 49
#include <time.h>
50 50

  
51
#ifndef __GNUC__
52
#include <alloca.h>
53
#endif
54

  
51 55
Tester::TestRegistrar<TestDefaultProgram>
52 56
TestDefaultProgram::m_registrar("E1 Inconsistent default program");
53 57

  
......
75 79
        if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
76 80
        if (!data) data = createTestAudio(channels, _step, count);
77 81
        for (size_t i = 0; i < count; ++i) {
82
#ifdef __GNUC__
78 83
            float *ptr[channels];
84
#else
85
            float **ptr = (float **)alloca(channels * sizeof(float));
86
#endif
79 87
            size_t idx = i * _step;
80 88
            for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
81 89
            RealTime timestamp = RealTime::frame2RealTime(idx, rate);
......
131 139
        if (!initAdapted(p.get(), channels, _step, _step, r)) return r;
132 140
        if (!data) data = createTestAudio(channels, _step, count);
133 141
        for (size_t i = 0; i < count; ++i) {
142
#ifdef __GNUC__
134 143
            float *ptr[channels];
144
#else
145
            float **ptr = (float **)alloca(channels * sizeof(float));
146
#endif
135 147
            size_t idx = i * _step;
136 148
            for (size_t c = 0; c < channels; ++c) ptr[c] = data[c] + idx;
137 149
            RealTime timestamp = RealTime::frame2RealTime(idx, rate);

Also available in: Unified diff