1
0
forked from aniani/vim

patch 8.1.0984: unnecessary #ifdefs

Problem:    Unnecessary #ifdefs.
Solution:   Remove the #ifdefs. (Ken Takata)
This commit is contained in:
Bram Moolenaar
2019-02-27 14:12:01 +01:00
parent 1eed532999
commit c69efcb42f
2 changed files with 4 additions and 22 deletions

View File

@@ -779,6 +779,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 */
/**/
984,
/**/ /**/
983, 983,
/**/ /**/

View File

@@ -22,7 +22,6 @@
* posix environment. * posix environment.
*/ */
#ifdef FEAT_CYGWIN_WIN32_CLIPBOARD #ifdef FEAT_CYGWIN_WIN32_CLIPBOARD
# define MSWIN
# define WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN
# include <windows.h> # include <windows.h>
# include "winclip.pro" # include "winclip.pro"
@@ -299,9 +298,7 @@ clip_mch_request_selection(VimClipboard *cbd)
VimClipType_t metadata = { -1, -1, -1, -1 }; VimClipType_t metadata = { -1, -1, -1, -1 };
HGLOBAL hMem = NULL; HGLOBAL hMem = NULL;
char_u *str = NULL; char_u *str = NULL;
#if defined(MSWIN)
char_u *to_free = NULL; char_u *to_free = NULL;
#endif
HGLOBAL rawh = NULL; HGLOBAL rawh = NULL;
int str_size = 0; int str_size = 0;
int maxlen; int maxlen;
@@ -361,7 +358,6 @@ clip_mch_request_selection(VimClipboard *cbd)
} }
if (str == NULL) if (str == NULL)
{ {
#if defined(MSWIN)
/* Try to get the clipboard in Unicode if it's not an empty string. */ /* Try to get the clipboard in Unicode if it's not an empty string. */
if (IsClipboardFormatAvailable(CF_UNICODETEXT) && metadata.ucslen != 0) if (IsClipboardFormatAvailable(CF_UNICODETEXT) && metadata.ucslen != 0)
{ {
@@ -391,10 +387,8 @@ clip_mch_request_selection(VimClipboard *cbd)
GlobalUnlock(hMemW); GlobalUnlock(hMemW);
} }
} }
else
#endif
/* Get the clipboard in the Active codepage. */ /* Get the clipboard in the Active codepage. */
if (IsClipboardFormatAvailable(CF_TEXT)) else if (IsClipboardFormatAvailable(CF_TEXT))
{ {
if ((hMem = GetClipboardData(CF_TEXT)) != NULL) if ((hMem = GetClipboardData(CF_TEXT)) != NULL)
{ {
@@ -417,7 +411,6 @@ clip_mch_request_selection(VimClipboard *cbd)
break; break;
} }
#if defined(MSWIN)
/* The text is in the active codepage. Convert to /* The text is in the active codepage. Convert to
* 'encoding', going through UTF-16. */ * 'encoding', going through UTF-16. */
acp_to_enc(str, str_size, &to_free, &maxlen); acp_to_enc(str, str_size, &to_free, &maxlen);
@@ -426,7 +419,6 @@ clip_mch_request_selection(VimClipboard *cbd)
str_size = maxlen; str_size = maxlen;
str = to_free; str = to_free;
} }
#endif
} }
} }
} }
@@ -454,9 +446,7 @@ clip_mch_request_selection(VimClipboard *cbd)
if (rawh != NULL) if (rawh != NULL)
GlobalUnlock(rawh); GlobalUnlock(rawh);
CloseClipboard(); CloseClipboard();
#if defined(MSWIN)
vim_free(to_free); vim_free(to_free);
#endif
} }
/* /*
@@ -471,9 +461,7 @@ clip_mch_set_selection(VimClipboard *cbd)
HGLOBAL hMemRaw = NULL; HGLOBAL hMemRaw = NULL;
HGLOBAL hMem = NULL; HGLOBAL hMem = NULL;
HGLOBAL hMemVim = NULL; HGLOBAL hMemVim = NULL;
# if defined(MSWIN)
HGLOBAL hMemW = NULL; HGLOBAL hMemW = NULL;
# endif
/* If the '*' register isn't already filled in, fill it in now */ /* If the '*' register isn't already filled in, fill it in now */
cbd->owned = TRUE; cbd->owned = TRUE;
@@ -508,7 +496,6 @@ clip_mch_set_selection(VimClipboard *cbd)
metadata.rawlen = 0; metadata.rawlen = 0;
} }
# if defined(MSWIN)
{ {
WCHAR *out; WCHAR *out;
int len = metadata.txtlen; int len = metadata.txtlen;
@@ -550,7 +537,6 @@ clip_mch_set_selection(VimClipboard *cbd)
metadata.ucslen = len; metadata.ucslen = len;
} }
} }
# endif
/* Allocate memory for the text, add one NUL byte to terminate the string. /* Allocate memory for the text, add one NUL byte to terminate the string.
*/ */
@@ -590,13 +576,11 @@ clip_mch_set_selection(VimClipboard *cbd)
{ {
SetClipboardData(cbd->format, hMemVim); SetClipboardData(cbd->format, hMemVim);
hMemVim = 0; hMemVim = 0;
# if defined(MSWIN)
if (hMemW != NULL) if (hMemW != NULL)
{ {
if (SetClipboardData(CF_UNICODETEXT, hMemW) != NULL) if (SetClipboardData(CF_UNICODETEXT, hMemW) != NULL)
hMemW = NULL; hMemW = NULL;
} }
# endif
/* Always use CF_TEXT. On Win98 Notepad won't obtain the /* Always use CF_TEXT. On Win98 Notepad won't obtain the
* CF_UNICODETEXT text, only CF_TEXT. */ * CF_UNICODETEXT text, only CF_TEXT. */
SetClipboardData(CF_TEXT, hMem); SetClipboardData(CF_TEXT, hMem);
@@ -611,10 +595,8 @@ clip_mch_set_selection(VimClipboard *cbd)
GlobalFree(hMemRaw); GlobalFree(hMemRaw);
if (hMem) if (hMem)
GlobalFree(hMem); GlobalFree(hMem);
# if defined(MSWIN)
if (hMemW) if (hMemW)
GlobalFree(hMemW); GlobalFree(hMemW);
# endif
if (hMemVim) if (hMemVim)
GlobalFree(hMemVim); GlobalFree(hMemVim);
} }
@@ -746,7 +728,6 @@ utf16_to_enc(short_u *str, int *lenp)
return enc_str; return enc_str;
} }
#if defined(MSWIN) || defined(PROTO)
/* /*
* Convert from the active codepage to 'encoding'. * Convert from the active codepage to 'encoding'.
* Input is "str[str_size]". * Input is "str[str_size]".
@@ -796,4 +777,3 @@ enc_to_acp(
vim_free(widestr); vim_free(widestr);
} }
} }
#endif