Skip to content

Commit

Permalink
patch 9.0.1381: ACCESS_ names have a conflict with on some systems
Browse files Browse the repository at this point in the history
Problem:    ACCESS_ names have a conflict with on some systems.
Solution:   Rename by prepending VIM_. (Ola Söder, closes #12105)
  • Loading branch information
sodero authored and brammool committed Mar 5, 2023
1 parent 5fb78c3 commit d874247
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/eval.c
Expand Up @@ -1576,19 +1576,19 @@ get_lval(
{
switch (om->ocm_access)
{
case ACCESS_PRIVATE:
case VIM_ACCESS_PRIVATE:
semsg(_(e_cannot_access_private_member_str),
om->ocm_name);
return NULL;
case ACCESS_READ:
case VIM_ACCESS_READ:
if ((flags & GLV_READ_ONLY) == 0)
{
semsg(_(e_member_is_not_writable_str),
om->ocm_name);
return NULL;
}
break;
case ACCESS_ALL:
case VIM_ACCESS_ALL:
break;
}

Expand Down
2 changes: 1 addition & 1 deletion src/fileio.c
Expand Up @@ -3830,7 +3830,7 @@ vim_rename(char_u *from, char_u *to)
* original file will be somewhere else so the backup isn't really
* important. If autoscripting is off the rename may fail.
*/
flock = Lock((UBYTE *)from, (long)ACCESS_READ);
flock = Lock((UBYTE *)from, (long)VIM_ACCESS_READ);
#endif
mch_remove(to);
#ifdef AMIGA
Expand Down
6 changes: 3 additions & 3 deletions src/structs.h
Expand Up @@ -1469,9 +1469,9 @@ typedef struct {
#define TTFLAG_SUPER 0x40 // object from "super".

typedef enum {
ACCESS_PRIVATE, // read/write only inside th class
ACCESS_READ, // read everywhere, write only inside th class
ACCESS_ALL // read/write everywhere
VIM_ACCESS_PRIVATE, // read/write only inside th class
VIM_ACCESS_READ, // read everywhere, write only inside th class
VIM_ACCESS_ALL // read/write everywhere
} omacc_T;

/*
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -695,6 +695,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1381,
/**/
1380,
/**/
Expand Down
4 changes: 2 additions & 2 deletions src/vim9class.c
Expand Up @@ -148,8 +148,8 @@ add_member(
return FAIL;
ocmember_T *m = ((ocmember_T *)gap->ga_data) + gap->ga_len;
m->ocm_name = vim_strnsave(varname, varname_end - varname);
m->ocm_access = has_public ? ACCESS_ALL
: *varname == '_' ? ACCESS_PRIVATE : ACCESS_READ;
m->ocm_access = has_public ? VIM_ACCESS_ALL
: *varname == '_' ? VIM_ACCESS_PRIVATE : VIM_ACCESS_READ;
m->ocm_type = type;
if (init_expr != NULL)
m->ocm_init = init_expr;
Expand Down

0 comments on commit d874247

Please sign in to comment.