Philippe Mathieu-Daudé <philmd@linaro.org> writes:
qemu_co_mutex_assert_locked() calls qatomic_read(), which
is declared in <qemu/atomic.h>. This fixes when refactoring:
In file included from include/qemu/osdep.h:113,
from ../../util/error-report.c:13:
include/qemu/coroutine.h: In function 'qemu_co_mutex_assert_locked':
include/qemu/coroutine.h:182:12: error: implicit declaration of function
'qatomic_read' [-Werror=implicit-function-declaration]
182 | assert(qatomic_read(&mutex->locked) &&
| ^~~~~~~~~~~~
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/qemu/coroutine.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/qemu/coroutine.h b/include/qemu/coroutine.h
index 89650a2d7f..1750c30d8e 100644
--- a/include/qemu/coroutine.h
+++ b/include/qemu/coroutine.h
@@ -17,6 +17,7 @@
#include "qemu/queue.h"
#include "qemu/timer.h"
+#include "qemu/atomic.h"
/**
* Coroutines are a mechanism for stack switching and can be used for
I think this papers over the actual problem.
Compiling qemu/coroutine.h by itself succeeds for me. Printing headers
with -H shows:
[osdep.h and everything it includes elided...]
. ../include/qemu/coroutine.h
.. /work/armbru/qemu/include/qemu/queue.h
.. /work/armbru/qemu/include/qemu/timer.h
... /work/armbru/qemu/include/qemu/bitops.h
.... /work/armbru/qemu/include/qemu/host-utils.h
..... /work/armbru/qemu/include/qemu/bswap.h
...... /usr/include/byteswap.h
....... /usr/include/bits/byteswap.h
..... /work/armbru/qemu/include/qemu/int128.h
.... /work/armbru/qemu/include/qemu/atomic.h
[more...]
So, qemu/coroutine.h *already* includes qemu/atomic.h, via qemu/timer.h
and qemu/bitops.h.