Zero  0.1.0
w_minmax.h
Go to the documentation of this file.
1 /*<std-header orig-src='shore' incl-file-exclusion='W_MINMAX_H'>
2 
3  $Id: w_minmax.h,v 1.21 2010/12/08 17:37:37 nhall Exp $
4 
5 SHORE -- Scalable Heterogeneous Object REpository
6 
7 Copyright (c) 1994-99 Computer Sciences Department, University of
8  Wisconsin -- Madison
9 All Rights Reserved.
10 
11 Permission to use, copy, modify and distribute this software and its
12 documentation is hereby granted, provided that both the copyright
13 notice and this permission notice appear in all copies of the
14 software, derivative works or modified versions, and any portions
15 thereof, and that both notices appear in supporting documentation.
16 
17 THE AUTHORS AND THE COMPUTER SCIENCES DEPARTMENT OF THE UNIVERSITY
18 OF WISCONSIN - MADISON ALLOW FREE USE OF THIS SOFTWARE IN ITS
19 "AS IS" CONDITION, AND THEY DISCLAIM ANY LIABILITY OF ANY KIND
20 FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
21 
22 This software was developed with support by the Advanced Research
23 Project Agency, ARPA order number 018 (formerly 8230), monitored by
24 the U.S. Army Research Laboratory under contract DAAB07-91-C-Q518.
25 Further funding for this work was provided by DARPA through
26 Rome Research Laboratory Contract No. F30602-97-2-0247.
27 
28 */
29 
30 #ifndef __W_MINMAX_H
31 #define __W_MINMAX_H
32 
33 #include "w_defines.h"
34 
35 /* -- do not edit anything above this line -- </std-header>*/
36 
37 #if !defined(GNUG_BUG_14)
38 
39 // WARNING: due to a gcc 2.6.* bug, do not used these
40 // since there is no way to explicitly instantiate
41 // function templates.
42 
43 template <class T>
44 inline const T
45 max(const T x, const T y)
46 {
47  return x > y ? x : y;
48 }
49 
50 template <class T>
51 inline const T
52 min(const T x, const T y)
53 {
54  return x < y ? x : y;
55 }
56 #endif /* !__GNUC__ */
57 
58 #ifdef HAVE_SYS_PARAM_H
59 
60 #include <sys/param.h>
61 
62 #endif
63 
64 #ifndef MAX
65 #define MAX(x, y) ((x) > (y) ? (x) : (y))
66 #endif /*MAX*/
67 
68 #ifndef MIN
69 #define MIN(x, y) ((x) < (y) ? (x) : (y))
70 #endif /*MIN*/
71 
72 /*<std-footer incl-file-exclusion='W_MINMAX_H'> -- do not edit anything below this line -- */
73 
74 #endif // __W_MINMAX_H /*</std-footer>*/
const T max(const T x, const T y)
Definition: w_minmax.h:45
const T min(const T x, const T y)
Definition: w_minmax.h:52
#define T
Definition: w_okvl_inl.h:45