john.levon@sun.com
2007-Aug-08 18:04 UTC
[Xen-devel] [PATCH] Correct public header defines for Solaris/Sun CC
# HG changeset patch # User john.levon@sun.com # Date 1186535034 25200 # Node ID 24eb50ea28dea351633c80f5c517ba92395cefc1 # Parent aa863231740cfe81aa13077dd61632713bfa32dc Correct public header defines for Solaris/Sun CC The Solaris environment only defines __i386, not __i386__. Additionally, the assembler define used is _ASM. Accommodate both. Signed-off-by: John Levon <john.levon@sun.com> diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h --- a/xen/include/public/xen.h +++ b/xen/include/public/xen.h @@ -28,6 +28,18 @@ #define __XEN_PUBLIC_XEN_H__ #include "xen-compat.h" + +#if defined(__i386) && !defined(__i386__) +#define __i386__ +#endif + +#if defined(__amd64) && !defined(__x86_64__) +#define __x86_64__ +#endif + +#if defined(_ASM) && !defined(__ASSEMBLY__) +#define __ASSEMBLY__ +#endif #if defined(__i386__) || defined(__x86_64__) #include "arch-x86/xen.h" _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Keir Fraser
2007-Aug-09 09:08 UTC
Re: [Xen-devel] [PATCH] Correct public header defines for Solaris/Sun CC
On 8/8/07 19:04, "john.levon@sun.com" <john.levon@sun.com> wrote:> Correct public header defines for Solaris/Sun CC > > The Solaris environment only defines __i386, not __i386__. > Additionally, the assembler define used is _ASM. Accommodate both.Can''t you just include xen.h through a wrapper that makes these definitions for your non-gnu environment? Since I assume this is for Solaris and so you have full control over the source code of the includer. -- Keir _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Levon
2007-Aug-09 10:50 UTC
Re: [Xen-devel] [PATCH] Correct public header defines for Solaris/Sun CC
On Thu, Aug 09, 2007 at 10:08:24AM +0100, Keir Fraser wrote:> On 8/8/07 19:04, "john.levon@sun.com" <john.levon@sun.com> wrote: > > > Correct public header defines for Solaris/Sun CC > > > > The Solaris environment only defines __i386, not __i386__. > > Additionally, the assembler define used is _ASM. Accommodate both. > > Can''t you just include xen.h through a wrapper that makes these definitions > for your non-gnu environment? Since I assume this is for Solaris and so you > have full control over the source code of the includer.Well that''s what we''re doing now. But there are two disadvantages here: 1) we have to maintain these changes indefinitely and make sure everything goes through this wrapper. Extra-upstream changes suck and we do our best to avoid them wherever we can. 2) the wrapper only applies to the kernel, whereas these headers are used in userspace too. Whilst there''s no immediate intention of compiling the Xen sources themselves with Sun CC, it seems unnecessarily sharp to prevent any tools from using these headers directly in such an environment And finally, it''s not a large or particularly ugly change... regards john _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel