delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/09/28/08:45:36

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <433A9054.7000202@byu.net>
Date: Wed, 28 Sep 2005 06:45:08 -0600
From: Eric Blake <ebb9 AT byu DOT net>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
MIME-Version: 1.0
CC: cygwin AT cygwin DOT com
Subject: Re: Strange behaviour with g++ 3.4.4-1
References: <Pine DOT OSF DOT 4 DOT 21 DOT 0509262334460 DOT 24737-100000 AT ax0rm1 DOT roma1 DOT infn DOT it> <Xns96DE984C3CBC5ajmrtmi AT 80 DOT 91 DOT 229 DOT 5>
In-Reply-To: <Xns96DE984C3CBC5ajmrtmi@80.91.229.5>
X-IsSubscribed: yes

-----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?

- --
Life is short - so eat dessert first!

Eric Blake             ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDOpBT84KuGfSFAYARAn3xAKDOiEUXCr0Z4eo4xqn9DyEkY11WmQCfYQ7b
06I3fPYha6SC3N310yV79TI=
=pG39
-----END PGP SIGNATURE-----

--
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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019