This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] build powerpc sim for mingw host
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Dave Murphy <davem at devkitpro dot org>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 13 Feb 2008 15:39:16 -0800
- Subject: Re: [PATCH] build powerpc sim for mingw host
- References: <47ACE034.6020802@devkitpro.org>
Hi Dave,
I'm not a simulator maintainer, so I can't actually approve your patch,
but I took a look.
> @@ -128,7 +128,7 @@
> file->pos = file->buffer;
>
> /* read it in */
> -#ifdef __CYGWIN32__
> +#ifdef __WIN32__
> if ((file->size) && ((nr = read(fd, file->buffer, file->size)) <= 0)) {
> #else
> if ((nr = read(fd, file->buffer, file->size)) < file->size) {
I don't think this is right. It looks like you are breaking the simulator
on cygwin, or at least changing the behavior, because the cygwin GCC
doesn't define __WIN32__ (I just tried it on a windows machine).
The current usage in GDB suggests that you want to use:
#if defined(_WIN32) || defined (__CYGWIN32__)
Question to the Windows specialists:
In the GDB sources, we exclusively use the __CYGWIN__ macro, whereas
in the simulator sources, we use __CYGWIN32__. The name of the latter
macro suggests that this macro is going to be defined only on 32bit
processors whereas the code above might be general to all cygwin
versions, regardless of the CPU type. Should the above be changed to:
#if defined(_WIN32) || defined (__CYGWIN__)
?
There is another file (sim/common/dv-sockser.c) where the inclusion
of <netinet/tcp.h> is conditional on __CYGWIN32__.
--
Joel