summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0984
blob: a84f25d50c6c0a9fe2f58c551f19402d119e5551 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0984
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0984
Problem:    Unnecessary #ifdefs.
Solution:   Remove the #ifdefs. (Ken Takata)
Files:	    src/winclip.c


*** ../vim-8.1.0983/src/winclip.c	2019-02-17 17:44:36.223875455 +0100
--- src/winclip.c	2019-02-27 14:09:35.870685717 +0100
***************
*** 22,28 ****
   * posix environment.
   */
  #ifdef FEAT_CYGWIN_WIN32_CLIPBOARD
- # define MSWIN
  # define WIN32_LEAN_AND_MEAN
  # include <windows.h>
  # include "winclip.pro"
--- 22,27 ----
***************
*** 299,307 ****
      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;
--- 298,304 ----
***************
*** 361,367 ****
      }
      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)
  	{
--- 358,363 ----
***************
*** 391,400 ****
  		GlobalUnlock(hMemW);
  	    }
  	}
! 	else
! #endif
! 	    /* Get the clipboard in the Active codepage. */
! 	    if (IsClipboardFormatAvailable(CF_TEXT))
  	{
  	    if ((hMem = GetClipboardData(CF_TEXT)) != NULL)
  	    {
--- 387,394 ----
  		GlobalUnlock(hMemW);
  	    }
  	}
! 	/* Get the clipboard in the Active codepage. */
! 	else if (IsClipboardFormatAvailable(CF_TEXT))
  	{
  	    if ((hMem = GetClipboardData(CF_TEXT)) != NULL)
  	    {
***************
*** 417,423 ****
  			    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);
--- 411,416 ----
***************
*** 426,432 ****
  		    str_size = maxlen;
  		    str = to_free;
  		}
- #endif
  	    }
  	}
      }
--- 419,424 ----
***************
*** 454,462 ****
      if (rawh != NULL)
  	GlobalUnlock(rawh);
      CloseClipboard();
- #if defined(MSWIN)
      vim_free(to_free);
- #endif
  }
  
  /*
--- 446,452 ----
***************
*** 471,479 ****
      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;
--- 461,467 ----
***************
*** 508,514 ****
  	    metadata.rawlen = 0;
      }
  
- # if defined(MSWIN)
      {
  	WCHAR		*out;
  	int		len = metadata.txtlen;
--- 496,501 ----
***************
*** 550,556 ****
  	    metadata.ucslen = len;
  	}
      }
- # endif
  
      /* Allocate memory for the text, add one NUL byte to terminate the string.
       */
--- 537,542 ----
***************
*** 590,602 ****
  	{
  	    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);
--- 576,586 ----
***************
*** 611,620 ****
  	GlobalFree(hMemRaw);
      if (hMem)
  	GlobalFree(hMem);
- # if defined(MSWIN)
      if (hMemW)
  	GlobalFree(hMemW);
- # endif
      if (hMemVim)
  	GlobalFree(hMemVim);
  }
--- 595,602 ----
***************
*** 746,752 ****
      return enc_str;
  }
  
- #if defined(MSWIN) || defined(PROTO)
  /*
   * Convert from the active codepage to 'encoding'.
   * Input is "str[str_size]".
--- 728,733 ----
***************
*** 796,799 ****
  	vim_free(widestr);
      }
  }
- #endif
--- 777,779 ----
*** ../vim-8.1.0983/src/version.c	2019-02-26 17:03:49.845487937 +0100
--- src/version.c	2019-02-27 14:10:55.106118602 +0100
***************
*** 781,782 ****
--- 781,784 ----
  {   /* Add new patch number below this line */
+ /**/
+     984,
  /**/

-- 
How To Keep A Healthy Level Of Insanity:
5. Put decaf in the coffee maker for 3 weeks. Once everyone has gotten
   over their caffeine addictions, switch to espresso.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///