Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] ETIMEDOUT already defined in mingw64 library
@ 2011-10-28  2:09 Alen Skondro
  2011-10-28 13:09 ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: Alen Skondro @ 2011-10-28  2:09 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

This fixes the problem compiling gdb with latest mingw64 library (trunk).

* ETIMEDOUT is already defined in mingw64.

=================================================

diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index e3d5640..4f2dcdd 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -39,7 +39,9 @@

 #ifdef USE_WIN32API
 #include <winsock2.h>
+#ifndef ETIMEDOUT
 #define ETIMEDOUT WSAETIMEDOUT
+#endif
 #define close(fd) closesocket (fd)
 #define ioctl ioctlsocket
 #else

[-- Attachment #2: diff-mingw64.patch --]
[-- Type: application/octet-stream, Size: 306 bytes --]

diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
index e3d5640..4f2dcdd 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -39,7 +39,9 @@
 
 #ifdef USE_WIN32API
 #include <winsock2.h>
+#ifndef ETIMEDOUT
 #define ETIMEDOUT WSAETIMEDOUT
+#endif
 #define close(fd) closesocket (fd)
 #define ioctl ioctlsocket
 #else

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ETIMEDOUT already defined in mingw64 library
  2011-10-28  2:09 [PATCH] ETIMEDOUT already defined in mingw64 library Alen Skondro
@ 2011-10-28 13:09 ` Pedro Alves
  2011-10-28 13:18   ` asmwarrior
  0 siblings, 1 reply; 5+ messages in thread
From: Pedro Alves @ 2011-10-28 13:09 UTC (permalink / raw)
  To: gdb-patches; +Cc: Alen Skondro

On Thursday 27 October 2011 23:14:40, Alen Skondro wrote:
> This fixes the problem compiling gdb with latest mingw64 library (trunk).
> 
> * ETIMEDOUT is already defined in mingw64.

OOC, if you're getting an error, it's because it's defined
to something different.  What is is defined to?

> 
> =================================================
> 
> diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c
> index e3d5640..4f2dcdd 100644
> --- a/gdb/ser-tcp.c
> +++ b/gdb/ser-tcp.c
> @@ -39,7 +39,9 @@
> 
>  #ifdef USE_WIN32API
>  #include <winsock2.h>
> +#ifndef ETIMEDOUT
>  #define ETIMEDOUT WSAETIMEDOUT
> +#endif
>  #define close(fd) closesocket (fd)
>  #define ioctl ioctlsocket
>  #else
> 

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ETIMEDOUT already defined in mingw64 library
  2011-10-28 13:09 ` Pedro Alves
@ 2011-10-28 13:18   ` asmwarrior
  2011-10-28 13:33     ` asmwarrior
  0 siblings, 1 reply; 5+ messages in thread
From: asmwarrior @ 2011-10-28 13:18 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb-patches, Alen Skondro, Xun Xun

On 2011-10-28 16:50, Pedro Alves wrote:
> OOC, if you're getting an error, it's because it's defined
> to something different.  What is is defined to?
In file:
i686-w64-mingw32\include\errno.h

It was defined as below:

/* Defined as WSAETIMEDOUT.  */
#ifndef ETIMEDOUT
#define ETIMEDOUT 10060
#endif


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ETIMEDOUT already defined in mingw64 library
  2011-10-28 13:18   ` asmwarrior
@ 2011-10-28 13:33     ` asmwarrior
  2011-10-28 14:02       ` Pedro Alves
  0 siblings, 1 reply; 5+ messages in thread
From: asmwarrior @ 2011-10-28 13:33 UTC (permalink / raw)
  Cc: Pedro Alves, gdb-patches, Alen Skondro, Xun Xun

On 2011-10-28 21:12, asmwarrior wrote:
> On 2011-10-28 16:50, Pedro Alves wrote:
>> OOC, if you're getting an error, it's because it's defined
>> to something different.  What is is defined to?
> In file:
> i686-w64-mingw32\include\errno.h
> 
> It was defined as below:
> 
> /* Defined as WSAETIMEDOUT.  */
> #ifndef ETIMEDOUT
> #define ETIMEDOUT 10060
> #endif
> 
> 

BTW:
WSAETIMEDOUT can be found in two places:

i686-w64-mingw32\include\psdk_inc\_wsa_errnos.h

line 43:
#define WSAETIMEDOUT		(WSABASEERR + 60  )
and WSABASEERR is defined by:
#define WSABASEERR		10000

In another place:
i686-w64-mingw32\include\winerror.h line 1646
#define WSAETIMEDOUT 10060L

I'm not sure which header file does \gdb\ser-tcp.c use.

So, it looks like all the ETIMEDOUT definition is actually the same value.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] ETIMEDOUT already defined in mingw64 library
  2011-10-28 13:33     ` asmwarrior
@ 2011-10-28 14:02       ` Pedro Alves
  0 siblings, 0 replies; 5+ messages in thread
From: Pedro Alves @ 2011-10-28 14:02 UTC (permalink / raw)
  To: asmwarrior; +Cc: gdb-patches, Alen Skondro, Xun Xun

On Friday 28 October 2011 14:21:12, asmwarrior wrote:
> On 2011-10-28 21:12, asmwarrior wrote:
> > On 2011-10-28 16:50, Pedro Alves wrote:
> >> OOC, if you're getting an error, it's because it's defined
> >> to something different.  What is is defined to?
> > In file:
> > i686-w64-mingw32\include\errno.h
> > 
> > It was defined as below:
> > 
> > /* Defined as WSAETIMEDOUT.  */
> > #ifndef ETIMEDOUT
> > #define ETIMEDOUT 10060
> > #endif

Thanks.

> I'm not sure which header file does \gdb\ser-tcp.c use.
> 
> So, it looks like all the ETIMEDOUT definition is actually the same value.

Alright.  gcc complains because the definitions aren't textually the
same, even though they expand to the same.  I've applied Alen's
patch, with this ChangeLog entry:

2011-10-28  Alen Skondro  <askondro@gmail.com>

	* ser-tcp.c [USE_WIN32API] (ETIMEOUT): Don't define if already
	defined.

Thanks.

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-28 13:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-28  2:09 [PATCH] ETIMEDOUT already defined in mingw64 library Alen Skondro
2011-10-28 13:09 ` Pedro Alves
2011-10-28 13:18   ` asmwarrior
2011-10-28 13:33     ` asmwarrior
2011-10-28 14:02       ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox