From mint-bounce@lists.fishpool.fi  Thu Apr 28 12:00:02 2005
X-Original-To: fnaumann@mail.boerde.de
Delivered-To: fnaumann@mail.boerde.de
Subject: Re: [MiNT] compiling problem
From: Evan Langlois <Evan@CoolRunningConcepts.com>
To: Martin Tarenskeen <m.tarenskeen@zonnet.nl>
Cc: MiNT Mailing List <mint@fishpool.com>
In-Reply-To: <Pine.LNX.4.62.0504281043240.4074@localhost.localdomain>
References: <Pine.LNX.4.62.0504281043240.4074@localhost.localdomain>
Content-Type: text/plain
Date: Thu, 28 Apr 2005 04:57:52 -0500
Message-Id: <1114682277.18332.40.camel@taro.coolrunningconcepts.com>
Mime-Version: 1.0
X-Mailer: Evolution 2.0.3 
Content-Transfer-Encoding: 7bit
X-AntiAbuse: This header was added to track abuse, please include it with any abuse report
X-AntiAbuse: Primary Hostname - esc14.midphase.com
X-AntiAbuse: Original Domain - fishpool.com
X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]
X-AntiAbuse: Sender Address Domain - CoolRunningConcepts.com
X-Source: 
X-Source-Args: 
X-Source-Dir: 
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-To: mint-bounce@lists.fishpool.fi
X-original-sender: Evan@CoolRunningConcepts.com
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
X-Virus-Scanned: by amavisd-new at relay.boerde.de
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de
X-Spam-Status: No, hits=-0.9 tagged_above=-50.5 required=7.0 tests=AWL,
 BAYES_00
X-Spam-Level: 


I forgot to tell you how to fix it.  If you are sure the author never
passes any pointers to min or calls it through any tables or whatever,
you can just delete that entire function and use the mintlib version.
You shouldn't have function definitions in your include files anyway! 

Otherwise, to be safe, just add 

#undef min

to your noisered.h, just before the min() function gets defined, and
that should stop them from crashing into each other.

And, the author should fix this by wrapping the min() function in a 

#ifndef min
inline min (int ....)
#endif 

type of block, or if he really needs function pointers to this function,
then he should make a new C file for it (not an H file) and use #undef
min 

Anyway, its not MiNT's fault, although the #define for min() I normally
see is something a bit simpler without all the assignment and local
variable allocation, its still Sox's fault.  Perhaps the maintainer of
mintlib, or someone wiser than I, can tell me what's wrong with this:

#define min(a,b)	(((a) < (b)) ? (a) : (b))


