summaryrefslogtreecommitdiff
path: root/hw/xfree86/x86emu/decode.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-11-07 21:05:33 -0800
committerKeith Packard <keithp@keithp.com>2013-11-12 21:03:53 +0900
commitc4c154d18ef42dc550f2675a9ee88e07b1ca6bed (patch)
treeb9568902245ab4f4e5f40374b00e026dcd2ca00f /hw/xfree86/x86emu/decode.c
parentd7f9be0f8541368bf1a095ad1fbe7f38be6d3d15 (diff)
Avoid conflicts with Solaris <sys/regset.h> defines that clash with our names
When building on Solaris with _XOPEN_SOURCE set to a recent XPG release, <stdlib.h> and other core headers start including <sys/regset.h>, which has a bunch of unfortunately named macros such as "CS", "ES", etc. for x86 & x64 registers which clash with existing variable & struct member names in Xorg - so #undef these so they don't interfere with our use. (Yes, have filed a bug against the system headers for exposing these, but this solves the problem for building on existing releases.) Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
Diffstat (limited to 'hw/xfree86/x86emu/decode.c')
-rw-r--r--hw/xfree86/x86emu/decode.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hw/xfree86/x86emu/decode.c b/hw/xfree86/x86emu/decode.c
index 12f8fb84b..08a07b1bb 100644
--- a/hw/xfree86/x86emu/decode.c
+++ b/hw/xfree86/x86emu/decode.c
@@ -38,6 +38,16 @@
****************************************************************************/
#include <stdlib.h>
+
+#if defined(__sun) && defined(CS) /* avoid conflicts with Solaris sys/regset.h */
+# undef CS
+# undef DS
+# undef SS
+# undef ES
+# undef FS
+# undef GS
+#endif
+
#include "x86emu/x86emui.h"
/*----------------------------- Implementation ----------------------------*/