$NetBSD$

--- src/ptlib/unix/maccoreaudio.cxx.orig	2004-11-18 17:40:47.000000000 +0900
+++ src/ptlib/unix/maccoreaudio.cxx
@@ -1323,8 +1323,8 @@ OSStatus PSoundChannelCoreAudio::SetupAd
 	bufferSizeBytes += bufferSizeBytes / 10; // +10%
 
    //calculate size of ABL given the last field, assum non-interleaved 
-   UInt32 propsize = 
-      offsetof(AudioBufferList, mBuffers[hwASBD.mChannelsPerFrame]);
+   UInt32 mChannelsPerFrame = hwASBD.mChannelsPerFrame;
+   UInt32 propsize = (UInt32) &(((AudioBufferList *)0)->mBuffers[mChannelsPerFrame]);
 
    //malloc buffer lists
    mInputBufferList = (AudioBufferList *)malloc(propsize);
@@ -1358,7 +1358,8 @@ OSStatus PSoundChannelCoreAudio::SetupAd
 
 
    //calculate number of buffers from channels
-   propsize = offsetof(AudioBufferList, mBuffers[pwlibASBD.mChannelsPerFrame]);
+   mChannelsPerFrame = pwlibASBD.mChannelsPerFrame;
+   propsize = (UInt32) &(((AudioBufferList *)0)->mBuffers[mChannelsPerFrame]);
 
    //malloc buffer lists
    mOutputBufferList = (AudioBufferList *)malloc(propsize);
