patch 9.0.2180: POSIX function name in exarg causes issues

Problem:  POSIX function name in exarg struct causes issues
          on OpenVMS
Solution: Rename getline member in exarg struct to ea_getline,
          remove isinf() workaround for VMS

There are compilers that do not treat well POSIX functions - like
getline - usage in the structs.

Older VMS compilers could digest this... but the newer OpenVMS compilers
( like VSI C x86-64 X7.4-843 (GEM 50XB9) ) cannot deal with these
structs. This could be limited to getline() that is defined via
getdelim() and might not affect all POSIX functions in general - but
avoiding POSIX function names usage in the structs is a "safe side"
practice without compromising the functionality or the code readability.

The previous OpenVMS X86 port used a workaround limiting the compiler
capabilities using __CRTL_VER_OVERRIDE=80400000
In order to make the OpenVMS port future proof, this pull request
proposes a possible solution.

closes: #13704

Signed-off-by: Zoltan Arpadffy <zoltan.arpadffy@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/Make_vms.mms b/src/Make_vms.mms
index 4c20601..85b825e 100644
--- a/src/Make_vms.mms
+++ b/src/Make_vms.mms
@@ -112,8 +112,8 @@
 CC_DEF  = cc
 PREFIX  = /prefix=all/name=(upper,short)
 OPTIMIZE= /opt
-.IFDEF MMSX86_64 # This is needed because of getline function name used in stucts like ex_cmds.h  
-ARCH_DEF= ,__CRTL_VER_OVERRIDE=80400000
+.IFDEF MMSX86_64
+ARCH_DEF=        # ,__CRTL_VER_OVERRIDE=80400000 
 .ENDIF
 .ENDIF
 
diff --git a/src/digraph.c b/src/digraph.c
index 0a4a4a3..f19e58e 100644
--- a/src/digraph.c
+++ b/src/digraph.c
@@ -2315,7 +2315,7 @@
      */
     for (;;)
     {
-	line = eap->getline(0, eap->cookie, 0, TRUE);
+	line = eap->ea_getline(0, eap->cookie, 0, TRUE);
 	if (line == NULL)
 	    break;
 
diff --git a/src/eval.c b/src/eval.c
index 877a20f..6f88e03 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -133,9 +133,9 @@
 	return;
 
     evalarg->eval_cstack = eap->cstack;
-    if (sourcing_a_script(eap) || eap->getline == get_list_line)
+    if (sourcing_a_script(eap) || eap->ea_getline == get_list_line)
     {
-	evalarg->eval_getline = eap->getline;
+	evalarg->eval_getline = eap->ea_getline;
 	evalarg->eval_cookie = eap->cookie;
     }
 }
@@ -7542,7 +7542,7 @@
 	    sticky_cmdmod_flags = cmdmod.cmod_flags
 						& (CMOD_LEGACY | CMOD_VIM9CMD);
 	    do_cmdline((char_u *)ga.ga_data,
-		       eap->getline, eap->cookie, DOCMD_NOWAIT|DOCMD_VERBOSE);
+		       eap->ea_getline, eap->cookie, DOCMD_NOWAIT|DOCMD_VERBOSE);
 	    sticky_cmdmod_flags = save_sticky_cmdmod_flags;
 	}
     }
diff --git a/src/evalvars.c b/src/evalvars.c
index f787e81..64455f0 100644
--- a/src/evalvars.c
+++ b/src/evalvars.c
@@ -776,7 +776,7 @@
     cctx_T	*cctx = vim9compile ? eap->cookie : NULL;
     int		count = 0;
 
-    if (eap->getline == NULL)
+    if (eap->ea_getline == NULL)
     {
 	emsg(_(e_cannot_use_heredoc_here));
 	return NULL;
@@ -856,7 +856,7 @@
 	int	ti = 0;
 
 	vim_free(theline);
-	theline = eap->getline(NUL, eap->cookie, 0, FALSE);
+	theline = eap->ea_getline(NUL, eap->cookie, 0, FALSE);
 	if (theline == NULL)
 	{
 	    semsg(_(e_missing_end_marker_str), marker);
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index e311fa8..d214933 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -3347,7 +3347,7 @@
 		indent = get_indent_lnum(lnum);
 	}
 	ex_keep_indent = FALSE;
-	if (eap->getline == NULL)
+	if (eap->ea_getline == NULL)
 	{
 	    // No getline() function, use the lines that follow. This ends
 	    // when there is no more.
@@ -3368,7 +3368,7 @@
 	    // Set State to avoid the cursor shape to be set to MODE_INSERT
 	    // state when getline() returns.
 	    State = MODE_CMDLINE;
-	    theline = eap->getline(
+	    theline = eap->ea_getline(
 #ifdef FEAT_EVAL
 		    eap->cstack->cs_looplevel > 0 ? -1 :
 #endif
diff --git a/src/ex_cmds.h b/src/ex_cmds.h
index af13510..4ae6cc2 100644
--- a/src/ex_cmds.h
+++ b/src/ex_cmds.h
@@ -1950,7 +1950,7 @@
     int		bad_char;	// BAD_KEEP, BAD_DROP or replacement byte
     int		useridx;	// user command index
     char	*errmsg;	// returned error message
-    char_u	*(*getline)(int, void *, int, getline_opt_T);
+    char_u	*(*ea_getline)(int, void *, int, getline_opt_T);
     void	*cookie;	// argument for getline()
 #ifdef FEAT_EVAL
     cstack_T	*cstack;	// condition stack for ":if" etc.
diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c
index 45ccb52..0bde730 100644
--- a/src/ex_cmds2.c
+++ b/src/ex_cmds2.c
@@ -610,7 +610,7 @@
 	    ++i;
 
 	    // execute the command
-	    do_cmdline(eap->arg, eap->getline, eap->cookie,
+	    do_cmdline(eap->arg, eap->ea_getline, eap->cookie,
 						DOCMD_VERBOSE + DOCMD_NOWAIT);
 
 	    if (eap->cmdidx == CMD_bufdo)
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 01d411a..534cd7e 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -400,7 +400,7 @@
     int		current_line;		// last read line from growarray
     int		repeating;		// TRUE when looping a second time
     // When "repeating" is FALSE use "getline" and "cookie" to get lines
-    char_u	*(*getline)(int, void *, int, getline_opt_T);
+    char_u	*(*lc_getline)(int, void *, int, getline_opt_T);
     void	*cookie;
 };
 
@@ -940,7 +940,7 @@
 	    cmd_cookie = (void *)&cmd_loop_cookie;
 	    cmd_loop_cookie.lines_gap = &lines_ga;
 	    cmd_loop_cookie.current_line = current_line;
-	    cmd_loop_cookie.getline = fgetline;
+	    cmd_loop_cookie.lc_getline = fgetline;
 	    cmd_loop_cookie.cookie = cookie;
 	    cmd_loop_cookie.repeating = (current_line < lines_ga.ga_len);
 
@@ -1468,10 +1468,10 @@
 	    return NULL;	// trying to read past ":endwhile"/":endfor"
 
 	// First time inside the ":while"/":for": get line normally.
-	if (cp->getline == NULL)
+	if (cp->lc_getline == NULL)
 	    line = getcmdline(c, 0L, indent, 0);
 	else
-	    line = cp->getline(c, cp->cookie, indent, options);
+	    line = cp->lc_getline(c, cp->cookie, indent, options);
 	if (line != NULL && store_loop_line(cp->lines_gap, line) == OK)
 	    ++cp->current_line;
 
@@ -1534,7 +1534,7 @@
     cp = (struct loop_cookie *)cookie;
     while (gp == get_loop_line)
     {
-	gp = cp->getline;
+	gp = cp->lc_getline;
 	cp = cp->cookie;
     }
     return gp == func;
@@ -1563,7 +1563,7 @@
     cp = (struct loop_cookie *)cookie;
     while (gp == get_loop_line)
     {
-	gp = cp->getline;
+	gp = cp->lc_getline;
 	cp = cp->cookie;
     }
     return cp;
@@ -1598,7 +1598,7 @@
 	    wp = (wcmd_T *)(cp->lines_gap->ga_data) + cp->current_line + 1;
 	    return wp->line;
 	}
-	gp = cp->getline;
+	gp = cp->lc_getline;
 	cp = cp->cookie;
     }
     if (gp == getsourceline)
@@ -1780,7 +1780,7 @@
     // The "ea" structure holds the arguments that can be used.
     ea.cmd = *cmdlinep;
     ea.cmdlinep = cmdlinep;
-    ea.getline = fgetline;
+    ea.ea_getline = fgetline;
     ea.cookie = cookie;
 #ifdef FEAT_EVAL
     ea.cstack = cstack;
@@ -2844,8 +2844,8 @@
 
 	// in ex mode, an empty command (after modifiers) works like :+
 	if (*eap->cmd == NUL && exmode_active
-		   && (getline_equal(eap->getline, eap->cookie, getexmodeline)
-		       || getline_equal(eap->getline, eap->cookie, getexline))
+		   && (getline_equal(eap->ea_getline, eap->cookie, getexmodeline)
+		       || getline_equal(eap->ea_getline, eap->cookie, getexline))
 			&& curwin->w_cursor.lnum < curbuf->b_ml.ml_line_count)
 	{
 	    use_plus_cmd = TRUE;
diff --git a/src/ex_getln.c b/src/ex_getln.c
index 52f4feb..f2a960e 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -4753,7 +4753,7 @@
     char_u	*s;
     garray_T	ga;
 
-    if (cmd[0] != '<' || cmd[1] != '<' || eap->getline == NULL)
+    if (cmd[0] != '<' || cmd[1] != '<' || eap->ea_getline == NULL)
 	return NULL;
     cmd += 2;
 
diff --git a/src/macros.h b/src/macros.h
index caacd3a..cc2d11f 100644
--- a/src/macros.h
+++ b/src/macros.h
@@ -278,10 +278,6 @@
      static inline int isnan(double x)
 	{ return x != x; }
 #   endif
-#   if defined(VMS) && defined(X86_64)
-     static inline int isinf(double x)
-        { return !isnan(x) && !finite(x); }
-#   endif
 #   ifndef HAVE_ISINF
      static inline int isinf(double x)
 	{ return !isnan(x) && isnan(x - x); }
diff --git a/src/pty.c b/src/pty.c
index 56238a6..f11a22d 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -357,7 +357,7 @@
 static char PtyProto[] = "/dev/ptym/ptyXY";
 static char TtyProto[] = "/dev/pty/ttyXY";
 # else
-#  ifdef(__HAIKU__)
+#  ifdef __HAIKU__
 static char PtyProto[] = "/dev/pt/XY";
 static char TtyProto[] = "/dev/tt/XY";
 #  else
diff --git a/src/scriptfile.c b/src/scriptfile.c
index 35582a8..69016bf 100644
--- a/src/scriptfile.c
+++ b/src/scriptfile.c
@@ -2469,7 +2469,7 @@
     int
 sourcing_a_script(exarg_T *eap)
 {
-    return (getline_equal(eap->getline, eap->cookie, getsourceline));
+    return (getline_equal(eap->ea_getline, eap->cookie, getsourceline));
 }
 
 /*
@@ -2497,7 +2497,7 @@
 	name = eap->arg;
 
     // Setup for conversion from the specified encoding to 'encoding'.
-    sp = (source_cookie_T *)getline_cookie(eap->getline, eap->cookie);
+    sp = (source_cookie_T *)getline_cookie(eap->ea_getline, eap->cookie);
     convert_setup(&sp->conv, name, p_enc);
 
     if (name != eap->arg)
@@ -2561,7 +2561,7 @@
     int		idx;
 
     if (reanimate)
-	((source_cookie_T *)getline_cookie(eap->getline,
+	((source_cookie_T *)getline_cookie(eap->ea_getline,
 					      eap->cookie))->finished = FALSE;
 
     // Cleanup (and inactivate) conditionals, but stop when a try conditional
@@ -2575,7 +2575,7 @@
 	report_make_pending(CSTP_FINISH, NULL);
     }
     else
-	((source_cookie_T *)getline_cookie(eap->getline,
+	((source_cookie_T *)getline_cookie(eap->ea_getline,
 					       eap->cookie))->finished = TRUE;
 }
 
diff --git a/src/usercmd.c b/src/usercmd.c
index 3191257..04b3419 100644
--- a/src/usercmd.c
+++ b/src/usercmd.c
@@ -1110,7 +1110,7 @@
     char_u *retp = p;
 
     if (*p == '{' && ends_excmd2(eap->arg, skipwhite(p + 1))
-						       && eap->getline != NULL)
+						    && eap->ea_getline != NULL)
     {
 	garray_T    ga;
 	char_u	    *line = NULL;
@@ -1127,7 +1127,7 @@
 	    for (;;)
 	    {
 		vim_free(line);
-		if ((line = eap->getline(':', eap->cookie,
+		if ((line = eap->ea_getline(':', eap->cookie,
 					   0, GETLINE_CONCAT_CONTBAR)) == NULL)
 		{
 		    emsg(_(e_missing_rcurly));
@@ -1955,7 +1955,7 @@
 #endif
     }
 
-    (void)do_cmdline(buf, eap->getline, eap->cookie,
+    (void)do_cmdline(buf, eap->ea_getline, eap->cookie,
 				   DOCMD_VERBOSE|DOCMD_NOWAIT|DOCMD_KEYTYPED);
 
     // Careful: Do not use "cmd" here, it may have become invalid if a user
diff --git a/src/userfunc.c b/src/userfunc.c
index 1580a37..ea03e78 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -198,10 +198,10 @@
 {
     char_u *theline;
 
-    if (eap->getline == NULL)
+    if (eap->ea_getline == NULL)
 	theline = getcmdline(':', 0L, indent, 0);
     else
-	theline = eap->getline(':', eap->cookie, indent, getline_options);
+	theline = eap->ea_getline(':', eap->cookie, indent, getline_options);
     if (theline != NULL)
     {
 	if (lines_to_free->ga_len > 0
@@ -264,7 +264,7 @@
     p = arg;
     while (*p != endchar)
     {
-	while (eap != NULL && eap->getline != NULL
+	while (eap != NULL && eap->ea_getline != NULL
 			 && (*p == NUL || (VIM_ISWHITE(*whitep) && *p == '#')))
 	{
 	    // End of the line, get the next one.
@@ -889,7 +889,7 @@
 
     // Detect having skipped over comment lines to find the return
     // type.  Add NULL lines to keep the line count correct.
-    sourcing_lnum_off = get_sourced_lnum(eap->getline, eap->cookie);
+    sourcing_lnum_off = get_sourced_lnum(eap->ea_getline, eap->cookie);
     if (SOURCING_LNUM < sourcing_lnum_off)
     {
 	sourcing_lnum_off -= SOURCING_LNUM;
@@ -952,7 +952,7 @@
 	}
 
 	// Detect line continuation: SOURCING_LNUM increased more than one.
-	sourcing_lnum_off = get_sourced_lnum(eap->getline, eap->cookie);
+	sourcing_lnum_off = get_sourced_lnum(eap->ea_getline, eap->cookie);
 	if (SOURCING_LNUM < sourcing_lnum_off)
 	    sourcing_lnum_off -= SOURCING_LNUM;
 	else
@@ -1349,7 +1349,7 @@
 	fill_exarg_from_cctx(&eap, evalarg->eval_cctx);
     else
     {
-	eap.getline = evalarg->eval_getline;
+	eap.ea_getline = evalarg->eval_getline;
 	eap.cookie = evalarg->eval_cookie;
     }
 
diff --git a/src/version.c b/src/version.c
index 89b224e..3f636c7 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2180,
+/**/
     2179,
 /**/
     2178,
diff --git a/src/vim9class.c b/src/vim9class.c
index a1f4aa2..ec1bb86 100644
--- a/src/vim9class.c
+++ b/src/vim9class.c
@@ -1369,7 +1369,7 @@
 
     if (!current_script_is_vim9()
 		|| (cmdmod.cmod_flags & CMOD_LEGACY)
-		|| !getline_equal(eap->getline, eap->cookie, getsourceline))
+		|| !getline_equal(eap->ea_getline, eap->cookie, getsourceline))
     {
 	if (is_class)
 	    emsg(_(e_class_can_only_be_defined_in_vim9_script));
@@ -1530,7 +1530,7 @@
     for (;;)
     {
 	vim_free(theline);
-	theline = eap->getline(':', eap->cookie, 0, GETLINE_CONCAT_ALL);
+	theline = eap->ea_getline(':', eap->cookie, 0, GETLINE_CONCAT_ALL);
 	if (theline == NULL)
 	    break;
 	char_u *line = skipwhite(theline);
@@ -1778,7 +1778,7 @@
 	    ea.cmd = line;
 	    ea.arg = p;
 	    ea.cmdidx = CMD_def;
-	    ea.getline = eap->getline;
+	    ea.ea_getline = eap->ea_getline;
 	    ea.cookie = eap->cookie;
 
 	    ga_init2(&lines_to_free, sizeof(char_u *), 50);
@@ -2177,7 +2177,7 @@
 
     if (!current_script_is_vim9()
 		|| (cmdmod.cmod_flags & CMOD_LEGACY)
-		|| !getline_equal(eap->getline, eap->cookie, getsourceline))
+		|| !getline_equal(eap->ea_getline, eap->cookie, getsourceline))
     {
 	emsg(_(e_type_can_only_be_defined_in_vim9_script));
 	return;
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 7bf2552..b896f43 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -971,7 +971,7 @@
     void
 fill_exarg_from_cctx(exarg_T *eap, cctx_T *cctx)
 {
-    eap->getline = exarg_getline;
+    eap->ea_getline = exarg_getline;
     eap->cookie = cctx;
     eap->skip = cctx->ctx_skip == SKIP_YES;
 }
@@ -2628,7 +2628,7 @@
 	list_T	   *l;
 
 	// [let] varname =<< [trim] {end}
-	eap->getline = exarg_getline;
+	eap->ea_getline = exarg_getline;
 	eap->cookie = cctx;
 	l = heredoc_get(eap, op + 3, FALSE, TRUE);
 	if (l == NULL)