From bac86a194117008656d02951de6d303ab8687eec Mon Sep 17 00:00:00 2001 From: George Zhao Date: Wed, 17 Jan 2018 19:36:59 +0800 Subject: [PATCH] Fix warning when redefine RGB on Windows 1 --- src/nvim/macros.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/nvim/macros.h b/src/nvim/macros.h index 26d4f74b6a..0bec9af733 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -148,6 +148,11 @@ /// zero in those cases (-Wdiv-by-zero in GCC). #define ARRAY_SIZE(arr) ((sizeof(arr)/sizeof((arr)[0])) / ((size_t)(!(sizeof(arr) % sizeof((arr)[0]))))) +// Windows defines a RGB macro that produces 0x00bbggrr color values for use +// with GDI. Our macro is different, and we don't use GDI. +#if defined(WIN32) && defined(RGB) +# undef RGB +#endif #define RGB(r, g, b) ((r << 16) | (g << 8) | b) #define STR_(x) #x