mirror of
https://github.com/neovim/neovim.git
synced 2025-09-20 10:18:18 +00:00
vim-patch:8.1.0941: macros for MS-Windows are inconsistent (#20215)
Problem: Macros for MS-Windows are inconsistent, using "32", "3264 and
others.
Solution: Use MSWIN for all MS-Windows builds. Use FEAT_GUI_MSWIN for the
GUI build. (Hirohito Higashi, closes vim/vim#3932)
4f97475d32
This commit is contained in:
@@ -190,7 +190,7 @@ const char *path_next_component(const char *fname)
|
||||
/// - 1 otherwise
|
||||
int path_head_length(void)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef MSWIN
|
||||
return 3;
|
||||
#else
|
||||
return 1;
|
||||
@@ -205,7 +205,7 @@ int path_head_length(void)
|
||||
/// - False otherwise
|
||||
bool is_path_head(const char_u *path)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef MSWIN
|
||||
return isalpha(path[0]) && path[1] == ':';
|
||||
#else
|
||||
return vim_ispathsep(*path);
|
||||
@@ -219,7 +219,7 @@ char *get_past_head(const char *path)
|
||||
{
|
||||
const char *retval = path;
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef MSWIN
|
||||
// May skip "c:"
|
||||
if (is_path_head((char_u *)path)) {
|
||||
retval = path + 2;
|
||||
@@ -642,7 +642,7 @@ static size_t do_path_expand(garray_T *gap, const char *path, size_t wildoff, in
|
||||
s = p + 1;
|
||||
} else if (path_end >= (char_u *)path + wildoff
|
||||
&& (vim_strchr("*?[{~$", *path_end) != NULL
|
||||
#ifndef WIN32
|
||||
#ifndef MSWIN
|
||||
|| (!p_fic && (flags & EW_ICASE) && mb_isalpha(utf_ptr2char((char *)path_end)))
|
||||
#endif
|
||||
)) {
|
||||
@@ -897,7 +897,7 @@ static char_u *get_path_cutoff(char_u *fname, garray_T *gap)
|
||||
int j = 0;
|
||||
|
||||
while ((fname[j] == path_part[i][j]
|
||||
#ifdef WIN32
|
||||
#ifdef MSWIN
|
||||
|| (vim_ispathsep(fname[j]) && vim_ispathsep(path_part[i][j]))
|
||||
#endif
|
||||
) // NOLINT(whitespace/parens)
|
||||
@@ -1816,7 +1816,7 @@ int vim_FullName(const char *fname, char *buf, size_t len, bool force)
|
||||
|
||||
if (strlen(fname) > (len - 1)) {
|
||||
xstrlcpy(buf, fname, len); // truncate
|
||||
#ifdef WIN32
|
||||
#ifdef MSWIN
|
||||
slash_adjust((char_u *)buf);
|
||||
#endif
|
||||
return FAIL;
|
||||
@@ -1831,7 +1831,7 @@ int vim_FullName(const char *fname, char *buf, size_t len, bool force)
|
||||
if (rv == FAIL) {
|
||||
xstrlcpy(buf, fname, len); // something failed; use the filename
|
||||
}
|
||||
#ifdef WIN32
|
||||
#ifdef MSWIN
|
||||
slash_adjust((char_u *)buf);
|
||||
#endif
|
||||
return rv;
|
||||
@@ -2356,7 +2356,7 @@ static int path_to_absolute(const char *fname, char *buf, size_t len, int force)
|
||||
// expand it if forced or not an absolute path
|
||||
if (force || !path_is_absolute((char_u *)fname)) {
|
||||
p = strrchr(fname, '/');
|
||||
#ifdef WIN32
|
||||
#ifdef MSWIN
|
||||
if (p == NULL) {
|
||||
p = strrchr(fname, '\\');
|
||||
}
|
||||
@@ -2392,7 +2392,7 @@ static int path_to_absolute(const char *fname, char *buf, size_t len, int force)
|
||||
/// @return `true` if "fname" is absolute.
|
||||
int path_is_absolute(const char_u *fname)
|
||||
{
|
||||
#ifdef WIN32
|
||||
#ifdef MSWIN
|
||||
if (*fname == NUL) {
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user