• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
structure sizes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: real-time priority, CoreAudio, etc.
  • Next by Date: How to set buffer size for Audio Output Unit?
  • Previous by thread: Re: real-time priority, CoreAudio, etc.
  • Next by thread: How to set buffer size for Audio Output Unit?
  • Index(es):
    • Date
    • Thread