From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18341 invoked by alias); 26 Mar 2010 11:15:33 -0000 Received: (qmail 18326 invoked by uid 22791); 26 Mar 2010 11:15:32 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-bw0-f210.google.com (HELO mail-bw0-f210.google.com) (209.85.218.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Mar 2010 11:15:27 +0000 Received: by bwz2 with SMTP id 2so5119390bwz.10 for ; Fri, 26 Mar 2010 04:15:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.141.205 with HTTP; Fri, 26 Mar 2010 04:15:23 -0700 (PDT) In-Reply-To: <647fe9b11003260354o53df5f0ayde8d1e3a03f1b694@mail.gmail.com> References: <647fe9b11003260354o53df5f0ayde8d1e3a03f1b694@mail.gmail.com> Date: Fri, 26 Mar 2010 11:15:00 -0000 Received: by 10.204.2.210 with SMTP id 18mr1414945bkk.15.1269602123753; Fri, 26 Mar 2010 04:15:23 -0700 (PDT) Message-ID: <90baa01f1003260415m279f11a9hdaac7592d32cf4db@mail.gmail.com> Subject: Re: [PATCH] winsock include fixes From: Kai Tietz To: Ozkan Sezer Cc: gdb-patches@sources.redhat.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-03/txt/msg00877.txt.bz2 2010/3/26 Ozkan Sezer : > Hi: Here is a patch fixing the winsock include problem > which appeared after the recent winsock header work in > mingw-w64-headers. Problem is this: =A0GDB does windows.h > and winsock2.h includes in its own headers and then it > includes them in its sources in an arbitrary order. If > winsock2.h or a header including winsock2.h (such as > gdb_select.h) is included after windows.h or a header > including windows.h (such as serial.h), then conflicting > definitions occur and they result in error, because windows.h > already includes winsock.h and including winsock2.h after > that is an error. The patch fixes that in a quick and > dirty way mostly by tweaking the include order. Tested > by compiling gdb for x86_64-w64-mingw32, i686-w64-mingw32 > and x86_64-pc-linux-gnu. Please consider for applying. > > -- > Ozkan Ok, patch is ok. Ugly, but ok. > PS: > A possibly better solution is defining WIN32_LEAN_AND_MEAN > before including windows.h and then manually including > the necessary additional headers in the sources, but that > may require some more work. Long term we should clean it up in gdb. But I am pretty sure this wrong order appears in other projects, too. So I think we should make winsock2.h able to override definitions of winsock.h to simply allow this. I dislike to priest and have malfunctional projects using our runtime. It is correct that this behavior is default for VC, but it hard to argument here, as we will always hear that things are working by using w32api. Kai --=20 | (\_/) This is Bunny. Copy and paste | (=3D'.'=3D) Bunny into your signature to help | (")_(") him gain world domination