diff mbox series

mingw: Fix builds on f33 mingw

Message ID 20201008174359.157627-1-dgilbert@redhat.com
State New
Headers show
Series mingw: Fix builds on f33 mingw | expand

Commit Message

Dr. David Alan Gilbert Oct. 8, 2020, 5:43 p.m. UTC
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

Fedora 33's mingw moans about:

In file included from ../tests/test-bitmap.c:12:
/home/dgilbert/git/migpull/include/qemu/osdep.h:76: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]
   76 | #define __USE_MINGW_ANSI_STDIO 1
      |

the fix is to make sure osdep.h is the first include - which is our
rule anyway; but one we broke in a couple of places.

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
---
 migration/dirtyrate.c | 2 +-
 tests/test-bitmap.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Thomas Huth Oct. 8, 2020, 5:46 p.m. UTC | #1
On 08/10/2020 19.43, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

> 

> Fedora 33's mingw moans about:

> 

> In file included from ../tests/test-bitmap.c:12:

> /home/dgilbert/git/migpull/include/qemu/osdep.h:76: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]

>    76 | #define __USE_MINGW_ANSI_STDIO 1

>       |

> 

> the fix is to make sure osdep.h is the first include - which is our

> rule anyway; but one we broke in a couple of places.

> 

> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---

>  migration/dirtyrate.c | 2 +-

>  tests/test-bitmap.c   | 2 +-

>  2 files changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c

> index ab9e1301f6..42b71e771e 100644

> --- a/migration/dirtyrate.c

> +++ b/migration/dirtyrate.c

> @@ -10,8 +10,8 @@

>   * See the COPYING file in the top-level directory.

>   */

>  

> -#include <zlib.h>

>  #include "qemu/osdep.h"

> +#include <zlib.h>

>  #include "qapi/error.h"

>  #include "cpu.h"

>  #include "qemu/config-file.h"

> diff --git a/tests/test-bitmap.c b/tests/test-bitmap.c

> index 2f5b71458a..c3c9d79667 100644

> --- a/tests/test-bitmap.c

> +++ b/tests/test-bitmap.c

> @@ -8,8 +8,8 @@

>   * Author: Peter Xu <peterx@redhat.com>

>   */

>  

> -#include <stdlib.h>

>  #include "qemu/osdep.h"

> +#include <stdlib.h>

>  #include "qemu/bitmap.h"

>  

>  #define BMAP_SIZE  1024

> 


Reviewed-by: Thomas Huth <thuth@redhat.com>
Philippe Mathieu-Daudé Oct. 8, 2020, 5:49 p.m. UTC | #2
On 10/8/20 7:43 PM, Dr. David Alan Gilbert (git) wrote:
> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

> 

> Fedora 33's mingw moans about:

> 

> In file included from ../tests/test-bitmap.c:12:

> /home/dgilbert/git/migpull/include/qemu/osdep.h:76: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]

>    76 | #define __USE_MINGW_ANSI_STDIO 1

>       |

> 

> the fix is to make sure osdep.h is the first include - which is our

> rule anyway; but one we broke in a couple of places.


Marc-André sent the same fix:
https://lists.gnu.org/archive/html/qemu-devel/2020-10/msg02191.html

> 

> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---

>  migration/dirtyrate.c | 2 +-

>  tests/test-bitmap.c   | 2 +-

>  2 files changed, 2 insertions(+), 2 deletions(-)

> 

> diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c

> index ab9e1301f6..42b71e771e 100644

> --- a/migration/dirtyrate.c

> +++ b/migration/dirtyrate.c

> @@ -10,8 +10,8 @@

>   * See the COPYING file in the top-level directory.

>   */

>  

> -#include <zlib.h>

>  #include "qemu/osdep.h"

> +#include <zlib.h>

>  #include "qapi/error.h"

>  #include "cpu.h"

>  #include "qemu/config-file.h"

> diff --git a/tests/test-bitmap.c b/tests/test-bitmap.c

> index 2f5b71458a..c3c9d79667 100644

> --- a/tests/test-bitmap.c

> +++ b/tests/test-bitmap.c

> @@ -8,8 +8,8 @@

>   * Author: Peter Xu <peterx@redhat.com>

>   */

>  

> -#include <stdlib.h>

>  #include "qemu/osdep.h"

> +#include <stdlib.h>

>  #include "qemu/bitmap.h"

>  

>  #define BMAP_SIZE  1024

>
Richard Henderson Oct. 8, 2020, 5:50 p.m. UTC | #3
On 10/8/20 12:43 PM, Dr. David Alan Gilbert (git) wrote:
> -#include <stdlib.h>

>  #include "qemu/osdep.h"

> +#include <stdlib.h>


As pointed out by pmm earlier, for someone else's version of this patch,
<stdlib.h> should simply be removed here -- it's already included by osdep.h.


r~
Laurent Vivier Oct. 12, 2020, 2:35 p.m. UTC | #4
Le 08/10/2020 à 19:46, Thomas Huth a écrit :
> On 08/10/2020 19.43, Dr. David Alan Gilbert (git) wrote:

>> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

>>

>> Fedora 33's mingw moans about:

>>

>> In file included from ../tests/test-bitmap.c:12:

>> /home/dgilbert/git/migpull/include/qemu/osdep.h:76: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]

>>    76 | #define __USE_MINGW_ANSI_STDIO 1

>>       |

>>

>> the fix is to make sure osdep.h is the first include - which is our

>> rule anyway; but one we broke in a couple of places.

>>

>> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

>> ---

>>  migration/dirtyrate.c | 2 +-

>>  tests/test-bitmap.c   | 2 +-

>>  2 files changed, 2 insertions(+), 2 deletions(-)

>>

>> diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c

>> index ab9e1301f6..42b71e771e 100644

>> --- a/migration/dirtyrate.c

>> +++ b/migration/dirtyrate.c

>> @@ -10,8 +10,8 @@

>>   * See the COPYING file in the top-level directory.

>>   */

>>  

>> -#include <zlib.h>

>>  #include "qemu/osdep.h"

>> +#include <zlib.h>

>>  #include "qapi/error.h"

>>  #include "cpu.h"

>>  #include "qemu/config-file.h"

>> diff --git a/tests/test-bitmap.c b/tests/test-bitmap.c

>> index 2f5b71458a..c3c9d79667 100644

>> --- a/tests/test-bitmap.c

>> +++ b/tests/test-bitmap.c

>> @@ -8,8 +8,8 @@

>>   * Author: Peter Xu <peterx@redhat.com>

>>   */

>>  

>> -#include <stdlib.h>

>>  #include "qemu/osdep.h"

>> +#include <stdlib.h>

>>  #include "qemu/bitmap.h"

>>  

>>  #define BMAP_SIZE  1024

>>

> 

> Reviewed-by: Thomas Huth <thuth@redhat.com>

> 

> 


Applied to my trivial-patches branch.

Thanks,
Laurent
Peter Maydell Oct. 12, 2020, 3:05 p.m. UTC | #5
On Mon, 12 Oct 2020 at 15:39, Laurent Vivier <laurent@vivier.eu> wrote:
>

> Le 08/10/2020 à 19:46, Thomas Huth a écrit :

> > On 08/10/2020 19.43, Dr. David Alan Gilbert (git) wrote:

> >> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

> >>

> >> Fedora 33's mingw moans about:

> >>

> >> In file included from ../tests/test-bitmap.c:12:

> >> /home/dgilbert/git/migpull/include/qemu/osdep.h:76: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]

> >>    76 | #define __USE_MINGW_ANSI_STDIO 1

> >>       |

> >>

> >> the fix is to make sure osdep.h is the first include - which is our

> >> rule anyway; but one we broke in a couple of places.

> >>

> >> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> >> ---

> >>  migration/dirtyrate.c | 2 +-

> >>  tests/test-bitmap.c   | 2 +-

> >>  2 files changed, 2 insertions(+), 2 deletions(-)

> >>

> >> diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c

> >> index ab9e1301f6..42b71e771e 100644

> >> --- a/migration/dirtyrate.c

> >> +++ b/migration/dirtyrate.c

> >> @@ -10,8 +10,8 @@

> >>   * See the COPYING file in the top-level directory.

> >>   */

> >>

> >> -#include <zlib.h>

> >>  #include "qemu/osdep.h"

> >> +#include <zlib.h>

> >>  #include "qapi/error.h"

> >>  #include "cpu.h"

> >>  #include "qemu/config-file.h"

> >> diff --git a/tests/test-bitmap.c b/tests/test-bitmap.c

> >> index 2f5b71458a..c3c9d79667 100644

> >> --- a/tests/test-bitmap.c

> >> +++ b/tests/test-bitmap.c

> >> @@ -8,8 +8,8 @@

> >>   * Author: Peter Xu <peterx@redhat.com>

> >>   */

> >>

> >> -#include <stdlib.h>

> >>  #include "qemu/osdep.h"

> >> +#include <stdlib.h>

> >>  #include "qemu/bitmap.h"

> >>

> >>  #define BMAP_SIZE  1024

> >>

> >

> > Reviewed-by: Thomas Huth <thuth@redhat.com>

> >

> >

>

> Applied to my trivial-patches branch.


This is the wrong version of this patch -- can you take
Marc-André's instead, please?

thanks
-- PMM
Laurent Vivier Oct. 12, 2020, 3:15 p.m. UTC | #6
Le 12/10/2020 à 17:05, Peter Maydell a écrit :
> On Mon, 12 Oct 2020 at 15:39, Laurent Vivier <laurent@vivier.eu> wrote:

>>

>> Le 08/10/2020 à 19:46, Thomas Huth a écrit :

>>> On 08/10/2020 19.43, Dr. David Alan Gilbert (git) wrote:

>>>> From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>

>>>>

>>>> Fedora 33's mingw moans about:

>>>>

>>>> In file included from ../tests/test-bitmap.c:12:

>>>> /home/dgilbert/git/migpull/include/qemu/osdep.h:76: error: "__USE_MINGW_ANSI_STDIO" redefined [-Werror]

>>>>    76 | #define __USE_MINGW_ANSI_STDIO 1

>>>>       |

>>>>

>>>> the fix is to make sure osdep.h is the first include - which is our

>>>> rule anyway; but one we broke in a couple of places.

>>>>

>>>> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

>>>> ---

>>>>  migration/dirtyrate.c | 2 +-

>>>>  tests/test-bitmap.c   | 2 +-

>>>>  2 files changed, 2 insertions(+), 2 deletions(-)

>>>>

>>>> diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c

>>>> index ab9e1301f6..42b71e771e 100644

>>>> --- a/migration/dirtyrate.c

>>>> +++ b/migration/dirtyrate.c

>>>> @@ -10,8 +10,8 @@

>>>>   * See the COPYING file in the top-level directory.

>>>>   */

>>>>

>>>> -#include <zlib.h>

>>>>  #include "qemu/osdep.h"

>>>> +#include <zlib.h>

>>>>  #include "qapi/error.h"

>>>>  #include "cpu.h"

>>>>  #include "qemu/config-file.h"

>>>> diff --git a/tests/test-bitmap.c b/tests/test-bitmap.c

>>>> index 2f5b71458a..c3c9d79667 100644

>>>> --- a/tests/test-bitmap.c

>>>> +++ b/tests/test-bitmap.c

>>>> @@ -8,8 +8,8 @@

>>>>   * Author: Peter Xu <peterx@redhat.com>

>>>>   */

>>>>

>>>> -#include <stdlib.h>

>>>>  #include "qemu/osdep.h"

>>>> +#include <stdlib.h>

>>>>  #include "qemu/bitmap.h"

>>>>

>>>>  #define BMAP_SIZE  1024

>>>>

>>>

>>> Reviewed-by: Thomas Huth <thuth@redhat.com>

>>>

>>>

>>

>> Applied to my trivial-patches branch.

> 

> This is the wrong version of this patch -- can you take

> Marc-André's instead, please?


Yes, queueing instead:

"[PATCH v2] mingw: fix error __USE_MINGW_ANSI_STDIO redefined"

Thanks,
Laurent
diff mbox series

Patch

diff --git a/migration/dirtyrate.c b/migration/dirtyrate.c
index ab9e1301f6..42b71e771e 100644
--- a/migration/dirtyrate.c
+++ b/migration/dirtyrate.c
@@ -10,8 +10,8 @@ 
  * See the COPYING file in the top-level directory.
  */
 
-#include <zlib.h>
 #include "qemu/osdep.h"
+#include <zlib.h>
 #include "qapi/error.h"
 #include "cpu.h"
 #include "qemu/config-file.h"
diff --git a/tests/test-bitmap.c b/tests/test-bitmap.c
index 2f5b71458a..c3c9d79667 100644
--- a/tests/test-bitmap.c
+++ b/tests/test-bitmap.c
@@ -8,8 +8,8 @@ 
  * Author: Peter Xu <peterx@redhat.com>
  */
 
-#include <stdlib.h>
 #include "qemu/osdep.h"
+#include <stdlib.h>
 #include "qemu/bitmap.h"
 
 #define BMAP_SIZE  1024