I have a unit that looks like this:
========================================
Unit WaveinSupport;
Interface
Uses Windows, MMSystem, SysUtils;
Const MAX_BUFFERS = 2;
TWaveIn = class(TObject)
Constructor Create(newFormHandle:HWnd; BfSize, newTotalBuffers : Integer);
Destructor Destroy; Override;
private
pvpWaveHeader: Array [0..MAX_BUFFERS] of PWAVEHDR;
...
========================================
In the body of the code, the only reference to pvpWaveHeader looks like this:
for index = 0 to 1 do pvpWaveHeader [index] := ...
The upper limit on index here is always 1 regardless of the value of MAX_BUFFERS.
With the constant MAX_BUFFERS = 2, this unit works fine. But if I change it to MAX_BUFFERS = 1, I get an error
'External: SIGSEGV', at address 72D245EC
I realize this is a very limited description of the problem, but does anyone have any idea what might be going on here? I'm using Lazarus 1.0.2 with FPC 2.6.0 under Windows XP.