Mercurial > vim
changeset 15957:209f65bb155f v8.1.0984
patch 8.1.0984: unnecessary #ifdefs
commit https://github.com/vim/vim/commit/c69efcb42fd98d9fcd5f7e01e3b029b0b777df0f
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Feb 27 14:12:01 2019 +0100
patch 8.1.0984: unnecessary #ifdefs
Problem: Unnecessary #ifdefs.
Solution: Remove the #ifdefs. (Ken Takata)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Wed, 27 Feb 2019 14:15:11 +0100 |
parents | 1207fa46617e |
children | 5b3c0bb37ebc |
files | src/version.c src/winclip.c |
diffstat | 2 files changed, 4 insertions(+), 22 deletions(-) [+] |
line wrap: on
line diff
--- a/src/version.c +++ b/src/version.c @@ -780,6 +780,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 984, +/**/ 983, /**/ 982,
--- a/src/winclip.c +++ b/src/winclip.c @@ -22,7 +22,6 @@ * posix environment. */ #ifdef FEAT_CYGWIN_WIN32_CLIPBOARD -# define MSWIN # define WIN32_LEAN_AND_MEAN # include <windows.h> # include "winclip.pro" @@ -299,9 +298,7 @@ clip_mch_request_selection(VimClipboard VimClipType_t metadata = { -1, -1, -1, -1 }; HGLOBAL hMem = NULL; char_u *str = NULL; -#if defined(MSWIN) char_u *to_free = NULL; -#endif HGLOBAL rawh = NULL; int str_size = 0; int maxlen; @@ -361,7 +358,6 @@ clip_mch_request_selection(VimClipboard } if (str == NULL) { -#if defined(MSWIN) /* Try to get the clipboard in Unicode if it's not an empty string. */ if (IsClipboardFormatAvailable(CF_UNICODETEXT) && metadata.ucslen != 0) { @@ -391,10 +387,8 @@ clip_mch_request_selection(VimClipboard GlobalUnlock(hMemW); } } - else -#endif - /* Get the clipboard in the Active codepage. */ - if (IsClipboardFormatAvailable(CF_TEXT)) + /* Get the clipboard in the Active codepage. */ + else if (IsClipboardFormatAvailable(CF_TEXT)) { if ((hMem = GetClipboardData(CF_TEXT)) != NULL) { @@ -417,7 +411,6 @@ clip_mch_request_selection(VimClipboard break; } -#if defined(MSWIN) /* The text is in the active codepage. Convert to * 'encoding', going through UTF-16. */ acp_to_enc(str, str_size, &to_free, &maxlen); @@ -426,7 +419,6 @@ clip_mch_request_selection(VimClipboard str_size = maxlen; str = to_free; } -#endif } } } @@ -454,9 +446,7 @@ clip_mch_request_selection(VimClipboard if (rawh != NULL) GlobalUnlock(rawh); CloseClipboard(); -#if defined(MSWIN) vim_free(to_free); -#endif } /* @@ -471,9 +461,7 @@ clip_mch_set_selection(VimClipboard *cbd HGLOBAL hMemRaw = NULL; HGLOBAL hMem = NULL; HGLOBAL hMemVim = NULL; -# if defined(MSWIN) HGLOBAL hMemW = NULL; -# endif /* If the '*' register isn't already filled in, fill it in now */ cbd->owned = TRUE; @@ -508,7 +496,6 @@ clip_mch_set_selection(VimClipboard *cbd metadata.rawlen = 0; } -# if defined(MSWIN) { WCHAR *out; int len = metadata.txtlen; @@ -550,7 +537,6 @@ clip_mch_set_selection(VimClipboard *cbd metadata.ucslen = len; } } -# endif /* 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); hMemVim = 0; -# if defined(MSWIN) if (hMemW != NULL) { if (SetClipboardData(CF_UNICODETEXT, hMemW) != NULL) hMemW = NULL; } -# endif /* Always use CF_TEXT. On Win98 Notepad won't obtain the * CF_UNICODETEXT text, only CF_TEXT. */ SetClipboardData(CF_TEXT, hMem); @@ -611,10 +595,8 @@ clip_mch_set_selection(VimClipboard *cbd GlobalFree(hMemRaw); if (hMem) GlobalFree(hMem); -# if defined(MSWIN) if (hMemW) GlobalFree(hMemW); -# endif if (hMemVim) GlobalFree(hMemVim); } @@ -746,7 +728,6 @@ utf16_to_enc(short_u *str, int *lenp) return enc_str; } -#if defined(MSWIN) || defined(PROTO) /* * Convert from the active codepage to 'encoding'. * Input is "str[str_size]". @@ -796,4 +777,3 @@ enc_to_acp( vim_free(widestr); } } -#endif