From 206b30ebc608d29a91cc18665d89e887cac4dba3 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Thu, 22 Sep 2011 18:55:19 -0700 Subject: [PATCH 1/3] Address regressions from e8ff555b95ba and d206d52f657c to work with other compilers 1) The error attribute appeared in gcc-4.3 2) The return type of __builtin_constant_p is int 3) Sun Studio 12.0 and later builtin support for __builtin_constant_p Found by Tinderbox. Signed-off-by: Jeremy Huddleston Reviewed-by: Matt Turner Reviewed-by: Alan Coopersmith Reviewed-by: Aaron Plattner --- include/misc.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/include/misc.h b/include/misc.h index 1fea73ec3..0867746d2 100644 --- a/include/misc.h +++ b/include/misc.h @@ -261,14 +261,16 @@ version_compare(uint16_t a_major, uint16_t a_minor, #define SwapRestL(stuff) \ SwapLongs((CARD32 *)(stuff + 1), LengthRestL(stuff)) -#ifdef __GNUC__ +#if defined(__GNUC__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)) void __attribute__((error("wrong sized variable passed to swap"))) wrong_size(void); #else static inline void wrong_size(void) { } +#endif -static inline void __builtin_constant_p(int x) +#if !(defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C < 0x590))) +static inline int __builtin_constant_p(int x) { return 0; } From 38e9e28ba2fbffee52ad9889ef6d4e94c7af3e10 Mon Sep 17 00:00:00 2001 From: Jeremy Huddleston Date: Tue, 20 Sep 2011 20:39:06 -0700 Subject: [PATCH 2/3] XQuartz: Use set_front_process rather than X11ApplicationSetFrontProcess since we're already in the AppKit thread Signed-off-by: Jeremy Huddleston --- hw/xquartz/X11Application.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m index 7fd7dab3c..12ff53c88 100644 --- a/hw/xquartz/X11Application.m +++ b/hw/xquartz/X11Application.m @@ -356,7 +356,7 @@ static void message_kit_thread (SEL selector, NSObject *arg) { */ _appFlags._active = YES; - X11ApplicationSetFrontProcess(); + [self set_front_process:nil]; /* Get the Spaces preference for SwitchOnActivate */ (void)CFPreferencesAppSynchronize(CFSTR("com.apple.dock")); From 6eae9fa28445b6cfa09061b338242df5116aafe8 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Wed, 28 Sep 2011 17:27:45 -0400 Subject: [PATCH 3/3] Remove incorrect & in swap_uint32 Caused by commit 893e86a4, and hidden by the (char *) cast. Signed-off-by: Matt Turner Reviewed-by: Jeremy Huddleston Reviewed-by: Jamey Sharp Reviewed-by: Aaron Plattner Tested-by: Aaron Plattner --- include/misc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/misc.h b/include/misc.h index 0867746d2..dc039113d 100644 --- a/include/misc.h +++ b/include/misc.h @@ -279,7 +279,7 @@ static inline int __builtin_constant_p(int x) /* byte swap a 32-bit value */ static inline void swap_uint32(uint32_t *x) { - char n = ((char *) &x)[0]; + char n = ((char *) x)[0]; ((char *) x)[0] = ((char *) x)[3]; ((char *) x)[3] = n; n = ((char *) x)[1];