Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com
Reply-To: Cygwin List <cygwin@cygwin.com>
Message-Id: <6.2.1.2.0.20050928105005.0443a958@pop.prospeed.net>
Date: Wed, 28 Sep 2005 10:51:14 -0400
To: Eric Blake <ebb9@byu.net>
From: Larry Hall <lh-no-personal-replies-please@cygwin.com>
Subject: Re: Strange behaviour with g++ 3.4.4-1
Cc: cygwin@cygwin.com
In-Reply-To: <433A9054.7000202@byu.net>
References: <Pine.OSF.4.21.0509262334460.24737-100000@ax0rm1.roma1.infn.it>  <Xns96DE984C3CBC5ajmrtmi@80.91.229.5>  <433A9054.7000202@byu.net>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"

At 08:45 AM 9/28/2005, you wrote:
>-----BEGIN PGP SIGNED MESSAGE-----
>Hash: SHA1
>
>According to Andy Moreton on 9/27/2005 7:58 AM:
>>>>
>>>> #include <iostream>
>>>> #include <windows.h>
>>>>+#undef max
>>>>+#undef min
>>>> #include <complex>
>>>
>>>
>> 
>> The problem is that "windows.h" includes "windef.h" which defines the 
>> standard macros min() and max() without checking if they are already 
>> defined.
>
>Actually, <windef.h> DOES check if min and max are already defined before
>defining them.  But <complex> uses std::max, which won't work if max is a
>macro.  The correct fix, in my opinion, would be to update windef.h to not
>define min and max if __cplusplus is defined, since C++ is much less
>forgiving of min and max being macros in the first place (in other words,
>min and max as macros only works in C).
>
>But where does upstream windef.h live, to propose a patch to it?


Isn't it enough to offer a patch to the w32api package maintainer and let
that person take this upstream?


--
Larry Hall                              http://www.rfk.com
RFK Partners, Inc.                      (508) 893-9779 - RFK Office
838 Washington Street                   (508) 893-9889 - FAX
Holliston, MA 01746                     


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

