[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] compiling problem



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