aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/macros.h
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 /src/nvim/macros.h
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
Diffstat (limited to 'src/nvim/macros.h')
-rw-r--r--src/nvim/macros.h7
1 files changed, 7 insertions, 0 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
*/