Re: X11/MacOSX audio question
Re: X11/MacOSX audio question
- Subject: Re: X11/MacOSX audio question
- From: "Torrey T. Lyons" <email@hidden>
- Date: Fri, 14 Feb 2003 11:54:38 -0800
At 1:30 PM -0500 2/14/03, Bradford Garton wrote:
Hello --
I just subscribed to this list, so this may be a totally stooopid question
(perhaps I'm doing something obviously wrong...). I searched the list
archives and didn't see anything, however. I am attemping to port
some of our older X11/Motif music & audio apps to Mac OSX (using the Apple
X11 package), but found that if I do:
#include <CoreAudio/AudioHardware.h>
it also includes references to several Apple "CoreAudio.framework"
header files, which ultimately load in a "MacTypes.h" header file.
So far, no problem, but when I go to compile, I find that this MacTypes.h
says:
typedef unsigned char Boolean;
but X11/Intrinsic.h says:
typedef char Boolean;
and they *really* don't get along.
Any clues?
This is not a stupid question, its a common problem for anyone trying
to mix and match between Carbon based code and X11 based code.
XFree86 itself has this problem internally on Mac OS X. Basically
there are two approaches you can take. XFree86 uses both of them.
1. You can separate the Carbon calling code and the X11 calling code
into separate source files. That is you can make a bunch of utility
routines which handle all your audio stuff in something like
myAudio.c. This file would include <CoreAudio/AudioHardware.h>, but
none of the X11 headers. You would then call functions in myAudio.c
whenever you needed audio features in the rest of your code. XFree86
does this in xc/programs/Xserver/hw/darwin/quartz/quartzAudio.c.
2. You can play games with #defines. For example if Boolean is the
only conflict you are having you can use something like:
#define Boolean Mac_Boolean
#include <CoreAudio/AudioHardware.h>
#undef Boolean
#include "X11/Intrinsic.h"
Of course, the order of includes matters if you use this approach.
XFree86 uses this approach in
xc/programs/Xserver/hw/darwin/quartz/quartzCommon.h. This file is
intended to be included first before any Mac specific headers as it
paves the way and removes subsequent symbol conflicts.
--Torrey
_______________________________________________
x11-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/x11-users
X11 for Mac OS X FAQ: http://developer.apple.com/qa/qa2001/qa1232.html
Report issues, request features, feedback: http://developer.apple.com/bugreporter
Do not post admin requests to the list. They will be ignored.