Correct public header defines for Solaris/Sun CC
PATCH 1/1 Correct public header defines for Solaris/Sun CC
# HG changeset patch
# User [email protected]
# 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.
xen/include/public/xen.h +12 -0
@@ -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"
Quoted 4 lines · On 8/8/07 19:04, "[email protected]" <[email protected]> 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
Quoted 10 lines · Keir Fraser
Quoted 4 lines · On 8/8/07 19:04, "[email protected]" <[email protected]> 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.hthrough 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