diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 6691a2527..fe9bb2508 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -26,22 +26,17 @@ copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization. */ -#include -#include "quartzCommon.h" + +#include "sanitizedCarbon.h" #ifdef HAVE_DIX_CONFIG_H #include #endif -#define BOOL X_BOOL -//#undef GetWindowAttributes -//#undef ChangeWindowAttributes -#undef BOOL #include "quartzForeground.h" +#include "quartzCommon.h" #import "X11Application.h" -/* ouch! */ -#define BOOL X_BOOL # include "darwin.h" # include "darwinEvents.h" # include "quartz.h" diff --git a/hw/xquartz/X11Controller.m b/hw/xquartz/X11Controller.m index 2fd988661..1f23569e6 100644 --- a/hw/xquartz/X11Controller.m +++ b/hw/xquartz/X11Controller.m @@ -27,6 +27,8 @@ promote the sale, use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -37,17 +39,13 @@ #import "X11Controller.h" #import "X11Application.h" -#import -/* ouch! */ -#define BOOL X_BOOL #include "opaque.h" -# include "darwin.h" -# include "quartz.h" -# define _APPLEWM_SERVER_ -# include "X11/extensions/applewm.h" -# include "applewmExt.h" -#undef BOOL +#include "darwin.h" +#include "quartz.h" +#define _APPLEWM_SERVER_ +#include "X11/extensions/applewm.h" +#include "applewmExt.h" #include #include diff --git a/hw/xquartz/applewm.c b/hw/xquartz/applewm.c index 072e57ff4..ba86f1045 100644 --- a/hw/xquartz/applewm.c +++ b/hw/xquartz/applewm.c @@ -25,6 +25,8 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/hw/xquartz/darwinEvents.c b/hw/xquartz/darwinEvents.c index d69e6b744..afa292fb8 100644 --- a/hw/xquartz/darwinEvents.c +++ b/hw/xquartz/darwinEvents.c @@ -284,7 +284,7 @@ static void DarwinEventHandler(int screenNum, xEventPtr xe, DeviceIntPtr dev, in break; case kXquartzSetRootClip: - QuartzSetRootClip((BOOL)xe[i].u.clientMessage.u.l.longs0); + QuartzSetRootClip((Bool)xe[i].u.clientMessage.u.l.longs0); break; case kXquartzQuit: diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index fb9f13cd3..4d03d02fb 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -28,6 +28,8 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/hw/xquartz/quartzAudio.c b/hw/xquartz/quartzAudio.c index 5dee32f54..d3698d7c9 100644 --- a/hw/xquartz/quartzAudio.c +++ b/hw/xquartz/quartzAudio.c @@ -36,6 +36,8 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/hw/xquartz/quartzCocoa.m b/hw/xquartz/quartzCocoa.m index d8f9c69e4..aa4b9fb1e 100644 --- a/hw/xquartz/quartzCocoa.m +++ b/hw/xquartz/quartzCocoa.m @@ -32,6 +32,8 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCocoa.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -40,12 +42,8 @@ #include "inputstr.h" #include "quartzPasteboard.h" -#define BOOL xBOOL #include "darwin.h" -#include -#undef BOOL - #include "pseudoramiX.h" extern void FatalError(const char *, ...); diff --git a/hw/xquartz/quartzCommon.h b/hw/xquartz/quartzCommon.h index 40675bc5a..e63c2b760 100644 --- a/hw/xquartz/quartzCommon.h +++ b/hw/xquartz/quartzCommon.h @@ -35,18 +35,6 @@ #ifndef _QUARTZCOMMON_H #define _QUARTZCOMMON_H -// QuickDraw in ApplicationServices has the following conflicts with -// the basic X server headers. Use QD_ to use the QuickDraw -// definition of any of these symbols, or the normal name for the -// X11 definition. -#define Cursor QD_Cursor -#define WindowPtr QD_WindowPtr -#define Picture QD_Picture -#include -#include -#undef Cursor -#undef WindowPtr -#undef Picture #include #include "privates.h" diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c index fd0c3ccb3..698f39a22 100644 --- a/hw/xquartz/quartzKeyboard.c +++ b/hw/xquartz/quartzKeyboard.c @@ -34,6 +34,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif @@ -51,15 +53,6 @@ #include #include "quartzCommon.h" - -#undef GetWindowAttributes -#undef ChangeWindowAttributes - -#include -#include -#include -#include -#include // For the NXSwap* #include "darwin.h" #include "quartzKeyboard.h" diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c index 5ac3017e1..233e6e630 100644 --- a/hw/xquartz/quartzStartup.c +++ b/hw/xquartz/quartzStartup.c @@ -27,6 +27,8 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/hw/xquartz/sanitizedCarbon.h b/hw/xquartz/sanitizedCarbon.h new file mode 100644 index 000000000..cc6ef198d --- /dev/null +++ b/hw/xquartz/sanitizedCarbon.h @@ -0,0 +1,32 @@ +/* + * Don't #include any of the AppKit, etc stuff directly since it will + * pollute the X11 namespace. + */ + +#ifndef _XQ_SANITIZED_CARBON_H_ +#define _XQ_SANITIZED_CARBON_H_ + +// QuickDraw in ApplicationServices has the following conflicts with +// the basic X server headers. Use QD_ to use the QuickDraw +// definition of any of these symbols, or the normal name for the +// X11 definition. +#define Cursor QD_Cursor +#define WindowPtr QD_WindowPtr +#define Picture QD_Picture +#define BOOL OSX_BOOL +#define EventType HIT_EventType + +#include +#include +#include +#include +#include +#include // For the NXSwap* + +#undef Cursor +#undef WindowPtr +#undef Picture +#undef BOOL +#undef EventType + +#endif /* _XQ_SANITIZED_CARBON_H_ */ diff --git a/hw/xquartz/sanitizedCocoa.h b/hw/xquartz/sanitizedCocoa.h new file mode 100644 index 000000000..58de64c1c --- /dev/null +++ b/hw/xquartz/sanitizedCocoa.h @@ -0,0 +1,27 @@ +/* + * Don't #include any of the AppKit, etc stuff directly since it will + * pollute the X11 namespace. + */ + +#ifndef _XQ_SANITIZED_COCOA_H_ +#define _XQ_SANITIZED_COCOA_H_ + +// QuickDraw in ApplicationServices has the following conflicts with +// the basic X server headers. Use QD_ to use the QuickDraw +// definition of any of these symbols, or the normal name for the +// X11 definition. +#define Cursor QD_Cursor +#define WindowPtr QD_WindowPtr +#define Picture QD_Picture +#define BOOL OSX_BOOL +#define EventType HIT_EventType + +#include + +#undef Cursor +#undef WindowPtr +#undef Picture +#undef BOOL +#undef EventType + +#endif /* _XQ_SANITIZED_COCOA_H_ */ diff --git a/hw/xquartz/xpr/xprCursor.c b/hw/xquartz/xpr/xprCursor.c index a42c30cdd..76ab75c02 100644 --- a/hw/xquartz/xpr/xprCursor.c +++ b/hw/xquartz/xpr/xprCursor.c @@ -29,6 +29,8 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c index 82190463c..f685d4ad1 100644 --- a/hw/xquartz/xpr/xprScreen.c +++ b/hw/xquartz/xpr/xprScreen.c @@ -27,6 +27,8 @@ * use or other dealings in this Software without prior written authorization. */ +#include "sanitizedCarbon.h" + #ifdef HAVE_DIX_CONFIG_H #include #endif diff --git a/include/window.h b/include/window.h index ca2e57e83..52b3982e3 100644 --- a/include/window.h +++ b/include/window.h @@ -134,7 +134,7 @@ extern int ChangeWindowAttributes( /* Quartz support on Mac OS X uses the HIToolbox framework whose GetWindowAttributes function conflicts here. */ #ifdef __APPLE__ -#define GetWindowAttributes(w,c) Darwin_X_GetWindowAttributes(w,c) +#define GetWindowAttributes(w,c,x) Darwin_X_GetWindowAttributes(w,c,x) extern void Darwin_X_GetWindowAttributes( #else extern void GetWindowAttributes(