[PATCH 04/22] dosfs: Avoid MIN() re-definition

Peter Dufault dufault at hda.com
Fri Nov 21 10:26:40 UTC 2014


I don't like these kind of "ifndef" tests before defining something because how do you know it was defined compatibly?  Granted MIN is well-known so that's less likely than other uses of this pattern.

Can the definition be made identical to the other definition to eliminate a warning or does GCC still warn about a redefinition?

> On Nov 18, 2014, at 09:37 , Sebastian Huber <sebastian.huber at embedded-brains.de> wrote:
> 
> ---
> cpukit/libfs/src/dosfs/fat.h | 2 ++
> 1 file changed, 2 insertions(+)
> 
> diff --git a/cpukit/libfs/src/dosfs/fat.h b/cpukit/libfs/src/dosfs/fat.h
> index 2f0f75f..26f0699 100644
> --- a/cpukit/libfs/src/dosfs/fat.h
> +++ b/cpukit/libfs/src/dosfs/fat.h
> @@ -68,7 +68,9 @@ extern "C" {
> #    define CT_LE_L(v) (v)
> #endif
> 
> +#ifndef MIN
> #define MIN(a, b)  (((a) < (b)) ? (a) : (b))
> +#endif
> 
> #define FAT_HASH_SIZE   2
> #define FAT_HASH_MODULE FAT_HASH_SIZE
> -- 
> 1.8.4.5
> 
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel

Peter
-----------------
Peter Dufault
HD Associates, Inc.      Software and System Engineering



More information about the devel mailing list