On Thursday 13 November 2008 00:28:52 Stephen Wille Padnos wrote: > I'm thinking of something like the kernel macro: > > ((v)<(sub)?(sub):((v)>(sup)?(sup):(v))) > > That has the advantage and possible disadvantage of not specifying a > type. You could theoretically compare an into int to float limits or > the like. (the disadvantage being that you may not get a compile time > error if you try calling the function with the wrong types)
See kernel.h in current kernels. It implements clamp() as a typesafe macro. That's what the #ifdef is all about. It avoids the nameclash and uses the typesafe macro, if available. -- Greetings Michael. ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ Emc-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-developers
