This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] build powerpc sim for mingw host


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]