0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 9.0.1381: ACCESS_ names have a conflict with on some systems

Problem:    ACCESS_ names have a conflict with on some systems.
Solution:   Rename by prepending VIM_. (Ola Söder, closes #12105)
This commit is contained in:
=?UTF-8?q?Ola=20S=C3=B6der?=
2023-03-05 13:12:32 +00:00
committed by Bram Moolenaar
parent 5fb78c3fa5
commit d8742476d1
5 changed files with 11 additions and 9 deletions

View File

@@ -1576,11 +1576,11 @@ get_lval(
{ {
switch (om->ocm_access) switch (om->ocm_access)
{ {
case ACCESS_PRIVATE: case VIM_ACCESS_PRIVATE:
semsg(_(e_cannot_access_private_member_str), semsg(_(e_cannot_access_private_member_str),
om->ocm_name); om->ocm_name);
return NULL; return NULL;
case ACCESS_READ: case VIM_ACCESS_READ:
if ((flags & GLV_READ_ONLY) == 0) if ((flags & GLV_READ_ONLY) == 0)
{ {
semsg(_(e_member_is_not_writable_str), semsg(_(e_member_is_not_writable_str),
@@ -1588,7 +1588,7 @@ get_lval(
return NULL; return NULL;
} }
break; break;
case ACCESS_ALL: case VIM_ACCESS_ALL:
break; break;
} }

View File

@@ -3830,7 +3830,7 @@ vim_rename(char_u *from, char_u *to)
* original file will be somewhere else so the backup isn't really * original file will be somewhere else so the backup isn't really
* important. If autoscripting is off the rename may fail. * 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 #endif
mch_remove(to); mch_remove(to);
#ifdef AMIGA #ifdef AMIGA

View File

@@ -1469,9 +1469,9 @@ typedef struct {
#define TTFLAG_SUPER 0x40 // object from "super". #define TTFLAG_SUPER 0x40 // object from "super".
typedef enum { typedef enum {
ACCESS_PRIVATE, // read/write only inside th class VIM_ACCESS_PRIVATE, // read/write only inside th class
ACCESS_READ, // read everywhere, write only inside th class VIM_ACCESS_READ, // read everywhere, write only inside th class
ACCESS_ALL // read/write everywhere VIM_ACCESS_ALL // read/write everywhere
} omacc_T; } omacc_T;
/* /*

View File

@@ -695,6 +695,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1381,
/**/ /**/
1380, 1380,
/**/ /**/

View File

@@ -148,8 +148,8 @@ add_member(
return FAIL; return FAIL;
ocmember_T *m = ((ocmember_T *)gap->ga_data) + gap->ga_len; ocmember_T *m = ((ocmember_T *)gap->ga_data) + gap->ga_len;
m->ocm_name = vim_strnsave(varname, varname_end - varname); m->ocm_name = vim_strnsave(varname, varname_end - varname);
m->ocm_access = has_public ? ACCESS_ALL m->ocm_access = has_public ? VIM_ACCESS_ALL
: *varname == '_' ? ACCESS_PRIVATE : ACCESS_READ; : *varname == '_' ? VIM_ACCESS_PRIVATE : VIM_ACCESS_READ;
m->ocm_type = type; m->ocm_type = type;
if (init_expr != NULL) if (init_expr != NULL)
m->ocm_init = init_expr; m->ocm_init = init_expr;