[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC] [PATCHv10 08/31] aio / timers: Split QEMUClock in
From: |
Alex Bligh |
Subject: |
Re: [Qemu-devel] [RFC] [PATCHv10 08/31] aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList |
Date: |
Mon, 12 Aug 2013 18:25:46 +0100 |
On 12 Aug 2013, at 18:04, Richard Henderson wrote:
> On 08/12/2013 09:25 AM, Alex Bligh wrote:
>> You mean one can't do
>>
>> typedef struct foo foo;
>> ...
>> typedef struct foo {
>> ...
>> } foo;
>>
>> ?
>
> No, but you can do
>
> typedef struct foo foo;
> ...
> struct foo {
> };
>
> It's the double typedef that's the problem.
Yup I realise that - I just didn't know that was an error.
The problem is that include file A which has
the struct definition in doesn't know whether include
file B which has the definition in has been included
or not.
So if file B has
typedef struct foo foo;
and file A defines struct foo, then
a) if A uses typedef, this will fail if bar.c includes
B then A
b) if A does not use typedef, this will fail if baz.c
does not include B then A.
The only reasonable solution would appear to be to
move all the typedefs to typedefs.h and ensure that
is included by .h file. Yuck. And only ever typedef
in one include file.
--
Alex Bligh
- [Qemu-devel] [RFC] [PATCHv10 18/31] aio / timers: Introduce new API timer_new and friends, (continued)
- [Qemu-devel] [RFC] [PATCHv10 18/31] aio / timers: Introduce new API timer_new and friends, Alex Bligh, 2013/08/11
- [Qemu-devel] [RFC] [PATCHv10 17/31] aio / timers: On timer modification, qemu_notify or aio_notify, Alex Bligh, 2013/08/11
- [Qemu-devel] [RFC] [PATCHv10 22/31] aio / timers: Remove legacy qemu_clock_deadline & qemu_timerlist_deadline, Alex Bligh, 2013/08/11
- [Qemu-devel] [RFC] [PATCHv10 19/31] aio / timers: Use all timerlists in icount warp calculations, Alex Bligh, 2013/08/11
- [Qemu-devel] [RFC] [PATCHv10 23/31] aio / timers: Add qemu_clock_get_ms and qemu_clock_get_ms, Alex Bligh, 2013/08/11
- [Qemu-devel] [RFC] [PATCHv10 08/31] aio / timers: Split QEMUClock into QEMUClock and QEMUTimerList, Alex Bligh, 2013/08/11
[Qemu-devel] [RFC] [PATCHv10 20/31] aio / timers: Add documentation and new format calls, Alex Bligh, 2013/08/11
[Qemu-devel] [RFC] [PATCHv10 27/31] aio / timers: convert block_job_sleep_ns and co_sleep_ns to new API, Alex Bligh, 2013/08/11
[Qemu-devel] [RFC] [PATCHv10 28/31] aio / timers: Add test harness for AioContext timers, Alex Bligh, 2013/08/11
[Qemu-devel] [RFC] [PATCHv10 25/31] aio / timers: Remove main_loop_timerlist, Alex Bligh, 2013/08/11
[Qemu-devel] [RFC] [PATCHv10 29/31] aio / timers: Add scripts/switch-timer-api, Alex Bligh, 2013/08/11
[Qemu-devel] [RFC] [PATCHv10 21/31] aio / timers: Remove alarm timers, Alex Bligh, 2013/08/11
[Qemu-devel] [RFC] [PATCHv10 26/31] aio / timers: Convert rtc_clock to be a QEMUClockType, Alex Bligh, 2013/08/11
[Qemu-devel] [RFC] [PATCHv10 31/31] aio / timers: Remove legacy interface, Alex Bligh, 2013/08/11
[Qemu-devel] [RFC] [PATCHv10 24/31] aio / timers: Rearrange timer.h & make legacy functions call non-legacy, Alex Bligh, 2013/08/11
[Qemu-devel] [RFC] [PATCHv10 30/31] aio / timers: Switch entire codebase to the new timer API, Alex Bligh, 2013/08/11