Skip to content

Commit 43b8793

Browse files
Wei Tangchrisbra
authored andcommitted
patch 9.1.2022: using C++ keyword class as member variable name
Problem: A recent commit introduced a member variable named `class` in the `exarg` structure, which conflicts with the C++ keyword `class`. This causes compilation issues on Windows when VIM is compiled with OLE enabled, as "if_ole.cpp" cannot compile due to the keyword conflict (after v9.1.2012). Solution: Rename the member variable of `exarg` from `class` to `ea_class`. (Wei Tang) related: #18949 closes: #19016 Signed-off-by: Wei Tang <gauchyler@uestc.edu.cn> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 538da34 commit 43b8793

4 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/eval.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ fill_evalarg_from_eap(evalarg_T *evalarg, exarg_T *eap, int skip)
131131
evalarg->eval_getline = eap->ea_getline;
132132
evalarg->eval_cookie = eap->cookie;
133133
}
134-
evalarg->eval_class = eap->class;
134+
evalarg->eval_class = eap->ea_class;
135135
}
136136

137137
/*

src/ex_cmds.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1973,7 +1973,7 @@ struct exarg
19731973
void *cookie; // argument for getline()
19741974
#ifdef FEAT_EVAL
19751975
cstack_T *cstack; // condition stack for ":if" etc.
1976-
class_T *class; // Name of class being defined. Used by :class
1976+
class_T *ea_class; // Name of class being defined. Used by :class
19771977
// and :enum commands.
19781978
#endif
19791979
};

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
2022,
737739
/**/
738740
2021,
739741
/**/

src/vim9class.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2122,7 +2122,7 @@ ex_class(exarg_T *eap)
21222122
cl->class_object_type.tt_type = VAR_OBJECT;
21232123
cl->class_object_type.tt_class = cl;
21242124

2125-
eap->class = cl;
2125+
eap->ea_class = cl;
21262126

21272127
// Add the class to the script-local variables.
21282128
// TODO: handle other context, e.g. in a function

0 commit comments

Comments
 (0)