diff src/vim.h @ 19025:90da7f8130ca v8.2.0073

patch 8.2.0073: initializing globals with COMMA is clumsy Commit: https://github.com/vim/vim/commit/ea8b7aecab9cc6d9c2d2845ad53203b26de14f85 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jan 1 15:46:47 2020 +0100 patch 8.2.0073: initializing globals with COMMA is clumsy Problem: Initializing globals with COMMA is clumsy. Solution: Use INIT2(), INIT3(), etc.
author Bram Moolenaar <Bram@vim.org>
date Wed, 01 Jan 2020 16:00:04 +0100
parents dd9ab0674eec
children ba9f50bfda83
line wrap: on
line diff
--- a/src/vim.h
+++ b/src/vim.h
@@ -1775,11 +1775,18 @@ void *vim_memset(void *, int, size_t);
 #ifndef EXTERN
 # define EXTERN extern
 # define INIT(x)
+# define INIT2(a, b)
+# define INIT3(a, b, c)
+# define INIT4(a, b, c, d)
+# define INIT5(a, b, c, d, e)
 #else
 # ifndef INIT
 #  define INIT(x) x
+#  define INIT2(a, b) = {a, b}
+#  define INIT3(a, b, c) = {a, b, c}
+#  define INIT4(a, b, c, d) = {a, b, c, d}
+#  define INIT5(a, b, c, d, e) = {a, b, c, d, e}
 #  define DO_INIT
-#  define COMMA ,
 # endif
 #endif