From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id +JtwDXloemGDMAAAWB0awg (envelope-from ) for ; Thu, 28 Oct 2021 05:08:09 -0400 Received: by simark.ca (Postfix, from userid 112) id 2D0371F0BB; Thu, 28 Oct 2021 05:08:09 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 392CC1E940 for ; Thu, 28 Oct 2021 05:08:08 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D19D6385843F for ; Thu, 28 Oct 2021 09:08:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D19D6385843F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1635412087; bh=iyTZiWuVBNa+GH/cL1saKoBo9atL/dcPBp9dxosLenE=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=WJjuG3BWxIMuFfbtv/nUxaYnCxb7qYU33Nr13fvr5qea6nEWYZlMop1M7vUobRaLf C2+NyHPFY0xX/oxdj7rk2Ty7/jr52seBYp8tp5hn7Pcswvx+fxpU4I+PWZDOGczkNO oKm9BiFG7K+rackqnLuh4heNCIee6R+5eC0E4uW4= Received: from mail-pg1-x52d.google.com (mail-pg1-x52d.google.com [IPv6:2607:f8b0:4864:20::52d]) by sourceware.org (Postfix) with ESMTPS id 8B8253858D39 for ; Thu, 28 Oct 2021 09:07:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8B8253858D39 Received: by mail-pg1-x52d.google.com with SMTP id g184so5762538pgc.6 for ; Thu, 28 Oct 2021 02:07:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=iyTZiWuVBNa+GH/cL1saKoBo9atL/dcPBp9dxosLenE=; b=BYToQ+X2F1f/r3SF5gz3TvwUACOfVjm2GfLGvmk2J3T0O+SWpSdu2WrQTiDkAnnKwP DDFnPfQxe8phATTAz8x0mW0zGDGiIPw1Dn2SOeEFgzm3f2ciNweevIR67KwtSe6RR8mA CXgYs14u73alyFFZWIw+GuBQLhs93hqVZmF/J49AISIRB1bK5LYd/vKYQkr0UQkvdE0w j6mEuCQY9DaTjJUsm2siU9kAFVOdZ+7IYjZjzsR0Xp+Zgm0N4Ka9+cRIri1VPGy1yhEw kyNd1VECz+COILJd11IuqJGTfqXgKlDfvqLLP8ybCJFfe7epngMwu7PAHVCjvDESiCaF baWg== X-Gm-Message-State: AOAM531URZqijNUcEue9ZuSDvkGjsS/u0oBJV8NFu3XuyDmE+ZnJrrB0 2PabM0jAHUhaxylzRG0ZWXz5sMv4wI45+D3T X-Google-Smtp-Source: ABdhPJzXVYCiDvOcqiJ8rEcJJaum96dRInBq0EPx2rURuIrcu6wnn0J6KlupbdPrVJrqZTqi1DexPw== X-Received: by 2002:a63:89c1:: with SMTP id v184mr2343438pgd.134.1635412068386; Thu, 28 Oct 2021 02:07:48 -0700 (PDT) Received: from TestRunner.tealfjua5x4elltdavttcl1iug.xx.internal.cloudapp.net ([52.156.76.224]) by smtp.gmail.com with ESMTPSA id w11sm2151020pge.48.2021.10.28.02.07.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Oct 2021 02:07:47 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH] sim: fix compilation on mingw64 Date: Thu, 28 Oct 2021 09:07:46 +0000 Message-Id: <20211028090746.241734-1-orgads@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Orgad Shaneh via Gdb-patches Reply-To: Orgad Shaneh Cc: Orgad Shaneh Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" ...by reordering includes. 1. sim-utils.c sim/mips/sim-main.h defines UserMode, while there is a struct in winnt.h which has UserMode as a member. So if sim-main.h is included before winnt.h, compilation fails. 2. ppc registers.h defines CR, which is used as a member in winnt.h. winsock2.h is included by sys/time.h, so sys/time.h has to be included before registers.h. --- sim/common/sim-utils.c | 5 ++--- sim/ppc/emul_netbsd.c | 6 ++++-- sim/ppc/emul_unix.c | 6 ++++-- sim/ppc/mon.c | 9 ++++++--- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/sim/common/sim-utils.c b/sim/common/sim-utils.c index 380afd0493f..88fd20e8876 100644 --- a/sim/common/sim-utils.c +++ b/sim/common/sim-utils.c @@ -20,9 +20,6 @@ along with this program. If not, see . */ /* This must come before any other includes. */ #include "defs.h" -#include "sim-main.h" -#include "sim-assert.h" - #include #include #include /* needed by sys/resource.h */ @@ -34,6 +31,8 @@ along with this program. If not, see . */ #include "libiberty.h" #include "bfd.h" +#include "sim-main.h" +#include "sim-assert.h" #include "sim-utils.h" /* Allocate zero filled memory with xcalloc - xcalloc aborts if the diff --git a/sim/ppc/emul_netbsd.c b/sim/ppc/emul_netbsd.c index a97fc3b6460..d1595c5985f 100644 --- a/sim/ppc/emul_netbsd.c +++ b/sim/ppc/emul_netbsd.c @@ -25,8 +25,7 @@ /* Note: this module is called via a table. There is no benefit in making it inline */ -#include "emul_generic.h" -#include "emul_netbsd.h" +#include "defs.h" #include #include @@ -38,6 +37,9 @@ #include #include +#include "emul_generic.h" +#include "emul_netbsd.h" + #ifdef HAVE_GETRUSAGE #ifndef HAVE_SYS_RESOURCE_H #undef HAVE_GETRUSAGE diff --git a/sim/ppc/emul_unix.c b/sim/ppc/emul_unix.c index cfcb4691247..191e26abd8e 100644 --- a/sim/ppc/emul_unix.c +++ b/sim/ppc/emul_unix.c @@ -25,8 +25,7 @@ /* Note: this module is called via a table. There is no benefit in making it inline */ -#include "emul_generic.h" -#include "emul_unix.h" +#include "defs.h" #include #ifdef HAVE_SYS_TYPES_H @@ -124,6 +123,9 @@ int getrusage(); #include #include +#include "emul_generic.h" +#include "emul_unix.h" + #ifndef STATIC_INLINE_EMUL_UNIX #define STATIC_INLINE_EMUL_UNIX STATIC_INLINE #endif diff --git a/sim/ppc/mon.c b/sim/ppc/mon.c index 966f86c040e..4e29ec99879 100644 --- a/sim/ppc/mon.c +++ b/sim/ppc/mon.c @@ -21,9 +21,8 @@ #ifndef _MON_C_ #define _MON_C_ -#include "basics.h" -#include "cpu.h" -#include "mon.h" +#include "defs.h" + #include #include @@ -42,6 +41,10 @@ int getrusage(); #endif +#include "basics.h" +#include "cpu.h" +#include "mon.h" + #define MAX_BYTE_READWRITE 9 #define MAX_SHIFT_READWRITE 3 -- 2.33.1.windows.1