1 |
/* MIN, MAX macros. |
/* MIN, MAX macros. |
2 |
Copyright (C) 1995, 1998, 2001, 2003 Free Software Foundation, Inc. |
Copyright (C) 1995, 1998, 2001, 2003, 2005 Free Software Foundation, Inc. |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
13 |
|
|
14 |
You should have received a copy of the GNU General Public License |
You should have received a copy of the GNU General Public License |
15 |
along with this program; if not, write to the Free Software Foundation, |
along with this program; if not, write to the Free Software Foundation, |
16 |
Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ |
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ |
17 |
|
|
18 |
#ifndef _MINMAX_H |
#ifndef _MINMAX_H |
19 |
#define _MINMAX_H |
#define _MINMAX_H |
24 |
#include this file as the last one among the #include list. */ |
#include this file as the last one among the #include list. */ |
25 |
|
|
26 |
/* Before we define the following symbols we get the <limits.h> file |
/* Before we define the following symbols we get the <limits.h> file |
27 |
since otherwise we get redefinitions on some systems. */ |
since otherwise we get redefinitions on some systems if <limits.h> is |
28 |
#include <limits.h> |
included after this file. Likewise for <sys/param.h>. |
29 |
|
If more than one of these system headers define MIN and MAX, pick just |
30 |
|
one of the headers (because the definitions most likely are the same). */ |
31 |
|
#if HAVE_MINMAX_IN_LIMITS_H |
32 |
|
# include <limits.h> |
33 |
|
#elif HAVE_MINMAX_IN_SYS_PARAM_H |
34 |
|
# include <sys/param.h> |
35 |
|
#endif |
36 |
|
|
37 |
/* Note: MIN and MAX should be used with two arguments of the |
/* Note: MIN and MAX should be used with two arguments of the |
38 |
same type. They might not return the minimum and maximum of their two |
same type. They might not return the minimum and maximum of their two |