Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] OpenCV and CGAL

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] OpenCV and CGAL


Chronological Thread 
  • From: "Wesley Smith" <>
  • To:
  • Subject: Re: [cgal-discuss] OpenCV and CGAL
  • Date: Thu, 24 Apr 2008 10:28:52 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=nsleZhCdLmGaE5HZYNf6bktD/W++VLh86Wgww9n1vVxALUV/OZSveAf/Kir9uzPvMVOPcuTycvdYfewrHfpYbLAC0I0dmkX7KImBaXh/Yeyzn7NegKx/HZDIAEH/C/laUliYATdq6x99gtl3EpnNDCsgIgALLOkVesZKSUJMiks=

I actually had exactly the same problem yesterday with min and max
defines. This was with VS2008. I had to do the following:


#ifdef min
#define MIN_MACRO min
#define MAX_MACRO max
#undef min
#undef max
#else
#define MIN_MACRO
#define MAX_MACRO
#endif

/*
my code
*/

#define min MIN_MACRO
#define max MAX_MACRO


I was kind of surprised that there were macros with names min and max
in CGAL since these are such common names, they're bound to conflict.

wes



On Thu, Apr 24, 2008 at 10:23 AM, Andreas Fabri
<>
wrote:
>
> Angelina,
>
>
>
>
> wrote:
>
> > Andreas was right (as usual) Thanks! - it was not as hopeless as I thought
> to look through the huge error list :)
> >
> > Here what does the job(in case someone else needs it too):
> > #undef min
> > #undef max
> >
> >
>
>
>
> That's strange. We made quite an effort to live with the
> #define of min and max as they are also defined in the
> Microsoft header file windows.h.
>
> Undefining them is in general a bad idea, as Microsoft products
> simply need these defines.
>
> In case the appearances of min(a,b) are in your own code, the
> workaround is to wrap the word "min" as follows
>
> (min)(a,b)
>
> The additional parethesis prevents the preprocessor to do its work.
>
>
> andreas (who is not always right)
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://lists-sop.inria.fr/wws/info/cgal-discuss
>



Archive powered by MHonArc 2.6.16.

Top of Page