diff mbox

[08/20] w64: Undefine macro SYS_OPEN (fixes a compiler warning)

Message ID 1334499233-6344-9-git-send-email-sw@weilnetz.de
State Superseded
Headers show

Commit Message

Stefan Weil April 15, 2012, 2:13 p.m. UTC
This could also be done in arm-semi.c, but doing it here keeps more
w64 related code in one place.

Signed-off-by: Stefan Weil <sw@weilnetz.de>
---
 qemu-os-win32.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

Comments

Blue Swirl April 15, 2012, 5 p.m. UTC | #1
On Sun, Apr 15, 2012 at 14:13, Stefan Weil <sw@weilnetz.de> wrote:
> This could also be done in arm-semi.c, but doing it here keeps more
> w64 related code in one place.

This is just papering over the bug, it could show up with a different
OS. The right fix is to change arm-semi.c to prefix the #defines with
TARGET_  or QEMU_ so they no longer clash with system definitions.

>
> Signed-off-by: Stefan Weil <sw@weilnetz.de>
> ---
>  qemu-os-win32.h |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/qemu-os-win32.h b/qemu-os-win32.h
> index 753679b..99e8423 100644
> --- a/qemu-os-win32.h
> +++ b/qemu-os-win32.h
> @@ -65,6 +65,10 @@
>  # define setjmp(env) _setjmp(env, NULL)
>  #endif
>
> +/* MinGW-w64 defines SYS_OPEN in stdio.h,
> + * but arm-semi.c uses a different definition. */
> +#undef SYS_OPEN
> +
>  /* Declaration of ffs() is missing in MinGW's strings.h. */
>  int ffs(int i);
>
> --
> 1.7.0.4
>
Stefan Weil April 15, 2012, 5:15 p.m. UTC | #2
Am 15.04.2012 19:00, schrieb Blue Swirl:
> On Sun, Apr 15, 2012 at 14:13, Stefan Weil<sw@weilnetz.de>  wrote:
>> This could also be done in arm-semi.c, but doing it here keeps more
>> w64 related code in one place.
> This is just papering over the bug, it could show up with a different
> OS. The right fix is to change arm-semi.c to prefix the #defines with
> TARGET_  or QEMU_ so they no longer clash with system definitions.
>

This patch is not strictly needed for the w64 port, because it only
fixes a compiler warning (and w64 does not set -Werror).

I agree that modifying arm-semi.c is the better solution.

Paul, do you want to fix that yourself, or do you have any preference
for the prefix (then I can send a patch)?


>> Signed-off-by: Stefan Weil<sw@weilnetz.de>
>> ---
>>   qemu-os-win32.h |    4 ++++
>>   1 files changed, 4 insertions(+), 0 deletions(-)
>>
>> diff --git a/qemu-os-win32.h b/qemu-os-win32.h
>> index 753679b..99e8423 100644
>> --- a/qemu-os-win32.h
>> +++ b/qemu-os-win32.h
>> @@ -65,6 +65,10 @@
>>   # define setjmp(env) _setjmp(env, NULL)
>>   #endif
>>
>> +/* MinGW-w64 defines SYS_OPEN in stdio.h,
>> + * but arm-semi.c uses a different definition. */
>> +#undef SYS_OPEN
>> +
>>   /* Declaration of ffs() is missing in MinGW's strings.h. */
>>   int ffs(int i);
>>
>> --
>> 1.7.0.4
>>
diff mbox

Patch

diff --git a/qemu-os-win32.h b/qemu-os-win32.h
index 753679b..99e8423 100644
--- a/qemu-os-win32.h
+++ b/qemu-os-win32.h
@@ -65,6 +65,10 @@ 
 # define setjmp(env) _setjmp(env, NULL)
 #endif
 
+/* MinGW-w64 defines SYS_OPEN in stdio.h,
+ * but arm-semi.c uses a different definition. */
+#undef SYS_OPEN
+
 /* Declaration of ffs() is missing in MinGW's strings.h. */
 int ffs(int i);