aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Reed <m.reed@mykolab.com>2015-08-25 21:10:17 -0400
committerMichael Reed <m.reed@mykolab.com>2015-08-25 21:31:12 -0400
commit2b39453912c0110eeae6acfbc67cae68c0a9cf73 (patch)
tree0505523a0a67ef9e88178363edbe99a3322fa93e
parent7c135b8ccb5dba0f3ad3e2767fe4d3592345f23f (diff)
downloadrneovim-2b39453912c0110eeae6acfbc67cae68c0a9cf73.tar.gz
rneovim-2b39453912c0110eeae6acfbc67cae68c0a9cf73.tar.bz2
rneovim-2b39453912c0110eeae6acfbc67cae68c0a9cf73.zip
Move MAX and MIN macros to macros.h
vim.h is too big, and these were missing parens around the arguments. These may already be defined in <sys/param.h> or <windef.h>, so guard them with an #ifndef. extracted from #810
-rw-r--r--src/nvim/macros.h7
-rw-r--r--src/nvim/vim.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/nvim/macros.h b/src/nvim/macros.h
index bbbce7ab58..d42997650c 100644
--- a/src/nvim/macros.h
+++ b/src/nvim/macros.h
@@ -12,6 +12,13 @@
* macros.h: macro definitions for often used code
*/
+#ifndef MIN
+# define MIN(X, Y) ((X) < (Y) ? (X) : (Y))
+#endif
+#ifndef MAX
+# define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
+#endif
+
/*
* Position comparisons
*/
diff --git a/src/nvim/vim.h b/src/nvim/vim.h
index 9fbc6dd300..48d53369de 100644
--- a/src/nvim/vim.h
+++ b/src/nvim/vim.h
@@ -8,9 +8,6 @@
#ifndef NVIM_VIM_H
#define NVIM_VIM_H
-#define MIN(X, Y) (X < Y ? X : Y)
-#define MAX(X, Y) (X > Y ? X : Y)
-
#include "nvim/types.h"
#include "nvim/pos.h" // for linenr_T, MAXCOL, etc...