qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v2 14/34] cpu-defs: Allow multiple inclusions


From: Richard Henderson
Subject: Re: [Qemu-devel] [RFC v2 14/34] cpu-defs: Allow multiple inclusions
Date: Mon, 01 Jun 2015 12:29:49 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 06/01/2015 12:59 AM, Paolo Bonzini wrote:
> 
> 
> On 31/05/2015 08:11, Peter Crosthwaite wrote:
>> Allow subsequent inclusion of cpu-defs.h. This allows including
>> multiple cpu.h's and each getting the right set of definitions for
>> its env structure definition. All define symbols are undeffed and
>> redeffed to the new values.
>>
>> CPUTLBEntry and CPUIOTLBEntry need to be renamed via #define by
>> the caller to avoid namespace collisions.
> 
> Please document these things (#undeffing of preprocessor symbols and
> what needs to be renamed) in the header.
> 
> Also the same is true for include/exec/target-long.h---where
> additionally I am not sure about how you'd deal with a redefined
> typedef.  Some compilers flag it as an error even if the source type is
> the same.

Whee, I'm not alone in my curiosity.

Of course, one way around this is to make target_[u]long be defines instead of
typedefs.  Whether that's a sufficient solution, I have no idea.

That said, I think I'm also missing the point of multiple-inclusion.  Perhaps
it'll become clearer in a patch I haven't seen yet.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]