w_minmax.h

00001 /*<std-header orig-src='shore' incl-file-exclusion='W_MINMAX_H'>
00002 
00003  $Id: w_minmax.h,v 1.21 2010/12/08 17:37:37 nhall Exp $
00004 
00005 SHORE -- Scalable Heterogeneous Object REpository
00006 
00007 Copyright (c) 1994-99 Computer Sciences Department, University of
00008                       Wisconsin -- Madison
00009 All Rights Reserved.
00010 
00011 Permission to use, copy, modify and distribute this software and its
00012 documentation is hereby granted, provided that both the copyright
00013 notice and this permission notice appear in all copies of the
00014 software, derivative works or modified versions, and any portions
00015 thereof, and that both notices appear in supporting documentation.
00016 
00017 THE AUTHORS AND THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY
00018 OF WISCONSIN - MADISON ALLOW FREE USE OF THIS SOFTWARE IN ITS
00019 "AS IS" CONDITION, AND THEY DISCLAIM ANY LIABILITY OF ANY KIND
00020 FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
00021 
00022 This software was developed with support by the Advanced Research
00023 Project Agency, ARPA order number 018 (formerly 8230), monitored by
00024 the U.S. Army Research Laboratory under contract DAAB07-91-C-Q518.
00025 Further funding for this work was provided by DARPA through
00026 Rome Research Laboratory Contract No. F30602-97-2-0247.
00027 
00028 */
00029 
00030 #ifndef W_MINMAX_H
00031 #define W_MINMAX_H
00032 
00033 #include "w_defines.h"
00034 
00035 /*  -- do not edit anything above this line --   </std-header>*/
00036 
00037 #if !defined(GNUG_BUG_14) 
00038 
00039 // WARNING: due to a gcc 2.6.* bug, do not used these
00040 //          since there is no way to explicitly instantiate
00041 //        function templates.
00042 
00043 template <class T>
00044 inline const T 
00045 max(const T x, const T y)
00046 {
00047     return x > y ? x : y;
00048 }
00049 
00050 template <class T>
00051 inline const T 
00052 min(const T x, const T y)
00053 {
00054     return x < y ? x : y;
00055 }
00056 #endif /* !__GNUC__ */
00057 
00058 #if HAVE_SYS_PARAM_H
00059 #include <sys/param.h>
00060 #endif
00061 
00062 #ifndef MAX
00063 #define MAX(x, y)       ((x) > (y) ? (x) : (y))
00064 #endif /*MAX*/
00065 
00066 #ifndef MIN
00067 #define MIN(x, y)       ((x) < (y) ? (x) : (y))
00068 #endif /*MIN*/
00069 
00070 /*<std-footer incl-file-exclusion='W_MINMAX_H'>  -- do not edit anything below this line -- */
00071 
00072 #endif          /*</std-footer>*/

Generated on Thu Dec 9 08:42:27 2010 for Shore Storage Manager by  doxygen 1.4.7