Home | History | Annotate | Line # | Download | only in misc
      1  1.1  haad /*	$NetBSD: util.h,v 1.1.1.1 2008/12/22 00:18:13 haad Exp $	*/
      2  1.1  haad 
      3  1.1  haad /*
      4  1.1  haad  * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
      5  1.1  haad  *
      6  1.1  haad  * This file is part of LVM2.
      7  1.1  haad  *
      8  1.1  haad  * This copyrighted material is made available to anyone wishing to use,
      9  1.1  haad  * modify, copy, or redistribute it subject to the terms and conditions
     10  1.1  haad  * of the GNU Lesser General Public License v.2.1.
     11  1.1  haad  *
     12  1.1  haad  * You should have received a copy of the GNU Lesser General Public License
     13  1.1  haad  * along with this program; if not, write to the Free Software Foundation,
     14  1.1  haad  * Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
     15  1.1  haad  */
     16  1.1  haad 
     17  1.1  haad #ifndef _LVM_UTIL_H
     18  1.1  haad #define _LVM_UTIL_H
     19  1.1  haad 
     20  1.1  haad #define min(a, b) ({ typeof(a) _a = (a); \
     21  1.1  haad 		     typeof(b) _b = (b); \
     22  1.1  haad 		     (void) (&_a == &_b); \
     23  1.1  haad 		     _a < _b ? _a : _b; })
     24  1.1  haad 
     25  1.1  haad #define max(a, b) ({ typeof(a) _a = (a); \
     26  1.1  haad 		     typeof(b) _b = (b); \
     27  1.1  haad 		     (void) (&_a == &_b); \
     28  1.1  haad 		     _a > _b ? _a : _b; })
     29  1.1  haad 
     30  1.1  haad #define uninitialized_var(x) x = x
     31  1.1  haad 
     32  1.1  haad #endif
     33