]> code.delx.au - gnu-emacs/commitdiff
[ChangeLog]
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Feb 2011 23:22:34 +0000 (15:22 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 21 Feb 2011 23:22:34 +0000 (15:22 -0800)
* lib/min-max.h: New file, for "min" and "max".
[lib-src/ChangeLog]
New file "lib/min-max.h".
* ebrowse.c (min, max): Define them by including <min-max.h>
instead of defining it ourselves.
* pop.c (min): Likewise.

ChangeLog
lib-src/ChangeLog
lib-src/ebrowse.c
lib-src/pop.c
lib/min-max.h [new file with mode: 0644]

index db173ddd9a17b70e3956e2f85fd5ba71e7c40a42..ef876b6e831c05e8e483da479764439f8c34a4fa 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2011-02-21  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lib/min-max.h: New file, for "min" and "max".
+
 2011-02-20  Paul Eggert  <eggert@cs.ucla.edu>
 
        Import filemode module from gnulib.
index c598164c5758a26402aef6446c390df4a103c90a..81c6e6fe9b4cc39b35e3dd57b13a0cd6d7a006ed 100644 (file)
@@ -1,5 +1,10 @@
 2011-02-21  Paul Eggert  <eggert@cs.ucla.edu>
 
+       New file "lib/min-max.h".
+       * ebrowse.c (min, max): Define them by including <min-max.h>
+       instead of defining it ourselves.
+       * pop.c (min): Likewise.
+
        * movemail.c (popmail): Report fchown failure instead of ignoring it.
        But if the file already has the right ownership, don't worry about it.
 
index 2cb656ae53a76c84473d955fb7d2b1125d502f30..f2894d5a0c21d5932446321f16690b74047c26b9 100644 (file)
@@ -41,12 +41,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #define streq(X, Y) (*(X) == *(Y) && strcmp ((X) + 1, (Y) + 1) == 0)
 
-/* The ubiquitous `max' and `min' macros.  */
-
-#ifndef max
-#define max(X, Y)      ((X) > (Y) ? (X) : (Y))
-#define min(X, Y)      ((X) < (Y) ? (X) : (Y))
-#endif
+#include <min-max.h>
 
 /* Files are read in chunks of this number of bytes.  */
 
index 159926e97b036b4936ad218fdf0a15d05a86ede1..426b39bd1fb4c34aef01161b16317ada6a9a37df 100644 (file)
@@ -90,6 +90,8 @@ extern struct servent *hes_getservbyname (/* char *, char * */);
 # endif
 #endif /* KERBEROS */
 
+#include <min-max.h>
+
 #ifdef KERBEROS
 #ifndef KERBEROS5
 extern int krb_sendauth (/* long, int, KTEXT, char *, char *, char *,
@@ -130,10 +132,6 @@ static char *find_crlf (char *, int);
 char pop_error[ERROR_MAX];
 int pop_debug = 0;
 
-#ifndef min
-#define min(a,b) (((a) < (b)) ? (a) : (b))
-#endif
-
 /*
  * Function: pop_open (char *host, char *username, char *password,
  *                    int flags)
diff --git a/lib/min-max.h b/lib/min-max.h
new file mode 100644 (file)
index 0000000..997cdd1
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef min
+# define min(a,b) ((a) < (b) ? (a) : (b))
+#endif
+#ifndef max
+# define max(a,b) ((a) > (b) ? (a) : (b))
+#endif