From 2b39453912c0110eeae6acfbc67cae68c0a9cf73 Mon Sep 17 00:00:00 2001 From: Michael Reed Date: Tue, 25 Aug 2015 21:10:17 -0400 Subject: 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 or , so guard them with an #ifndef. extracted from #810 --- src/nvim/macros.h | 7 +++++++ src/nvim/vim.h | 3 --- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'src') 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... -- cgit