mirror of
https://github.com/neovim/neovim.git
synced 2025-09-13 06:48:17 +00:00
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
This commit is contained in:
@@ -12,6 +12,13 @@
|
|||||||
* macros.h: macro definitions for often used code
|
* 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
|
* Position comparisons
|
||||||
*/
|
*/
|
||||||
|
@@ -8,9 +8,6 @@
|
|||||||
#ifndef NVIM_VIM_H
|
#ifndef NVIM_VIM_H
|
||||||
#define 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/types.h"
|
||||||
#include "nvim/pos.h" // for linenr_T, MAXCOL, etc...
|
#include "nvim/pos.h" // for linenr_T, MAXCOL, etc...
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user