structure sizes
structure sizes
- Subject: structure sizes
- From: Doug Wyatt <email@hidden>
- Date: Tue, 28 Aug 2001 03:51:25 -0700
This is for those of you using a compiler other than gcc with the
CoreAudio APIs.
I recommend that you write a test program as follows:
#include <stdio.h>
#include <CoreAudio/CoreAudio.h>
int main(int argc, char *argv[])
{
#define print(x) printf("%s = %d\n", #x, x)
print(sizeof(AudioStreamBasicDescription));
print(sizeof(AudioTimeStamp));
return 0;
}
And if your output is other than:
sizeof(AudioStreamBasicDescription) = 40
sizeof(AudioTimeStamp) = 64
please contact your compiler vendor.
In the meantime, you may wish to:
[a] hack MacTypes.h so that your compiler thinks Float64 is "double"
instead of "short double."
or
[b] hack CoreAudioTypes.h with pragmas to specify 8-byte alignment of
these structures, or add padding (although the PPC ABI says that, since
they start with doubles, these structures should have sizes that are
multiples of 8)
Hope this pre-emptively saves someone some trouble,
Doug
--
Doug Wyatt
work: email@hidden (CoreAudio)
personal: email@hidden
http://www.sonosphere.com
"Music happens when you disrupt space in a secure and confident manner."
-- One of the members of the Art Ensemble of Chicago