Function types cannot reside in the same sorted list as opaque types since they may depend on a type which would be defined later.
Of course, the same problem could arise if a function type depends on another function type with greater alphabetical order. Hopefully we don't have that at this time. Signed-off-by: Greg Kurz <gr...@kaod.org> --- include/qemu/typedefs.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/qemu/typedefs.h b/include/qemu/typedefs.h index f745d5faf7fd..cd3e369ae01a 100644 --- a/include/qemu/typedefs.h +++ b/include/qemu/typedefs.h @@ -1,10 +1,9 @@ #ifndef QEMU_TYPEDEFS_H #define QEMU_TYPEDEFS_H -/* A load of opaque types so that device init declarations don't have to - pull in all the real definitions. */ - -/* Please keep this list in alphabetical order */ +/* First list is for opaque types only, second one for function types. + * Please keep both lists in alphabetical order. + */ typedef struct AdapterInfo AdapterInfo; typedef struct AddressSpace AddressSpace; typedef struct AioContext AioContext; @@ -96,7 +95,8 @@ typedef struct uWireSlave uWireSlave; typedef struct VirtIODevice VirtIODevice; typedef struct Visitor Visitor; typedef struct node_info NodeInfo; + +typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id); typedef void SaveStateHandler(QEMUFile *f, void *opaque); -typedef int LoadStateHandler(QEMUFile *f, void *opaque, int version_id); #endif /* QEMU_TYPEDEFS_H */