mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2024-12-22 14:35:31 +00:00
include/qemu/osdep.h: Don't include qapi/error.h
Commit 57cb38b included qapi/error.h into qemu/osdep.h to get the Error typedef. Since then, we've moved to include qemu/osdep.h everywhere. Its file comment explains: "To avoid getting into possible circular include dependencies, this file should not include any other QEMU headers, with the exceptions of config-host.h, compiler.h, os-posix.h and os-win32.h, all of which are doing a similar job to this file and are under similar constraints." qapi/error.h doesn't do a similar job, and it doesn't adhere to similar constraints: it includes qapi-types.h. That's in excess of 100KiB of crap most .c files don't actually need. Add the typedef to qemu/typedefs.h, and include that instead of qapi/error.h. Include qapi/error.h in .c files that need it and don't get it now. Include qapi-types.h in qom/object.h for uint16List. Update scripts/clean-includes accordingly. Update it further to match reality: replace config.h by config-target.h, add sysemu/os-posix.h, sysemu/os-win32.h. Update the list of includes in the qemu/osdep.h comment quoted above similarly. This reduces the number of objects depending on qapi/error.h from "all of them" to less than a third. Unfortunately, the number depending on qapi-types.h shrinks only a little. More work is needed for that one. Backports commit da34e65cb4025728566d6504a99916f6e7e1dd6a from qemu
This commit is contained in:
parent
baa477d324
commit
06668850e3
|
@ -19,6 +19,7 @@
|
|||
/* Modified for Unicorn Engine by Nguyen Anh Quynh, 2015 */
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#ifndef _WIN32
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/arm/arm.h"
|
||||
#include "hw/boards.h"
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
/* By Nguyen Anh Quynh, 2015 */
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "hw/arm/arm.h"
|
||||
#include "hw/boards.h"
|
||||
|
|
|
@ -10,7 +10,9 @@
|
|||
* See the COPYING file in the top-level directory.
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "hw/boards.h"
|
||||
#include "qapi/error.h"
|
||||
|
||||
static void machine_initfn(struct uc_struct *uc, Object *obj, void *opaque)
|
||||
{
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
* License along with this library; if not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/i386/apic.h"
|
||||
#include "hw/i386/apic_internal.h"
|
||||
#include "hw/qdev.h"
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
/* Unicorn Emulator Engine */
|
||||
/* By Nguyen Anh Quynh, 2015 */
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/mips/mips.h"
|
||||
#include "hw/mips/cpudevs.h"
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
/* Unicorn Emulator Engine */
|
||||
/* By Nguyen Anh Quynh, 2015 */
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/sparc/sparc.h"
|
||||
#include "qemu/timer.h"
|
||||
|
|
|
@ -21,6 +21,8 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
* THE SOFTWARE.
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/hw.h"
|
||||
#include "hw/sparc/sparc.h"
|
||||
#include "qemu/timer.h"
|
||||
|
|
|
@ -112,11 +112,6 @@
|
|||
#include "qapi-types.h"
|
||||
#include "unicorn/platform.h"
|
||||
|
||||
/**
|
||||
* Opaque error object.
|
||||
*/
|
||||
typedef struct Error Error;
|
||||
|
||||
/*
|
||||
* Overall category of an error.
|
||||
* Based on the qapi type QapiErrorClass, but reproduced here for nicer
|
||||
|
|
|
@ -7,8 +7,10 @@
|
|||
*
|
||||
* To avoid getting into possible circular include dependencies, this
|
||||
* file should not include any other QEMU headers, with the exceptions
|
||||
* of config-host.h, compiler.h, os-posix.h and os-win32.h, all of which
|
||||
* are doing a similar job to this file and are under similar constraints.
|
||||
* of config-host.h, config-target.h, qemu/compiler.h,
|
||||
* sysemu/os-posix.h, sysemu/os-win32.h, glib-compat.h and
|
||||
* qemu/typedefs.h, all of which are doing a similar job to this file
|
||||
* and are under similar constraints.
|
||||
*
|
||||
* This header also contains prototypes for functions defined in
|
||||
* os-*.c and util/oslib-*.c; those would probably be better split
|
||||
|
@ -86,6 +88,8 @@
|
|||
|
||||
#include "glib_compat.h"
|
||||
|
||||
#include "qemu/typedefs.h"
|
||||
|
||||
#ifndef O_LARGEFILE
|
||||
#define O_LARGEFILE 0
|
||||
#endif
|
||||
|
|
|
@ -22,6 +22,7 @@ typedef struct DisplayChangeListener DisplayChangeListener;
|
|||
typedef struct DisplayState DisplayState;
|
||||
typedef struct DisplaySurface DisplaySurface;
|
||||
typedef struct DriveInfo DriveInfo;
|
||||
typedef struct Error Error;
|
||||
typedef struct EventNotifier EventNotifier;
|
||||
typedef struct FWCfgState FWCfgState;
|
||||
typedef struct HCIInfo HCIInfo;
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
#include "glib_compat.h"
|
||||
#include "unicorn/platform.h"
|
||||
#include "qapi-types.h"
|
||||
#include "qemu/queue.h"
|
||||
#include "qemu/typedefs.h"
|
||||
#include "qapi/error.h"
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
/* Modified for Unicorn Engine by Nguyen Anh Quynh, 2015 */
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "exec/memory.h"
|
||||
#include "exec/address-spaces.h"
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
/* Modified for Unicorn Engine by Nguyen Anh Quynh, 2015 */
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "glib_compat.h"
|
||||
|
||||
#include "qemu-common.h"
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/dealloc-visitor.h"
|
||||
#include "qemu/queue.h"
|
||||
#include "qemu-common.h"
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qapi/qmp/qobject.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qmp-input-visitor.h"
|
||||
#include "qapi/visitor-impl.h"
|
||||
#include "qemu/queue.h"
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qapi/qmp-output-visitor.h"
|
||||
#include "qapi/visitor-impl.h"
|
||||
#include "qemu/queue.h"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qapi/string-input-visitor.h"
|
||||
#include "qapi/visitor-impl.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qemu/log.h"
|
||||
#include "uc_priv.h"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qom/object.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qapi/visitor.h"
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qom/object.h"
|
||||
#include "qom/qom-qobject.h"
|
||||
|
|
|
@ -360,6 +360,7 @@ h_comment = '''
|
|||
|
||||
fdef.write(mcgen('''
|
||||
#include "qemu-common.h"
|
||||
#include "qapi/error.h"
|
||||
#include "%(prefix)sqapi-visit.h"
|
||||
''',
|
||||
prefix=prefix))
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "cpu.h"
|
||||
#include "internals.h"
|
||||
#include "qemu-common.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "cpu.h"
|
||||
#include "qemu-common.h"
|
||||
#include "hw/arm/arm.h"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "unicorn/platform.h"
|
||||
|
||||
#include "cpu.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "hw/m68k/m68k.h"
|
||||
#include "cpu.h"
|
||||
#include "qemu-common.h"
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "cpu.h"
|
||||
#include "qemu-common.h"
|
||||
#include "hw/mips/mips.h"
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "cpu.h"
|
||||
#include "hw/sparc/sparc.h"
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "qemu-common.h"
|
||||
#include "qapi/error.h"
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#define HUGETLBFS_MAGIC 0x958458f6
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include "unicorn/platform.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
#include <sys/mman.h>
|
||||
|
|
|
@ -27,6 +27,7 @@
|
|||
*
|
||||
*/
|
||||
#include "qemu/osdep.h"
|
||||
#include "qapi/error.h"
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
|
||||
|
|
Loading…
Reference in a new issue