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

Re: [MiNT] Freemint sys/params.h



Hello!

In sys/params.h, MAX macro is defined as:

#define MAX(a,b) \
   ({__typeof__ (a) _a = (a); __typeof__ (b) _b = (b);  \
             _a > _b ? _a : _b; })

On linux, glibc, and other systems, MAX is defined similarly, but more
simply as:

#define MAX(a, b)  (((a) > (b)) ? (a) : (b))

If I undefine max as part of compiling coreutils, and define it with the
linux style, the program then compiles and the resulting binary works.
The problem here is 1. I don't know if it's okay to make that
substitution,

Yes, it's ok. The MiNTLib version tries to be typesafe in some way with gcc extensions. Which gcc do you use?

and 2, I don't know what MAX does here.

It just return the maximum number of a and b.


Regards,
Frank

--
ATARI FALCON 060 // MILAN 060
-----------------------------------------
http://www.cs.uni-magdeburg.de/~fnaumann/
e-Mail: fnaumann@freemint.de